diff --git a/app/fonttosfnt/AUTHORS b/app/fonttosfnt/AUTHORS new file mode 100644 index 000000000..e69de29bb diff --git a/app/fonttosfnt/COPYING b/app/fonttosfnt/COPYING new file mode 100644 index 000000000..7f33cbfd2 --- /dev/null +++ b/app/fonttosfnt/COPYING @@ -0,0 +1,12 @@ +This is a stub file. This package has not yet had its complete licensing +information compiled. Please see the individual source files for details on +your rights to use and modify this software. + +Please submit updated COPYING files to the Xorg bugzilla: + +https://bugs.freedesktop.org/enter_bug.cgi?product=xorg + +All licensing questions regarding this software should be directed at the +Xorg mailing list: + +http://lists.freedesktop.org/mailman/listinfo/xorg diff --git a/app/fonttosfnt/ChangeLog b/app/fonttosfnt/ChangeLog new file mode 100644 index 000000000..de4d8b248 --- /dev/null +++ b/app/fonttosfnt/ChangeLog @@ -0,0 +1,210 @@ +commit 72caf26ad336b3de9af3e640f939ea2cd0caa42b +Author: Adam Jackson +Date: Thu Oct 12 20:56:01 2006 -0400 + + Fix the ChangeLog hook to distcheck. + +commit b30bd59af161fc0907d497101f10705c7b575008 +Author: Matthieu Herrb +Date: Sun Jul 16 10:43:55 2006 +0200 + + Replace ChangeLog with a auto-generated git-log + +commit f5d7f68599f4d2ec86df0910f8c823b8feabc6db +Author: Matthieu Herrb +Date: Sun Jul 16 10:32:52 2006 +0200 + + .cvsignore -> .gitignore + +commit b651f24b766c9e76dec8a14c68623f4b7fa68141 +Author: Matthieu Herrb +Date: Sun Jul 16 10:31:26 2006 +0200 + + Don't include freetype internal headers. + +commit d00a25b26be87fdc06e20b0616f2fa34fe34e0b0 +Author: Kevin E Martin +Date: Wed Dec 21 02:29:42 2005 +0000 + + Update package version for X11R7 release. + +commit 697369878ec5ce26d0ab88efd2b58129c5a56881 +Author: Adam Jackson +Date: Mon Dec 19 16:22:40 2005 +0000 + + Stub COPYING files + +commit 7aa1cd75f6164d1bf33e11464e7c4edb32f29dd6 +Author: Kevin E Martin +Date: Thu Dec 15 00:24:02 2005 +0000 + + Update package version number for final X11R7 release candidate. + +commit 465400df7122f178102fac935ca6138d8a6cfbeb +Author: Kevin E Martin +Date: Tue Dec 6 22:48:16 2005 +0000 + + Change *man_SOURCES ==> *man_PRE to fix autotools warnings. + +commit d76c640e4172b32112e527e83458345da3fc715c +Author: Kevin E Martin +Date: Sat Dec 3 05:49:15 2005 +0000 + + Update package version number for X11R7 RC3 release. + +commit 0f9a04d1abab2760d3cb145b0e907c8509c8d3e7 +Author: Alan Coopersmith +Date: Mon Nov 28 22:01:36 2005 +0000 + + Change *mandir targets to use new *_MAN_DIR variables set by xorg-macros.m4 + update to fix bug #5167 (Linux prefers *.1x man pages in man1 subdir) + +commit 7225a9cdbd7b683d78bca2464d89bbe51fe185cd +Author: Eric Anholt +Date: Mon Nov 21 10:34:55 2005 +0000 + + Another pass at .cvsignores for apps. + +commit bc943ad21ca3c46b48dcec0954ed80129ac3d4ac +Author: Eric Anholt +Date: Sun Nov 20 22:08:48 2005 +0000 + + Add/improve .cvsignore files for apps. + +commit 270074ea7d3194b91cd14c17f750c4965f7ba9fb +Author: Alan Coopersmith +Date: Sun Nov 20 18:14:10 2005 +0000 + + fonttosfnt only depends on xproto headers, not x11 library + +commit 8221726955cf4be32d56b63d95c119d0f5ad3749 +Author: Kevin E Martin +Date: Wed Nov 9 21:09:19 2005 +0000 + + Update package version number for X11R7 RC2 release. + +commit 26f1c8de351a6c56aafa337b6002a345e835e017 +Author: Kean Johnson +Date: Tue Nov 8 06:33:31 2005 +0000 + + See ChangeLog entry 2005-11-07 for details. + +commit 7827761d51b92f82e457df0c132b52817a5c2783 +Author: Kevin E Martin +Date: Wed Oct 19 02:47:48 2005 +0000 + + Update package version number for RC1 release. + +commit 9d4c03cd1be37e2c300b45b250ed52bcfdda65f2 +Author: Alan Coopersmith +Date: Mon Oct 17 23:56:19 2005 +0000 + + Use @APP_MAN_SUFFIX@ instead of $(APP_MAN_SUFFIX) in macro substitutions to + work better with BSD make + +commit 0dfc246519b4e2d4e2dee91835c762b1263c5a90 +Author: Alan Coopersmith +Date: Fri Oct 14 00:25:41 2005 +0000 + + Use sed to fill in variables in man page + +commit 21d2888221fbb156398cb69d12798d2c16f3c8a0 +Author: Matthieu Herrb +Date: Sun Sep 11 12:43:13 2005 +0000 + + change the order of option to prevent automake from inserting a line break + that causes problems with BSD make later. + +commit fcfbfe0f7ddb621b1b0e99fba6b386221fb56263 +Author: Alan Coopersmith +Date: Mon Aug 1 20:25:27 2005 +0000 + + Install man pages to section 1 instead of section m (Patch from Donnie + Berkholz) + +commit 257b9388fc234b2f8d515124784ce9e42db6bb0d +Author: Alan Coopersmith +Date: Sat Jul 30 19:32:32 2005 +0000 + + Add -D flags to clear more compiler warnings (Stefan Dirsch) + +commit 31913e37864f621db1bd6c7e578cad1ade060f84 +Author: Kevin E Martin +Date: Fri Jul 29 21:22:28 2005 +0000 + + Various changes preparing packages for RC0: + - Verify and update package version numbers as needed + - Implement versioning scheme + - Change bug address to point to bugzilla bug entry form + - Disable loadable i18n in libX11 by default (use --enable-loadable-i18n to + reenable it) + - Fix makedepend to use pkgconfig and pass distcheck + - Update build script to build macros first + - Update modular Xorg version + +commit ed904c57d881eb9bcd09aeb8722fbb55687f3600 +Author: Adam Jackson +Date: Wed Jul 20 19:31:48 2005 +0000 + + Use a unique token for PKG_CHECK_MODULES. Otherwise, if you use a global + configure cache, you cache it, and the cached value is probably wrong. + +commit b209b9a7f683c10a77ed2e03da79b7ac1abc4844 +Author: Søren Sandmann Pedersen +Date: Wed Jul 6 19:46:18 2005 +0000 + + Build system for fonttosfnt + +commit e8571878caa5d35f712e158a45391584da3d5e47 +Author: Egbert Eich +Date: Mon May 24 19:06:59 2004 +0000 + + Fix build glitches when building modules independently using Imake. + +commit 417d53e38e84d63dfa2705f41d46ec1df777a8ad +Author: Egbert Eich +Date: Fri Apr 23 19:54:32 2004 +0000 + + Merging XORG-CURRENT into trunk + +commit 3d00e4afa32385f6926fcd61dfa071f263a773a3 +Author: Egbert Eich +Date: Sun Mar 14 08:34:50 2004 +0000 + + Importing vendor version xf86-4_4_99_1 on Sun Mar 14 00:26:39 PST 2004 + +commit 7e303eeeac4b6ffd8b04f8372a7466d59acadbca +Author: Egbert Eich +Date: Wed Mar 3 12:12:50 2004 +0000 + + Importing vendor version xf86-4_4_0 on Wed Mar 3 04:09:24 PST 2004 + +commit 8e100bba2b23ab7f91e7635de5e36f82ecbebbee +Author: Egbert Eich +Date: Thu Feb 26 13:36:15 2004 +0000 + + readding XFree86's cvs IDs + +commit be4a578da6742e6298edae3ec9ba56c331c89ba4 +Author: Egbert Eich +Date: Thu Feb 26 09:23:54 2004 +0000 + + Importing vendor version xf86-4_3_99_903 on Wed Feb 26 01:21:00 PST 2004 + +commit 24fddb6f3214189dae072f375403462d5e9f6091 +Author: Kaleb Keithley +Date: Fri Dec 19 20:55:44 2003 +0000 + + XFree86 4.3.99.902 (RC 2) + +commit f570299bb0f2a55e3059d1f4b42cb3d40a92793a +Author: Kaleb Keithley +Date: Tue Nov 25 19:29:02 2003 +0000 + + XFree86 4.3.99.16 Bring the tree up to date for the Cygwin folks + +commit a46389d96c54351cd95614f1e5eae495f51957f0 +Author: Kaleb Keithley +Date: Tue Nov 25 19:29:02 2003 +0000 + + Initial revision diff --git a/app/fonttosfnt/INSTALL b/app/fonttosfnt/INSTALL new file mode 100644 index 000000000..e69de29bb diff --git a/app/fonttosfnt/Makefile.am b/app/fonttosfnt/Makefile.am new file mode 100644 index 000000000..b1d6a132e --- /dev/null +++ b/app/fonttosfnt/Makefile.am @@ -0,0 +1,80 @@ +# +# Copyright 2005 Red Hat, Inc. +# +# Permission to use, copy, modify, distribute, and sell this software and its +# documentation for any purpose is hereby granted without fee, provided that +# the above copyright notice appear in all copies and that both that +# copyright notice and this permission notice appear in supporting +# documentation, and that the name of Red Hat not be used in +# advertising or publicity pertaining to distribution of the software without +# specific, written prior permission. Red Hat makes no +# representations about the suitability of this software for any purpose. It +# is provided "as is" without express or implied warranty. +# +# RED HAT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, +# INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO +# EVENT SHALL RED HAT BE LIABLE FOR ANY SPECIAL, INDIRECT OR +# CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, +# DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER +# TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +# PERFORMANCE OF THIS SOFTWARE. + +bin_PROGRAMS = fonttosfnt + +fonttosfnt_CFLAGS = -DXVENDORNAME=\"X.org\ Foundation\" $(FONTTOSFNT_CFLAGS) -DXVENDORNAMESHORT=\"X.org\" -D_BSD_SOURCE +fonttosfnt_LDADD = $(FONTTOSFNT_LIBS) -lm + +fonttosfnt_SOURCES = \ + fonttosfnt.c \ + fonttosfnt.h \ + read.c \ + struct.c \ + util.c \ + write.c + +if NEED_SETENV +fonttosfnt_SOURCES += env.c +fonttosfnt_CFLAGS += -DNEED_SETENV +endif + +appman_PRE = \ + fonttosfnt.man + + +appmandir = $(APP_MAN_DIR) + +appman_DATA = $(appman_PRE:man=@APP_MAN_SUFFIX@) + +EXTRA_DIST = $(appman_PRE) ChangeLog +CLEANFILES = $(appman_DATA) ChangeLog + +SED = sed + +# Strings to replace in man pages +XORGRELSTRING = @PACKAGE_STRING@ + XORGMANNAME = X Version 11 + +MAN_SUBSTS = \ + -e 's|__vendorversion__|"$(XORGRELSTRING)" "$(XORGMANNAME)"|' \ + -e 's|__xorgversion__|"$(XORGRELSTRING)" "$(XORGMANNAME)"|' \ + -e 's|__xservername__|Xorg|g' \ + -e 's|__xconfigfile__|xorg.conf|g' \ + -e 's|__projectroot__|$(prefix)|g' \ + -e 's|__apploaddir__|$(appdefaultdir)|' \ + -e 's|__appmansuffix__|$(APP_MAN_SUFFIX)|g' \ + -e 's|__libmansuffix__|$(LIB_MAN_SUFFIX)|g' \ + -e 's|__adminmansuffix__|$(ADMIN_MAN_SUFFIX)|g' \ + -e 's|__miscmansuffix__|$(MISC_MAN_SUFFIX)|g' \ + -e 's|__filemansuffix__|$(FILE_MAN_SUFFIX)|g' + +SUFFIXES = .$(APP_MAN_SUFFIX) .man + +.man.$(APP_MAN_SUFFIX): + sed $(MAN_SUBSTS) < $< > $@ + +.PHONY: ChangeLog + +ChangeLog: + git-log > ChangeLog + +dist-hook: ChangeLog diff --git a/app/fonttosfnt/Makefile.in b/app/fonttosfnt/Makefile.in new file mode 100644 index 000000000..8d67991e4 --- /dev/null +++ b/app/fonttosfnt/Makefile.in @@ -0,0 +1,751 @@ +# Makefile.in generated by automake 1.9.6 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005 Free Software Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +# +# Copyright 2005 Red Hat, Inc. +# +# Permission to use, copy, modify, distribute, and sell this software and its +# documentation for any purpose is hereby granted without fee, provided that +# the above copyright notice appear in all copies and that both that +# copyright notice and this permission notice appear in supporting +# documentation, and that the name of Red Hat not be used in +# advertising or publicity pertaining to distribution of the software without +# specific, written prior permission. Red Hat makes no +# representations about the suitability of this software for any purpose. It +# is provided "as is" without express or implied warranty. +# +# RED HAT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, +# INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO +# EVENT SHALL RED HAT BE LIABLE FOR ANY SPECIAL, INDIRECT OR +# CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, +# DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER +# TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +# PERFORMANCE OF THIS SOFTWARE. + + +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +top_builddir = . +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +INSTALL = @INSTALL@ +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +bin_PROGRAMS = fonttosfnt$(EXEEXT) +@NEED_SETENV_TRUE@am__append_1 = env.c +@NEED_SETENV_TRUE@am__append_2 = -DNEED_SETENV +DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \ + $(srcdir)/Makefile.in $(srcdir)/config.h.in \ + $(top_srcdir)/configure AUTHORS COPYING ChangeLog INSTALL NEWS \ + compile config.guess config.sub depcomp install-sh missing +subdir = . +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ + configure.lineno configure.status.lineno +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = config.h +CONFIG_CLEAN_FILES = +am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(appmandir)" +binPROGRAMS_INSTALL = $(INSTALL_PROGRAM) +PROGRAMS = $(bin_PROGRAMS) +am__fonttosfnt_SOURCES_DIST = fonttosfnt.c fonttosfnt.h read.c \ + struct.c util.c write.c env.c +@NEED_SETENV_TRUE@am__objects_1 = fonttosfnt-env.$(OBJEXT) +am_fonttosfnt_OBJECTS = fonttosfnt-fonttosfnt.$(OBJEXT) \ + fonttosfnt-read.$(OBJEXT) fonttosfnt-struct.$(OBJEXT) \ + fonttosfnt-util.$(OBJEXT) fonttosfnt-write.$(OBJEXT) \ + $(am__objects_1) +fonttosfnt_OBJECTS = $(am_fonttosfnt_OBJECTS) +am__DEPENDENCIES_1 = +fonttosfnt_DEPENDENCIES = $(am__DEPENDENCIES_1) +DEFAULT_INCLUDES = -I. -I$(srcdir) -I. +depcomp = $(SHELL) $(top_srcdir)/depcomp +am__depfiles_maybe = depfiles +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +CCLD = $(CC) +LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ +SOURCES = $(fonttosfnt_SOURCES) +DIST_SOURCES = $(am__fonttosfnt_SOURCES_DIST) +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = `echo $$p | sed -e 's|^.*/||'`; +appmanDATA_INSTALL = $(INSTALL_DATA) +DATA = $(appman_DATA) +ETAGS = etags +CTAGS = ctags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +distdir = $(PACKAGE)-$(VERSION) +top_distdir = $(distdir) +am__remove_distdir = \ + { test ! -d $(distdir) \ + || { find $(distdir) -type d ! -perm -200 -exec chmod u+w {} ';' \ + && rm -fr $(distdir); }; } +DIST_ARCHIVES = $(distdir).tar.gz $(distdir).tar.bz2 +GZIP_ENV = --best +distuninstallcheck_listfiles = find . -type f -print +distcleancheck_listfiles = find . -type f -print +ACLOCAL = @ACLOCAL@ +ADMIN_MAN_DIR = @ADMIN_MAN_DIR@ +ADMIN_MAN_SUFFIX = @ADMIN_MAN_SUFFIX@ +AMDEP_FALSE = @AMDEP_FALSE@ +AMDEP_TRUE = @AMDEP_TRUE@ +AMTAR = @AMTAR@ +APP_MAN_DIR = @APP_MAN_DIR@ +APP_MAN_SUFFIX = @APP_MAN_SUFFIX@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPPFLAGS = @CPPFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DRIVER_MAN_DIR = @DRIVER_MAN_DIR@ +DRIVER_MAN_SUFFIX = @DRIVER_MAN_SUFFIX@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EXEEXT = @EXEEXT@ +FILE_MAN_DIR = @FILE_MAN_DIR@ +FILE_MAN_SUFFIX = @FILE_MAN_SUFFIX@ +FONTTOSFNT_CFLAGS = @FONTTOSFNT_CFLAGS@ +FONTTOSFNT_LIBS = @FONTTOSFNT_LIBS@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIB_MAN_DIR = @LIB_MAN_DIR@ +LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@ +LTLIBOBJS = @LTLIBOBJS@ +MAINT = @MAINT@ +MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@ +MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@ +MAKEINFO = @MAKEINFO@ +MISC_MAN_DIR = @MISC_MAN_DIR@ +MISC_MAN_SUFFIX = @MISC_MAN_SUFFIX@ +NEED_SETENV_FALSE = @NEED_SETENV_FALSE@ +NEED_SETENV_TRUE = @NEED_SETENV_TRUE@ +OBJEXT = @OBJEXT@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PKG_CONFIG = @PKG_CONFIG@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +VERSION = @VERSION@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_STRIP = @ac_ct_STRIP@ +ac_pt_PKG_CONFIG = @ac_pt_PKG_CONFIG@ +am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ +am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +datadir = @datadir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +fonttosfnt_CFLAGS = -DXVENDORNAME=\"X.org\ Foundation\" \ + $(FONTTOSFNT_CFLAGS) -DXVENDORNAMESHORT=\"X.org\" \ + -D_BSD_SOURCE $(am__append_2) +fonttosfnt_LDADD = $(FONTTOSFNT_LIBS) -lm +fonttosfnt_SOURCES = fonttosfnt.c fonttosfnt.h read.c struct.c util.c \ + write.c $(am__append_1) +appman_PRE = \ + fonttosfnt.man + +appmandir = $(APP_MAN_DIR) +appman_DATA = $(appman_PRE:man=@APP_MAN_SUFFIX@) +EXTRA_DIST = $(appman_PRE) ChangeLog +CLEANFILES = $(appman_DATA) ChangeLog +SED = sed + +# Strings to replace in man pages +XORGRELSTRING = @PACKAGE_STRING@ +XORGMANNAME = X Version 11 +MAN_SUBSTS = \ + -e 's|__vendorversion__|"$(XORGRELSTRING)" "$(XORGMANNAME)"|' \ + -e 's|__xorgversion__|"$(XORGRELSTRING)" "$(XORGMANNAME)"|' \ + -e 's|__xservername__|Xorg|g' \ + -e 's|__xconfigfile__|xorg.conf|g' \ + -e 's|__projectroot__|$(prefix)|g' \ + -e 's|__apploaddir__|$(appdefaultdir)|' \ + -e 's|__appmansuffix__|$(APP_MAN_SUFFIX)|g' \ + -e 's|__libmansuffix__|$(LIB_MAN_SUFFIX)|g' \ + -e 's|__adminmansuffix__|$(ADMIN_MAN_SUFFIX)|g' \ + -e 's|__miscmansuffix__|$(MISC_MAN_SUFFIX)|g' \ + -e 's|__filemansuffix__|$(FILE_MAN_SUFFIX)|g' + +SUFFIXES = .$(APP_MAN_SUFFIX) .man +all: config.h + $(MAKE) $(AM_MAKEFLAGS) all-am + +.SUFFIXES: +.SUFFIXES: .$(APP_MAN_SUFFIX) .man .c .o .obj +am--refresh: + @: +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + echo ' cd $(srcdir) && $(AUTOMAKE) --gnu '; \ + cd $(srcdir) && $(AUTOMAKE) --gnu \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu Makefile'; \ + cd $(top_srcdir) && \ + $(AUTOMAKE) --gnu Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + echo ' $(SHELL) ./config.status'; \ + $(SHELL) ./config.status;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + $(SHELL) ./config.status --recheck + +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(srcdir) && $(AUTOCONF) +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) + +config.h: stamp-h1 + @if test ! -f $@; then \ + rm -f stamp-h1; \ + $(MAKE) stamp-h1; \ + else :; fi + +stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status + @rm -f stamp-h1 + cd $(top_builddir) && $(SHELL) ./config.status config.h +$(srcdir)/config.h.in: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(top_srcdir) && $(AUTOHEADER) + rm -f stamp-h1 + touch $@ + +distclean-hdr: + -rm -f config.h stamp-h1 +install-binPROGRAMS: $(bin_PROGRAMS) + @$(NORMAL_INSTALL) + test -z "$(bindir)" || $(mkdir_p) "$(DESTDIR)$(bindir)" + @list='$(bin_PROGRAMS)'; for p in $$list; do \ + p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ + if test -f $$p \ + ; then \ + f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \ + echo " $(INSTALL_PROGRAM_ENV) $(binPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(bindir)/$$f'"; \ + $(INSTALL_PROGRAM_ENV) $(binPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(bindir)/$$f" || exit 1; \ + else :; fi; \ + done + +uninstall-binPROGRAMS: + @$(NORMAL_UNINSTALL) + @list='$(bin_PROGRAMS)'; for p in $$list; do \ + f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \ + echo " rm -f '$(DESTDIR)$(bindir)/$$f'"; \ + rm -f "$(DESTDIR)$(bindir)/$$f"; \ + done + +clean-binPROGRAMS: + -test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS) +fonttosfnt$(EXEEXT): $(fonttosfnt_OBJECTS) $(fonttosfnt_DEPENDENCIES) + @rm -f fonttosfnt$(EXEEXT) + $(LINK) $(fonttosfnt_LDFLAGS) $(fonttosfnt_OBJECTS) $(fonttosfnt_LDADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fonttosfnt-env.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fonttosfnt-fonttosfnt.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fonttosfnt-read.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fonttosfnt-struct.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fonttosfnt-util.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fonttosfnt-write.Po@am__quote@ + +.c.o: +@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c $< + +.c.obj: +@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` + +fonttosfnt-fonttosfnt.o: fonttosfnt.c +@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fonttosfnt_CFLAGS) $(CFLAGS) -MT fonttosfnt-fonttosfnt.o -MD -MP -MF "$(DEPDIR)/fonttosfnt-fonttosfnt.Tpo" -c -o fonttosfnt-fonttosfnt.o `test -f 'fonttosfnt.c' || echo '$(srcdir)/'`fonttosfnt.c; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/fonttosfnt-fonttosfnt.Tpo" "$(DEPDIR)/fonttosfnt-fonttosfnt.Po"; else rm -f "$(DEPDIR)/fonttosfnt-fonttosfnt.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='fonttosfnt.c' object='fonttosfnt-fonttosfnt.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fonttosfnt_CFLAGS) $(CFLAGS) -c -o fonttosfnt-fonttosfnt.o `test -f 'fonttosfnt.c' || echo '$(srcdir)/'`fonttosfnt.c + +fonttosfnt-fonttosfnt.obj: fonttosfnt.c +@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fonttosfnt_CFLAGS) $(CFLAGS) -MT fonttosfnt-fonttosfnt.obj -MD -MP -MF "$(DEPDIR)/fonttosfnt-fonttosfnt.Tpo" -c -o fonttosfnt-fonttosfnt.obj `if test -f 'fonttosfnt.c'; then $(CYGPATH_W) 'fonttosfnt.c'; else $(CYGPATH_W) '$(srcdir)/fonttosfnt.c'; fi`; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/fonttosfnt-fonttosfnt.Tpo" "$(DEPDIR)/fonttosfnt-fonttosfnt.Po"; else rm -f "$(DEPDIR)/fonttosfnt-fonttosfnt.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='fonttosfnt.c' object='fonttosfnt-fonttosfnt.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fonttosfnt_CFLAGS) $(CFLAGS) -c -o fonttosfnt-fonttosfnt.obj `if test -f 'fonttosfnt.c'; then $(CYGPATH_W) 'fonttosfnt.c'; else $(CYGPATH_W) '$(srcdir)/fonttosfnt.c'; fi` + +fonttosfnt-read.o: read.c +@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fonttosfnt_CFLAGS) $(CFLAGS) -MT fonttosfnt-read.o -MD -MP -MF "$(DEPDIR)/fonttosfnt-read.Tpo" -c -o fonttosfnt-read.o `test -f 'read.c' || echo '$(srcdir)/'`read.c; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/fonttosfnt-read.Tpo" "$(DEPDIR)/fonttosfnt-read.Po"; else rm -f "$(DEPDIR)/fonttosfnt-read.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='read.c' object='fonttosfnt-read.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fonttosfnt_CFLAGS) $(CFLAGS) -c -o fonttosfnt-read.o `test -f 'read.c' || echo '$(srcdir)/'`read.c + +fonttosfnt-read.obj: read.c +@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fonttosfnt_CFLAGS) $(CFLAGS) -MT fonttosfnt-read.obj -MD -MP -MF "$(DEPDIR)/fonttosfnt-read.Tpo" -c -o fonttosfnt-read.obj `if test -f 'read.c'; then $(CYGPATH_W) 'read.c'; else $(CYGPATH_W) '$(srcdir)/read.c'; fi`; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/fonttosfnt-read.Tpo" "$(DEPDIR)/fonttosfnt-read.Po"; else rm -f "$(DEPDIR)/fonttosfnt-read.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='read.c' object='fonttosfnt-read.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fonttosfnt_CFLAGS) $(CFLAGS) -c -o fonttosfnt-read.obj `if test -f 'read.c'; then $(CYGPATH_W) 'read.c'; else $(CYGPATH_W) '$(srcdir)/read.c'; fi` + +fonttosfnt-struct.o: struct.c +@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fonttosfnt_CFLAGS) $(CFLAGS) -MT fonttosfnt-struct.o -MD -MP -MF "$(DEPDIR)/fonttosfnt-struct.Tpo" -c -o fonttosfnt-struct.o `test -f 'struct.c' || echo '$(srcdir)/'`struct.c; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/fonttosfnt-struct.Tpo" "$(DEPDIR)/fonttosfnt-struct.Po"; else rm -f "$(DEPDIR)/fonttosfnt-struct.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='struct.c' object='fonttosfnt-struct.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fonttosfnt_CFLAGS) $(CFLAGS) -c -o fonttosfnt-struct.o `test -f 'struct.c' || echo '$(srcdir)/'`struct.c + +fonttosfnt-struct.obj: struct.c +@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fonttosfnt_CFLAGS) $(CFLAGS) -MT fonttosfnt-struct.obj -MD -MP -MF "$(DEPDIR)/fonttosfnt-struct.Tpo" -c -o fonttosfnt-struct.obj `if test -f 'struct.c'; then $(CYGPATH_W) 'struct.c'; else $(CYGPATH_W) '$(srcdir)/struct.c'; fi`; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/fonttosfnt-struct.Tpo" "$(DEPDIR)/fonttosfnt-struct.Po"; else rm -f "$(DEPDIR)/fonttosfnt-struct.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='struct.c' object='fonttosfnt-struct.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fonttosfnt_CFLAGS) $(CFLAGS) -c -o fonttosfnt-struct.obj `if test -f 'struct.c'; then $(CYGPATH_W) 'struct.c'; else $(CYGPATH_W) '$(srcdir)/struct.c'; fi` + +fonttosfnt-util.o: util.c +@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fonttosfnt_CFLAGS) $(CFLAGS) -MT fonttosfnt-util.o -MD -MP -MF "$(DEPDIR)/fonttosfnt-util.Tpo" -c -o fonttosfnt-util.o `test -f 'util.c' || echo '$(srcdir)/'`util.c; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/fonttosfnt-util.Tpo" "$(DEPDIR)/fonttosfnt-util.Po"; else rm -f "$(DEPDIR)/fonttosfnt-util.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='util.c' object='fonttosfnt-util.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fonttosfnt_CFLAGS) $(CFLAGS) -c -o fonttosfnt-util.o `test -f 'util.c' || echo '$(srcdir)/'`util.c + +fonttosfnt-util.obj: util.c +@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fonttosfnt_CFLAGS) $(CFLAGS) -MT fonttosfnt-util.obj -MD -MP -MF "$(DEPDIR)/fonttosfnt-util.Tpo" -c -o fonttosfnt-util.obj `if test -f 'util.c'; then $(CYGPATH_W) 'util.c'; else $(CYGPATH_W) '$(srcdir)/util.c'; fi`; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/fonttosfnt-util.Tpo" "$(DEPDIR)/fonttosfnt-util.Po"; else rm -f "$(DEPDIR)/fonttosfnt-util.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='util.c' object='fonttosfnt-util.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fonttosfnt_CFLAGS) $(CFLAGS) -c -o fonttosfnt-util.obj `if test -f 'util.c'; then $(CYGPATH_W) 'util.c'; else $(CYGPATH_W) '$(srcdir)/util.c'; fi` + +fonttosfnt-write.o: write.c +@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fonttosfnt_CFLAGS) $(CFLAGS) -MT fonttosfnt-write.o -MD -MP -MF "$(DEPDIR)/fonttosfnt-write.Tpo" -c -o fonttosfnt-write.o `test -f 'write.c' || echo '$(srcdir)/'`write.c; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/fonttosfnt-write.Tpo" "$(DEPDIR)/fonttosfnt-write.Po"; else rm -f "$(DEPDIR)/fonttosfnt-write.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='write.c' object='fonttosfnt-write.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fonttosfnt_CFLAGS) $(CFLAGS) -c -o fonttosfnt-write.o `test -f 'write.c' || echo '$(srcdir)/'`write.c + +fonttosfnt-write.obj: write.c +@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fonttosfnt_CFLAGS) $(CFLAGS) -MT fonttosfnt-write.obj -MD -MP -MF "$(DEPDIR)/fonttosfnt-write.Tpo" -c -o fonttosfnt-write.obj `if test -f 'write.c'; then $(CYGPATH_W) 'write.c'; else $(CYGPATH_W) '$(srcdir)/write.c'; fi`; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/fonttosfnt-write.Tpo" "$(DEPDIR)/fonttosfnt-write.Po"; else rm -f "$(DEPDIR)/fonttosfnt-write.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='write.c' object='fonttosfnt-write.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fonttosfnt_CFLAGS) $(CFLAGS) -c -o fonttosfnt-write.obj `if test -f 'write.c'; then $(CYGPATH_W) 'write.c'; else $(CYGPATH_W) '$(srcdir)/write.c'; fi` + +fonttosfnt-env.o: env.c +@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fonttosfnt_CFLAGS) $(CFLAGS) -MT fonttosfnt-env.o -MD -MP -MF "$(DEPDIR)/fonttosfnt-env.Tpo" -c -o fonttosfnt-env.o `test -f 'env.c' || echo '$(srcdir)/'`env.c; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/fonttosfnt-env.Tpo" "$(DEPDIR)/fonttosfnt-env.Po"; else rm -f "$(DEPDIR)/fonttosfnt-env.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='env.c' object='fonttosfnt-env.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fonttosfnt_CFLAGS) $(CFLAGS) -c -o fonttosfnt-env.o `test -f 'env.c' || echo '$(srcdir)/'`env.c + +fonttosfnt-env.obj: env.c +@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fonttosfnt_CFLAGS) $(CFLAGS) -MT fonttosfnt-env.obj -MD -MP -MF "$(DEPDIR)/fonttosfnt-env.Tpo" -c -o fonttosfnt-env.obj `if test -f 'env.c'; then $(CYGPATH_W) 'env.c'; else $(CYGPATH_W) '$(srcdir)/env.c'; fi`; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/fonttosfnt-env.Tpo" "$(DEPDIR)/fonttosfnt-env.Po"; else rm -f "$(DEPDIR)/fonttosfnt-env.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='env.c' object='fonttosfnt-env.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(fonttosfnt_CFLAGS) $(CFLAGS) -c -o fonttosfnt-env.obj `if test -f 'env.c'; then $(CYGPATH_W) 'env.c'; else $(CYGPATH_W) '$(srcdir)/env.c'; fi` +uninstall-info-am: +install-appmanDATA: $(appman_DATA) + @$(NORMAL_INSTALL) + test -z "$(appmandir)" || $(mkdir_p) "$(DESTDIR)$(appmandir)" + @list='$(appman_DATA)'; for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + f=$(am__strip_dir) \ + echo " $(appmanDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(appmandir)/$$f'"; \ + $(appmanDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(appmandir)/$$f"; \ + done + +uninstall-appmanDATA: + @$(NORMAL_UNINSTALL) + @list='$(appman_DATA)'; for p in $$list; do \ + f=$(am__strip_dir) \ + echo " rm -f '$(DESTDIR)$(appmandir)/$$f'"; \ + rm -f "$(DESTDIR)$(appmandir)/$$f"; \ + done + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$tags $$unique; \ + fi +ctags: CTAGS +CTAGS: $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + test -z "$(CTAGS_ARGS)$$tags$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$tags $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && cd $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) $$here + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + $(am__remove_distdir) + mkdir $(distdir) + @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ + list='$(DISTFILES)'; for file in $$list; do \ + case $$file in \ + $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ + $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ + esac; \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test "$$dir" != "$$file" && test "$$dir" != "."; then \ + dir="/$$dir"; \ + $(mkdir_p) "$(distdir)$$dir"; \ + else \ + dir=''; \ + fi; \ + if test -d $$d/$$file; then \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ + fi; \ + cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ + else \ + test -f $(distdir)/$$file \ + || cp -p $$d/$$file $(distdir)/$$file \ + || exit 1; \ + fi; \ + done + $(MAKE) $(AM_MAKEFLAGS) \ + top_distdir="$(top_distdir)" distdir="$(distdir)" \ + dist-hook + -find $(distdir) -type d ! -perm -777 -exec chmod a+rwx {} \; -o \ + ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \ + ! -type d ! -perm -400 -exec chmod a+r {} \; -o \ + ! -type d ! -perm -444 -exec $(SHELL) $(install_sh) -c -m a+r {} {} \; \ + || chmod -R a+r $(distdir) +dist-gzip: distdir + tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz + $(am__remove_distdir) +dist-bzip2: distdir + tardir=$(distdir) && $(am__tar) | bzip2 -9 -c >$(distdir).tar.bz2 + $(am__remove_distdir) + +dist-tarZ: distdir + tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z + $(am__remove_distdir) + +dist-shar: distdir + shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz + $(am__remove_distdir) + +dist-zip: distdir + -rm -f $(distdir).zip + zip -rq $(distdir).zip $(distdir) + $(am__remove_distdir) + +dist dist-all: distdir + tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz + tardir=$(distdir) && $(am__tar) | bzip2 -9 -c >$(distdir).tar.bz2 + $(am__remove_distdir) + +# This target untars the dist file and tries a VPATH configuration. Then +# it guarantees that the distribution is self-contained by making another +# tarfile. +distcheck: dist + case '$(DIST_ARCHIVES)' in \ + *.tar.gz*) \ + GZIP=$(GZIP_ENV) gunzip -c $(distdir).tar.gz | $(am__untar) ;;\ + *.tar.bz2*) \ + bunzip2 -c $(distdir).tar.bz2 | $(am__untar) ;;\ + *.tar.Z*) \ + uncompress -c $(distdir).tar.Z | $(am__untar) ;;\ + *.shar.gz*) \ + GZIP=$(GZIP_ENV) gunzip -c $(distdir).shar.gz | unshar ;;\ + *.zip*) \ + unzip $(distdir).zip ;;\ + esac + chmod -R a-w $(distdir); chmod a+w $(distdir) + mkdir $(distdir)/_build + mkdir $(distdir)/_inst + chmod a-w $(distdir) + dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \ + && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ + && cd $(distdir)/_build \ + && ../configure --srcdir=.. --prefix="$$dc_install_base" \ + $(DISTCHECK_CONFIGURE_FLAGS) \ + && $(MAKE) $(AM_MAKEFLAGS) \ + && $(MAKE) $(AM_MAKEFLAGS) dvi \ + && $(MAKE) $(AM_MAKEFLAGS) check \ + && $(MAKE) $(AM_MAKEFLAGS) install \ + && $(MAKE) $(AM_MAKEFLAGS) installcheck \ + && $(MAKE) $(AM_MAKEFLAGS) uninstall \ + && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \ + distuninstallcheck \ + && chmod -R a-w "$$dc_install_base" \ + && ({ \ + (cd ../.. && umask 077 && mkdir "$$dc_destdir") \ + && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \ + && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \ + && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \ + distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \ + } || { rm -rf "$$dc_destdir"; exit 1; }) \ + && rm -rf "$$dc_destdir" \ + && $(MAKE) $(AM_MAKEFLAGS) dist \ + && rm -rf $(DIST_ARCHIVES) \ + && $(MAKE) $(AM_MAKEFLAGS) distcleancheck + $(am__remove_distdir) + @(echo "$(distdir) archives ready for distribution: "; \ + list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \ + sed -e '1{h;s/./=/g;p;x;}' -e '$${p;x;}' +distuninstallcheck: + @cd $(distuninstallcheck_dir) \ + && test `$(distuninstallcheck_listfiles) | wc -l` -le 1 \ + || { echo "ERROR: files left after uninstall:" ; \ + if test -n "$(DESTDIR)"; then \ + echo " (check DESTDIR support)"; \ + fi ; \ + $(distuninstallcheck_listfiles) ; \ + exit 1; } >&2 +distcleancheck: distclean + @if test '$(srcdir)' = . ; then \ + echo "ERROR: distcleancheck can only run from a VPATH build" ; \ + exit 1 ; \ + fi + @test `$(distcleancheck_listfiles) | wc -l` -eq 0 \ + || { echo "ERROR: files left in build directory after distclean:" ; \ + $(distcleancheck_listfiles) ; \ + exit 1; } >&2 +check-am: all-am +check: check-am +all-am: Makefile $(PROGRAMS) $(DATA) config.h +installdirs: + for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(appmandir)"; do \ + test -z "$$dir" || $(mkdir_p) "$$dir"; \ + done +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-binPROGRAMS clean-generic mostlyclean-am + +distclean: distclean-am + -rm -f $(am__CONFIG_DISTCLEAN_FILES) + -rm -rf ./$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-hdr distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +info: info-am + +info-am: + +install-data-am: install-appmanDATA + +install-exec-am: install-binPROGRAMS + +install-info: install-info-am + +install-man: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -f $(am__CONFIG_DISTCLEAN_FILES) + -rm -rf $(top_srcdir)/autom4te.cache + -rm -rf ./$(DEPDIR) + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-appmanDATA uninstall-binPROGRAMS \ + uninstall-info-am + +.PHONY: CTAGS GTAGS all all-am am--refresh check check-am clean \ + clean-binPROGRAMS clean-generic ctags dist dist-all dist-bzip2 \ + dist-gzip dist-hook dist-shar dist-tarZ dist-zip distcheck \ + distclean distclean-compile distclean-generic distclean-hdr \ + distclean-tags distcleancheck distdir distuninstallcheck dvi \ + dvi-am html html-am info info-am install install-am \ + install-appmanDATA install-binPROGRAMS install-data \ + install-data-am install-exec install-exec-am install-info \ + install-info-am install-man install-strip installcheck \ + installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-compile \ + mostlyclean-generic pdf pdf-am ps ps-am tags uninstall \ + uninstall-am uninstall-appmanDATA uninstall-binPROGRAMS \ + uninstall-info-am + + +.man.$(APP_MAN_SUFFIX): + sed $(MAN_SUBSTS) < $< > $@ + +.PHONY: ChangeLog + +ChangeLog: + git-log > ChangeLog + +dist-hook: ChangeLog +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/app/fonttosfnt/NEWS b/app/fonttosfnt/NEWS new file mode 100644 index 000000000..e69de29bb diff --git a/app/fonttosfnt/README b/app/fonttosfnt/README new file mode 100644 index 000000000..e69de29bb diff --git a/app/fonttosfnt/aclocal.m4 b/app/fonttosfnt/aclocal.m4 new file mode 100644 index 000000000..8fa6fea6d --- /dev/null +++ b/app/fonttosfnt/aclocal.m4 @@ -0,0 +1,1450 @@ +# generated automatically by aclocal 1.9.6 -*- Autoconf -*- + +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, +# 2005 Free Software Foundation, Inc. +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +# pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*- +# +# Copyright © 2004 Scott James Remnant . +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +# PKG_PROG_PKG_CONFIG([MIN-VERSION]) +# ---------------------------------- +AC_DEFUN([PKG_PROG_PKG_CONFIG], +[m4_pattern_forbid([^_?PKG_[A-Z_]+$]) +m4_pattern_allow([^PKG_CONFIG(_PATH)?$]) +AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])dnl +if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then + AC_PATH_TOOL([PKG_CONFIG], [pkg-config]) +fi +if test -n "$PKG_CONFIG"; then + _pkg_min_version=m4_default([$1], [0.9.0]) + AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version]) + if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then + AC_MSG_RESULT([yes]) + else + AC_MSG_RESULT([no]) + PKG_CONFIG="" + fi + +fi[]dnl +])# PKG_PROG_PKG_CONFIG + +# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) +# +# Check to see whether a particular set of modules exists. Similar +# to PKG_CHECK_MODULES(), but does not set variables or print errors. +# +# +# Similar to PKG_CHECK_MODULES, make sure that the first instance of +# this or PKG_CHECK_MODULES is called, or make sure to call +# PKG_CHECK_EXISTS manually +# -------------------------------------------------------------- +AC_DEFUN([PKG_CHECK_EXISTS], +[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl +if test -n "$PKG_CONFIG" && \ + AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then + m4_ifval([$2], [$2], [:]) +m4_ifvaln([$3], [else + $3])dnl +fi]) + + +# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES]) +# --------------------------------------------- +m4_define([_PKG_CONFIG], +[if test -n "$PKG_CONFIG"; then + if test -n "$$1"; then + pkg_cv_[]$1="$$1" + else + PKG_CHECK_EXISTS([$3], + [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`], + [pkg_failed=yes]) + fi +else + pkg_failed=untried +fi[]dnl +])# _PKG_CONFIG + +# _PKG_SHORT_ERRORS_SUPPORTED +# ----------------------------- +AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED], +[AC_REQUIRE([PKG_PROG_PKG_CONFIG]) +if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then + _pkg_short_errors_supported=yes +else + _pkg_short_errors_supported=no +fi[]dnl +])# _PKG_SHORT_ERRORS_SUPPORTED + + +# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND], +# [ACTION-IF-NOT-FOUND]) +# +# +# Note that if there is a possibility the first call to +# PKG_CHECK_MODULES might not happen, you should be sure to include an +# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac +# +# +# -------------------------------------------------------------- +AC_DEFUN([PKG_CHECK_MODULES], +[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl +AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl +AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl + +pkg_failed=no +AC_MSG_CHECKING([for $1]) + +_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2]) +_PKG_CONFIG([$1][_LIBS], [libs], [$2]) + +m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS +and $1[]_LIBS to avoid the need to call pkg-config. +See the pkg-config man page for more details.]) + +if test $pkg_failed = yes; then + _PKG_SHORT_ERRORS_SUPPORTED + if test $_pkg_short_errors_supported = yes; then + $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "$2"` + else + $1[]_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "$2"` + fi + # Put the nasty error message in config.log where it belongs + echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD + + ifelse([$4], , [AC_MSG_ERROR(dnl +[Package requirements ($2) were not met: + +$$1_PKG_ERRORS + +Consider adjusting the PKG_CONFIG_PATH environment variable if you +installed software in a non-standard prefix. + +_PKG_TEXT +])], + [AC_MSG_RESULT([no]) + $4]) +elif test $pkg_failed = untried; then + ifelse([$4], , [AC_MSG_FAILURE(dnl +[The pkg-config script could not be found or is too old. Make sure it +is in your PATH or set the PKG_CONFIG environment variable to the full +path to pkg-config. + +_PKG_TEXT + +To get pkg-config, see .])], + [$4]) +else + $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS + $1[]_LIBS=$pkg_cv_[]$1[]_LIBS + AC_MSG_RESULT([yes]) + ifelse([$3], , :, [$3]) +fi[]dnl +])# PKG_CHECK_MODULES + +dnl +dnl Copyright 2005-2006 Sun Microsystems, Inc. All rights reserved. +dnl +dnl Permission is hereby granted, free of charge, to any person obtaining a +dnl copy of this software and associated documentation files (the +dnl "Software"), to deal in the Software without restriction, including +dnl without limitation the rights to use, copy, modify, merge, publish, +dnl distribute, and/or sell copies of the Software, and to permit persons +dnl to whom the Software is furnished to do so, provided that the above +dnl copyright notice(s) and this permission notice appear in all copies of +dnl the Software and that both the above copyright notice(s) and this +dnl permission notice appear in supporting documentation. +dnl +dnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +dnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +dnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT +dnl OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR +dnl HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL +dnl INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING +dnl FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, +dnl NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION +dnl WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +dnl +dnl Except as contained in this notice, the name of a copyright holder +dnl shall not be used in advertising or otherwise to promote the sale, use +dnl or other dealings in this Software without prior written authorization +dnl of the copyright holder. + +# XORG_MACROS_VERSION(required-version) +# ------------------------------------- +# Minimum version: 1.1.0 +# +# If you're using a macro added in Version 1.1 or newer, include this in +# your configure.ac with the minimum required version, such as: +# XORG_MACROS_VERSION(1.1) +# +# To force at least a version with this macro defined, also add: +# m4_ifndef([XORG_MACROS_VERSION], [AC_FATAL([must install xorg-macros 1.1 or later before running autoconf/autogen])]) +# +# +# See the "minimum version" comment for each macro you use to see what +# version you require. +AC_DEFUN([XORG_MACROS_VERSION],[ + [XORG_MACROS_needed_version=$1 + XORG_MACROS_needed_major=`echo $XORG_MACROS_needed_version | sed 's/\..*$//'` + XORG_MACROS_needed_minor=`echo $XORG_MACROS_needed_version | sed -e 's/^[0-9]*\.//' -e 's/\..*$//'`] + AC_MSG_CHECKING([if xorg-macros used to generate configure is at least ${XORG_MACROS_needed_major}.${XORG_MACROS_needed_minor}]) + [XORG_MACROS_version=1.1.1 + XORG_MACROS_major=`echo $XORG_MACROS_version | sed 's/\..*$//'` + XORG_MACROS_minor=`echo $XORG_MACROS_version | sed -e 's/^[0-9]*\.//' -e 's/\..*$//'`] + if test $XORG_MACROS_major -ne $XORG_MACROS_needed_major ; then + AC_MSG_ERROR([configure built with incompatible version of xorg-macros.m4 - requires version ${XORG_MACROS_major}.x]) + fi + if test $XORG_MACROS_minor -lt $XORG_MACROS_needed_minor ; then + AC_MSG_ERROR([configure built with too old of a version of xorg-macros.m4 - requires version ${XORG_MACROS_major}.${XORG_MACROS_minor}.0 or newer]) + fi + AC_MSG_RESULT([yes, $XORG_MACROS_version]) +]) # XORG_MACROS_VERSION + +# XORG_PROG_RAWCPP() +# ------------------ +# Minimum version: 1.0.0 +# +# Find cpp program and necessary flags for use in pre-processing text files +# such as man pages and config files +AC_DEFUN([XORG_PROG_RAWCPP],[ +AC_REQUIRE([AC_PROG_CPP]) +AC_PATH_PROGS(RAWCPP, [cpp], [${CPP}], + [$PATH:/bin:/usr/bin:/usr/lib:/usr/libexec:/usr/ccs/lib:/usr/ccs/lbin:/lib]) + +# Check for flag to avoid builtin definitions - assumes unix is predefined, +# which is not the best choice for supporting other OS'es, but covers most +# of the ones we need for now. +AC_MSG_CHECKING([if $RAWCPP requires -undef]) +AC_LANG_CONFTEST([Does cpp redefine unix ?]) +if test `${RAWCPP} < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then + AC_MSG_RESULT([no]) +else + if test `${RAWCPP} -undef < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then + RAWCPPFLAGS=-undef + AC_MSG_RESULT([yes]) + else + AC_MSG_ERROR([${RAWCPP} defines unix with or without -undef. I don't know what to do.]) + fi +fi +rm -f conftest.$ac_ext + +AC_MSG_CHECKING([if $RAWCPP requires -traditional]) +AC_LANG_CONFTEST([Does cpp preserve "whitespace"?]) +if test `${RAWCPP} < conftest.$ac_ext | grep -c 'preserve \"'` -eq 1 ; then + AC_MSG_RESULT([no]) +else + if test `${RAWCPP} -traditional < conftest.$ac_ext | grep -c 'preserve \"'` -eq 1 ; then + RAWCPPFLAGS="${RAWCPPFLAGS} -traditional" + AC_MSG_RESULT([yes]) + else + AC_MSG_ERROR([${RAWCPP} does not preserve whitespace with or without -traditional. I don't know what to do.]) + fi +fi +rm -f conftest.$ac_ext +AC_SUBST(RAWCPPFLAGS) +]) # XORG_PROG_RAWCPP + +# XORG_MANPAGE_SECTIONS() +# ----------------------- +# Minimum version: 1.0.0 +# +# Determine which sections man pages go in for the different man page types +# on this OS - replaces *ManSuffix settings in old Imake *.cf per-os files. +# Not sure if there's any better way than just hardcoding by OS name. +# Override default settings by setting environment variables + +AC_DEFUN([XORG_MANPAGE_SECTIONS],[ +AC_REQUIRE([AC_CANONICAL_HOST]) + +if test x$APP_MAN_SUFFIX = x ; then + APP_MAN_SUFFIX=1 +fi +if test x$APP_MAN_DIR = x ; then + APP_MAN_DIR='$(mandir)/man$(APP_MAN_SUFFIX)' +fi + +if test x$LIB_MAN_SUFFIX = x ; then + LIB_MAN_SUFFIX=3 +fi +if test x$LIB_MAN_DIR = x ; then + LIB_MAN_DIR='$(mandir)/man$(LIB_MAN_SUFFIX)' +fi + +if test x$FILE_MAN_SUFFIX = x ; then + case $host_os in + solaris*) FILE_MAN_SUFFIX=4 ;; + *) FILE_MAN_SUFFIX=5 ;; + esac +fi +if test x$FILE_MAN_DIR = x ; then + FILE_MAN_DIR='$(mandir)/man$(FILE_MAN_SUFFIX)' +fi + +if test x$MISC_MAN_SUFFIX = x ; then + case $host_os in + solaris*) MISC_MAN_SUFFIX=5 ;; + *) MISC_MAN_SUFFIX=7 ;; + esac +fi +if test x$MISC_MAN_DIR = x ; then + MISC_MAN_DIR='$(mandir)/man$(MISC_MAN_SUFFIX)' +fi + +if test x$DRIVER_MAN_SUFFIX = x ; then + case $host_os in + solaris*) DRIVER_MAN_SUFFIX=7 ;; + *) DRIVER_MAN_SUFFIX=4 ;; + esac +fi +if test x$DRIVER_MAN_DIR = x ; then + DRIVER_MAN_DIR='$(mandir)/man$(DRIVER_MAN_SUFFIX)' +fi + +if test x$ADMIN_MAN_SUFFIX = x ; then + case $host_os in + solaris*) ADMIN_MAN_SUFFIX=1m ;; + *) ADMIN_MAN_SUFFIX=8 ;; + esac +fi +if test x$ADMIN_MAN_DIR = x ; then + ADMIN_MAN_DIR='$(mandir)/man$(ADMIN_MAN_SUFFIX)' +fi + + +AC_SUBST([APP_MAN_SUFFIX]) +AC_SUBST([LIB_MAN_SUFFIX]) +AC_SUBST([FILE_MAN_SUFFIX]) +AC_SUBST([MISC_MAN_SUFFIX]) +AC_SUBST([DRIVER_MAN_SUFFIX]) +AC_SUBST([ADMIN_MAN_SUFFIX]) +AC_SUBST([APP_MAN_DIR]) +AC_SUBST([LIB_MAN_DIR]) +AC_SUBST([FILE_MAN_DIR]) +AC_SUBST([MISC_MAN_DIR]) +AC_SUBST([DRIVER_MAN_DIR]) +AC_SUBST([ADMIN_MAN_DIR]) +]) # XORG_MANPAGE_SECTIONS + +# XORG_CHECK_LINUXDOC +# ------------------- +# Minimum version: 1.0.0 +# +# Defines the variable MAKE_TEXT if the necessary tools and +# files are found. $(MAKE_TEXT) blah.sgml will then produce blah.txt. +# Whether or not the necessary tools and files are found can be checked +# with the AM_CONDITIONAL "BUILD_LINUXDOC" +AC_DEFUN([XORG_CHECK_LINUXDOC],[ +AC_CHECK_FILE( + [$prefix/share/X11/sgml/defs.ent], + [DEFS_ENT_PATH=$prefix/share/X11/sgml], + [DEFS_ENT_PATH=] +) + +AC_PATH_PROG(LINUXDOC, linuxdoc) +AC_PATH_PROG(PS2PDF, ps2pdf) + +AC_MSG_CHECKING([Whether to build documentation]) + +if test x$DEFS_ENT_PATH != x && test x$LINUXDOC != x ; then + BUILDDOC=yes +else + BUILDDOC=no +fi + +AM_CONDITIONAL(BUILD_LINUXDOC, [test x$BUILDDOC = xyes]) + +AC_MSG_RESULT([$BUILDDOC]) + +AC_MSG_CHECKING([Whether to build pdf documentation]) + +if test x$PS2PDF != x ; then + BUILDPDFDOC=yes +else + BUILDPDFDOC=no +fi + +AM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes]) + +AC_MSG_RESULT([$BUILDPDFDOC]) + +MAKE_TEXT="SGML_SEARCH_PATH=$DEFS_ENT_PATH GROFF_NO_SGR=y $LINUXDOC -B txt" +MAKE_PS="SGML_SEARCH_PATH=$DEFS_ENT_PATH $LINUXDOC -B latex --papersize=letter --output=ps" +MAKE_PDF="$PS2PDF" +MAKE_HTML="SGML_SEARCH_PATH=$DEFS_ENT_PATH $LINUXDOC -B html --split=0" + +AC_SUBST(MAKE_TEXT) +AC_SUBST(MAKE_PS) +AC_SUBST(MAKE_PDF) +AC_SUBST(MAKE_HTML) +]) # XORG_CHECK_LINUXDOC + +# XORG_CHECK_MALLOC_ZERO +# ---------------------- +# Minimum version: 1.0.0 +# +# Defines {MALLOC,XMALLOC,XTMALLOC}_ZERO_CFLAGS appropriately if +# malloc(0) returns NULL. Packages should add one of these cflags to +# their AM_CFLAGS (or other appropriate *_CFLAGS) to use them. +AC_DEFUN([XORG_CHECK_MALLOC_ZERO],[ +AC_ARG_ENABLE(malloc0returnsnull, + AC_HELP_STRING([--enable-malloc0returnsnull], + [malloc(0) returns NULL (default: auto)]), + [MALLOC_ZERO_RETURNS_NULL=$enableval], + [MALLOC_ZERO_RETURNS_NULL=auto]) + +AC_MSG_CHECKING([whether malloc(0) returns NULL]) +if test "x$MALLOC_ZERO_RETURNS_NULL" = xauto; then + AC_RUN_IFELSE([ +char *malloc(); +char *realloc(); +char *calloc(); +main() { + char *m0, *r0, *c0, *p; + m0 = malloc(0); + p = malloc(10); + r0 = realloc(p,0); + c0 = calloc(0); + exit(m0 == 0 || r0 == 0 || c0 == 0 ? 0 : 1); +}], + [MALLOC_ZERO_RETURNS_NULL=yes], + [MALLOC_ZERO_RETURNS_NULL=no]) +fi +AC_MSG_RESULT([$MALLOC_ZERO_RETURNS_NULL]) + +if test "x$MALLOC_ZERO_RETURNS_NULL" = xyes; then + MALLOC_ZERO_CFLAGS="-DMALLOC_0_RETURNS_NULL" + XMALLOC_ZERO_CFLAGS=$MALLOC_ZERO_CFLAGS + XTMALLOC_ZERO_CFLAGS="$MALLOC_ZERO_CFLAGS -DXTMALLOC_BC" +else + MALLOC_ZERO_CFLAGS="" + XMALLOC_ZERO_CFLAGS="" + XTMALLOC_ZERO_CFLAGS="" +fi + +AC_SUBST([MALLOC_ZERO_CFLAGS]) +AC_SUBST([XMALLOC_ZERO_CFLAGS]) +AC_SUBST([XTMALLOC_ZERO_CFLAGS]) +]) # XORG_CHECK_MALLOC_ZERO + +# XORG_WITH_LINT() +# ---------------- +# Minimum version: 1.1.0 +# +# Sets up flags for source checkers such as lint and sparse if --with-lint +# is specified. (Use --with-lint=sparse for sparse.) +# Sets $LINT to name of source checker passed with --with-lint (default: lint) +# Sets $LINT_FLAGS to flags to pass to source checker +# Sets LINT automake conditional if enabled (default: disabled) +# +AC_DEFUN([XORG_WITH_LINT],[ + +# Allow checking code with lint, sparse, etc. +AC_ARG_WITH(lint, [AC_HELP_STRING([--with-lint], + [Use a lint-style source code checker (default: disabled)])], + [use_lint=$withval], [use_lint=no]) +if test "x$use_lint" = "xyes" ; then + LINT="lint" +else + LINT="$use_lint" +fi +if test "x$LINT_FLAGS" = "x" -a "x$LINT" != "xno" ; then + case $LINT in + lint|*/lint) + case $host_os in + solaris*) + LINT_FLAGS="-u -b -h -erroff=E_INDISTING_FROM_TRUNC2" + ;; + esac + ;; + esac +fi + +AC_SUBST(LINT) +AC_SUBST(LINT_FLAGS) +AM_CONDITIONAL(LINT, [test x$LINT != xno]) + +]) # XORG_WITH_LINT + +# XORG_LINT_LIBRARY(LIBNAME) +# -------------------------- +# Minimum version: 1.1.0 +# +# Sets up flags for building lint libraries for checking programs that call +# functions in the library. +# Disabled by default, enable with --enable-lint-library +# Sets: +# @LINTLIB@ - name of lint library file to make +# MAKE_LINT_LIB - automake conditional +# + +AC_DEFUN([XORG_LINT_LIBRARY],[ +AC_REQUIRE([XORG_WITH_LINT]) +# Build lint "library" for more indepth checks of programs calling this library +AC_ARG_ENABLE(lint-library, [AC_HELP_STRING([--enable-lint-library], + [Create lint library (default: disabled)])], + [make_lint_lib=$enableval], [make_lint_lib=no]) +if test "x$make_lint_lib" != "xno" ; then + if test "x$LINT" = "xno" ; then + AC_MSG_ERROR([Cannot make lint library without --with-lint]) + fi + if test "x$make_lint_lib" = "xyes" ; then + LINTLIB=llib-l$1.ln + else + LINTLIB=$make_lint_lib + fi +fi +AC_SUBST(LINTLIB) +AM_CONDITIONAL(MAKE_LINT_LIB, [test x$make_lint_lib != xno]) + +]) # XORG_LINT_LIBRARY + +dnl Copyright 2005 Red Hat, Inc +dnl +dnl Permission to use, copy, modify, distribute, and sell this software and its +dnl documentation for any purpose is hereby granted without fee, provided that +dnl the above copyright notice appear in all copies and that both that +dnl copyright notice and this permission notice appear in supporting +dnl documentation. +dnl +dnl The above copyright notice and this permission notice shall be included +dnl in all copies or substantial portions of the Software. +dnl +dnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +dnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +dnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +dnl IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR +dnl OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +dnl ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +dnl OTHER DEALINGS IN THE SOFTWARE. +dnl +dnl Except as contained in this notice, the name of the copyright holders shall +dnl not be used in advertising or otherwise to promote the sale, use or +dnl other dealings in this Software without prior written authorization +dnl from the copyright holders. +dnl + +# XORG_RELEASE_VERSION +# -------------------- +# Adds --with/without-release-string and changes the PACKAGE and +# PACKAGE_TARNAME to use "$PACKAGE{_TARNAME}-$RELEASE_VERSION". If +# no option is given, PACKAGE and PACKAGE_TARNAME are unchanged. + +AC_DEFUN([XORG_RELEASE_VERSION],[ + AC_ARG_WITH(release-version, + AC_HELP_STRING([--with-release-version=STRING], + [Use release version string in package name]), + [RELEASE_VERSION="$withval"], + [RELEASE_VERSION=""]) + if test "x$RELEASE_VERSION" != "x"; then + PACKAGE="$PACKAGE-$RELEASE_VERSION" + PACKAGE_TARNAME="$PACKAGE_TARNAME-$RELEASE_VERSION" + AC_MSG_NOTICE([Building with package name set to $PACKAGE]) + fi +]) + +# Copyright (C) 2002, 2003, 2005 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_AUTOMAKE_VERSION(VERSION) +# ---------------------------- +# Automake X.Y traces this macro to ensure aclocal.m4 has been +# generated from the m4 files accompanying Automake X.Y. +AC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version="1.9"]) + +# AM_SET_CURRENT_AUTOMAKE_VERSION +# ------------------------------- +# Call AM_AUTOMAKE_VERSION so it can be traced. +# This function is AC_REQUIREd by AC_INIT_AUTOMAKE. +AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], + [AM_AUTOMAKE_VERSION([1.9.6])]) + +# AM_AUX_DIR_EXPAND -*- Autoconf -*- + +# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets +# $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to +# `$srcdir', `$srcdir/..', or `$srcdir/../..'. +# +# Of course, Automake must honor this variable whenever it calls a +# tool from the auxiliary directory. The problem is that $srcdir (and +# therefore $ac_aux_dir as well) can be either absolute or relative, +# depending on how configure is run. This is pretty annoying, since +# it makes $ac_aux_dir quite unusable in subdirectories: in the top +# source directory, any form will work fine, but in subdirectories a +# relative path needs to be adjusted first. +# +# $ac_aux_dir/missing +# fails when called from a subdirectory if $ac_aux_dir is relative +# $top_srcdir/$ac_aux_dir/missing +# fails if $ac_aux_dir is absolute, +# fails when called from a subdirectory in a VPATH build with +# a relative $ac_aux_dir +# +# The reason of the latter failure is that $top_srcdir and $ac_aux_dir +# are both prefixed by $srcdir. In an in-source build this is usually +# harmless because $srcdir is `.', but things will broke when you +# start a VPATH build or use an absolute $srcdir. +# +# So we could use something similar to $top_srcdir/$ac_aux_dir/missing, +# iff we strip the leading $srcdir from $ac_aux_dir. That would be: +# am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"` +# and then we would define $MISSING as +# MISSING="\${SHELL} $am_aux_dir/missing" +# This will work as long as MISSING is not called from configure, because +# unfortunately $(top_srcdir) has no meaning in configure. +# However there are other variables, like CC, which are often used in +# configure, and could therefore not use this "fixed" $ac_aux_dir. +# +# Another solution, used here, is to always expand $ac_aux_dir to an +# absolute PATH. The drawback is that using absolute paths prevent a +# configured tree to be moved without reconfiguration. + +AC_DEFUN([AM_AUX_DIR_EXPAND], +[dnl Rely on autoconf to set up CDPATH properly. +AC_PREREQ([2.50])dnl +# expand $ac_aux_dir to an absolute path +am_aux_dir=`cd $ac_aux_dir && pwd` +]) + +# AM_CONDITIONAL -*- Autoconf -*- + +# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005 +# Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 7 + +# AM_CONDITIONAL(NAME, SHELL-CONDITION) +# ------------------------------------- +# Define a conditional. +AC_DEFUN([AM_CONDITIONAL], +[AC_PREREQ(2.52)dnl + ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], + [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl +AC_SUBST([$1_TRUE]) +AC_SUBST([$1_FALSE]) +if $2; then + $1_TRUE= + $1_FALSE='#' +else + $1_TRUE='#' + $1_FALSE= +fi +AC_CONFIG_COMMANDS_PRE( +[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then + AC_MSG_ERROR([[conditional "$1" was never defined. +Usually this means the macro was only invoked conditionally.]]) +fi])]) + + +# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005 +# Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 8 + +# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be +# written in clear, in which case automake, when reading aclocal.m4, +# will think it sees a *use*, and therefore will trigger all it's +# C support machinery. Also note that it means that autoscan, seeing +# CC etc. in the Makefile, will ask for an AC_PROG_CC use... + + +# _AM_DEPENDENCIES(NAME) +# ---------------------- +# See how the compiler implements dependency checking. +# NAME is "CC", "CXX", "GCJ", or "OBJC". +# We try a few techniques and use that to set a single cache variable. +# +# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was +# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular +# dependency, and given that the user is not expected to run this macro, +# just rely on AC_PROG_CC. +AC_DEFUN([_AM_DEPENDENCIES], +[AC_REQUIRE([AM_SET_DEPDIR])dnl +AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl +AC_REQUIRE([AM_MAKE_INCLUDE])dnl +AC_REQUIRE([AM_DEP_TRACK])dnl + +ifelse([$1], CC, [depcc="$CC" am_compiler_list=], + [$1], CXX, [depcc="$CXX" am_compiler_list=], + [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'], + [$1], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'], + [depcc="$$1" am_compiler_list=]) + +AC_CACHE_CHECK([dependency style of $depcc], + [am_cv_$1_dependencies_compiler_type], +[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then + # We make a subdir and do the tests there. Otherwise we can end up + # making bogus files that we don't know about and never remove. For + # instance it was reported that on HP-UX the gcc test will end up + # making a dummy file named `D' -- because `-MD' means `put the output + # in D'. + mkdir conftest.dir + # Copy depcomp to subdir because otherwise we won't find it if we're + # using a relative directory. + cp "$am_depcomp" conftest.dir + cd conftest.dir + # We will build objects and dependencies in a subdirectory because + # it helps to detect inapplicable dependency modes. For instance + # both Tru64's cc and ICC support -MD to output dependencies as a + # side effect of compilation, but ICC will put the dependencies in + # the current directory while Tru64 will put them in the object + # directory. + mkdir sub + + am_cv_$1_dependencies_compiler_type=none + if test "$am_compiler_list" = ""; then + am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp` + fi + for depmode in $am_compiler_list; do + # Setup a source with many dependencies, because some compilers + # like to wrap large dependency lists on column 80 (with \), and + # we should not choose a depcomp mode which is confused by this. + # + # We need to recreate these files for each test, as the compiler may + # overwrite some of them when testing with obscure command lines. + # This happens at least with the AIX C compiler. + : > sub/conftest.c + for i in 1 2 3 4 5 6; do + echo '#include "conftst'$i'.h"' >> sub/conftest.c + # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with + # Solaris 8's {/usr,}/bin/sh. + touch sub/conftst$i.h + done + echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf + + case $depmode in + nosideeffect) + # after this tag, mechanisms are not by side-effect, so they'll + # only be used when explicitly requested + if test "x$enable_dependency_tracking" = xyes; then + continue + else + break + fi + ;; + none) break ;; + esac + # We check with `-c' and `-o' for the sake of the "dashmstdout" + # mode. It turns out that the SunPro C++ compiler does not properly + # handle `-M -o', and we need to detect this. + if depmode=$depmode \ + source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \ + depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ + $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \ + >/dev/null 2>conftest.err && + grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && + grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 && + ${MAKE-make} -s -f confmf > /dev/null 2>&1; then + # icc doesn't choke on unknown options, it will just issue warnings + # or remarks (even with -Werror). So we grep stderr for any message + # that says an option was ignored or not supported. + # When given -MP, icc 7.0 and 7.1 complain thusly: + # icc: Command line warning: ignoring option '-M'; no argument required + # The diagnosis changed in icc 8.0: + # icc: Command line remark: option '-MP' not supported + if (grep 'ignoring option' conftest.err || + grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else + am_cv_$1_dependencies_compiler_type=$depmode + break + fi + fi + done + + cd .. + rm -rf conftest.dir +else + am_cv_$1_dependencies_compiler_type=none +fi +]) +AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type]) +AM_CONDITIONAL([am__fastdep$1], [ + test "x$enable_dependency_tracking" != xno \ + && test "$am_cv_$1_dependencies_compiler_type" = gcc3]) +]) + + +# AM_SET_DEPDIR +# ------------- +# Choose a directory name for dependency files. +# This macro is AC_REQUIREd in _AM_DEPENDENCIES +AC_DEFUN([AM_SET_DEPDIR], +[AC_REQUIRE([AM_SET_LEADING_DOT])dnl +AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl +]) + + +# AM_DEP_TRACK +# ------------ +AC_DEFUN([AM_DEP_TRACK], +[AC_ARG_ENABLE(dependency-tracking, +[ --disable-dependency-tracking speeds up one-time build + --enable-dependency-tracking do not reject slow dependency extractors]) +if test "x$enable_dependency_tracking" != xno; then + am_depcomp="$ac_aux_dir/depcomp" + AMDEPBACKSLASH='\' +fi +AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) +AC_SUBST([AMDEPBACKSLASH]) +]) + +# Generate code to set up dependency tracking. -*- Autoconf -*- + +# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005 +# Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +#serial 3 + +# _AM_OUTPUT_DEPENDENCY_COMMANDS +# ------------------------------ +AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], +[for mf in $CONFIG_FILES; do + # Strip MF so we end up with the name of the file. + mf=`echo "$mf" | sed -e 's/:.*$//'` + # Check whether this is an Automake generated Makefile or not. + # We used to match only the files named `Makefile.in', but + # some people rename them; so instead we look at the file content. + # Grep'ing the first line is not enough: some people post-process + # each Makefile.in and add a new line on top of each file to say so. + # So let's grep whole file. + if grep '^#.*generated by automake' $mf > /dev/null 2>&1; then + dirpart=`AS_DIRNAME("$mf")` + else + continue + fi + # Extract the definition of DEPDIR, am__include, and am__quote + # from the Makefile without running `make'. + DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` + test -z "$DEPDIR" && continue + am__include=`sed -n 's/^am__include = //p' < "$mf"` + test -z "am__include" && continue + am__quote=`sed -n 's/^am__quote = //p' < "$mf"` + # When using ansi2knr, U may be empty or an underscore; expand it + U=`sed -n 's/^U = //p' < "$mf"` + # Find all dependency output files, they are included files with + # $(DEPDIR) in their names. We invoke sed twice because it is the + # simplest approach to changing $(DEPDIR) to its actual value in the + # expansion. + for file in `sed -n " + s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ + sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do + # Make sure the directory exists. + test -f "$dirpart/$file" && continue + fdir=`AS_DIRNAME(["$file"])` + AS_MKDIR_P([$dirpart/$fdir]) + # echo "creating $dirpart/$file" + echo '# dummy' > "$dirpart/$file" + done +done +])# _AM_OUTPUT_DEPENDENCY_COMMANDS + + +# AM_OUTPUT_DEPENDENCY_COMMANDS +# ----------------------------- +# This macro should only be invoked once -- use via AC_REQUIRE. +# +# This code is only required when automatic dependency tracking +# is enabled. FIXME. This creates each `.P' file that we will +# need in order to bootstrap the dependency handling code. +AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], +[AC_CONFIG_COMMANDS([depfiles], + [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS], + [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"]) +]) + +# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005 +# Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 8 + +# AM_CONFIG_HEADER is obsolete. It has been replaced by AC_CONFIG_HEADERS. +AU_DEFUN([AM_CONFIG_HEADER], [AC_CONFIG_HEADERS($@)]) + +# Do all the work for Automake. -*- Autoconf -*- + +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 +# Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 12 + +# This macro actually does too much. Some checks are only needed if +# your package does certain things. But this isn't really a big deal. + +# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) +# AM_INIT_AUTOMAKE([OPTIONS]) +# ----------------------------------------------- +# The call with PACKAGE and VERSION arguments is the old style +# call (pre autoconf-2.50), which is being phased out. PACKAGE +# and VERSION should now be passed to AC_INIT and removed from +# the call to AM_INIT_AUTOMAKE. +# We support both call styles for the transition. After +# the next Automake release, Autoconf can make the AC_INIT +# arguments mandatory, and then we can depend on a new Autoconf +# release and drop the old call support. +AC_DEFUN([AM_INIT_AUTOMAKE], +[AC_PREREQ([2.58])dnl +dnl Autoconf wants to disallow AM_ names. We explicitly allow +dnl the ones we care about. +m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl +AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl +AC_REQUIRE([AC_PROG_INSTALL])dnl +# test to see if srcdir already configured +if test "`cd $srcdir && pwd`" != "`pwd`" && + test -f $srcdir/config.status; then + AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) +fi + +# test whether we have cygpath +if test -z "$CYGPATH_W"; then + if (cygpath --version) >/dev/null 2>/dev/null; then + CYGPATH_W='cygpath -w' + else + CYGPATH_W=echo + fi +fi +AC_SUBST([CYGPATH_W]) + +# Define the identity of the package. +dnl Distinguish between old-style and new-style calls. +m4_ifval([$2], +[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl + AC_SUBST([PACKAGE], [$1])dnl + AC_SUBST([VERSION], [$2])], +[_AM_SET_OPTIONS([$1])dnl + AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl + AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl + +_AM_IF_OPTION([no-define],, +[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package]) + AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl + +# Some tools Automake needs. +AC_REQUIRE([AM_SANITY_CHECK])dnl +AC_REQUIRE([AC_ARG_PROGRAM])dnl +AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version}) +AM_MISSING_PROG(AUTOCONF, autoconf) +AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version}) +AM_MISSING_PROG(AUTOHEADER, autoheader) +AM_MISSING_PROG(MAKEINFO, makeinfo) +AM_PROG_INSTALL_SH +AM_PROG_INSTALL_STRIP +AC_REQUIRE([AM_PROG_MKDIR_P])dnl +# We need awk for the "check" target. The system "awk" is bad on +# some platforms. +AC_REQUIRE([AC_PROG_AWK])dnl +AC_REQUIRE([AC_PROG_MAKE_SET])dnl +AC_REQUIRE([AM_SET_LEADING_DOT])dnl +_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])], + [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], + [_AM_PROG_TAR([v7])])]) +_AM_IF_OPTION([no-dependencies],, +[AC_PROVIDE_IFELSE([AC_PROG_CC], + [_AM_DEPENDENCIES(CC)], + [define([AC_PROG_CC], + defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl +AC_PROVIDE_IFELSE([AC_PROG_CXX], + [_AM_DEPENDENCIES(CXX)], + [define([AC_PROG_CXX], + defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl +]) +]) + + +# When config.status generates a header, we must update the stamp-h file. +# This file resides in the same directory as the config header +# that is generated. The stamp files are numbered to have different names. + +# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the +# loop where config.status creates the headers, so we can generate +# our stamp files there. +AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], +[# Compute $1's index in $config_headers. +_am_stamp_count=1 +for _am_header in $config_headers :; do + case $_am_header in + $1 | $1:* ) + break ;; + * ) + _am_stamp_count=`expr $_am_stamp_count + 1` ;; + esac +done +echo "timestamp for $1" >`AS_DIRNAME([$1])`/stamp-h[]$_am_stamp_count]) + +# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_PROG_INSTALL_SH +# ------------------ +# Define $install_sh. +AC_DEFUN([AM_PROG_INSTALL_SH], +[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl +install_sh=${install_sh-"$am_aux_dir/install-sh"} +AC_SUBST(install_sh)]) + +# Copyright (C) 2003, 2005 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 2 + +# Check whether the underlying file-system supports filenames +# with a leading dot. For instance MS-DOS doesn't. +AC_DEFUN([AM_SET_LEADING_DOT], +[rm -rf .tst 2>/dev/null +mkdir .tst 2>/dev/null +if test -d .tst; then + am__leading_dot=. +else + am__leading_dot=_ +fi +rmdir .tst 2>/dev/null +AC_SUBST([am__leading_dot])]) + +# Add --enable-maintainer-mode option to configure. -*- Autoconf -*- +# From Jim Meyering + +# Copyright (C) 1996, 1998, 2000, 2001, 2002, 2003, 2004, 2005 +# Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 4 + +AC_DEFUN([AM_MAINTAINER_MODE], +[AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles]) + dnl maintainer-mode is disabled by default + AC_ARG_ENABLE(maintainer-mode, +[ --enable-maintainer-mode enable make rules and dependencies not useful + (and sometimes confusing) to the casual installer], + USE_MAINTAINER_MODE=$enableval, + USE_MAINTAINER_MODE=no) + AC_MSG_RESULT([$USE_MAINTAINER_MODE]) + AM_CONDITIONAL(MAINTAINER_MODE, [test $USE_MAINTAINER_MODE = yes]) + MAINT=$MAINTAINER_MODE_TRUE + AC_SUBST(MAINT)dnl +] +) + +AU_DEFUN([jm_MAINTAINER_MODE], [AM_MAINTAINER_MODE]) + +# Check to see how 'make' treats includes. -*- Autoconf -*- + +# Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 3 + +# AM_MAKE_INCLUDE() +# ----------------- +# Check to see how make treats includes. +AC_DEFUN([AM_MAKE_INCLUDE], +[am_make=${MAKE-make} +cat > confinc << 'END' +am__doit: + @echo done +.PHONY: am__doit +END +# If we don't find an include directive, just comment out the code. +AC_MSG_CHECKING([for style of include used by $am_make]) +am__include="#" +am__quote= +_am_result=none +# First try GNU make style include. +echo "include confinc" > confmf +# We grep out `Entering directory' and `Leaving directory' +# messages which can occur if `w' ends up in MAKEFLAGS. +# In particular we don't look at `^make:' because GNU make might +# be invoked under some other name (usually "gmake"), in which +# case it prints its new name instead of `make'. +if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then + am__include=include + am__quote= + _am_result=GNU +fi +# Now try BSD make style include. +if test "$am__include" = "#"; then + echo '.include "confinc"' > confmf + if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then + am__include=.include + am__quote="\"" + _am_result=BSD + fi +fi +AC_SUBST([am__include]) +AC_SUBST([am__quote]) +AC_MSG_RESULT([$_am_result]) +rm -f confinc confmf +]) + +# Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- + +# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2005 +# Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 4 + +# AM_MISSING_PROG(NAME, PROGRAM) +# ------------------------------ +AC_DEFUN([AM_MISSING_PROG], +[AC_REQUIRE([AM_MISSING_HAS_RUN]) +$1=${$1-"${am_missing_run}$2"} +AC_SUBST($1)]) + + +# AM_MISSING_HAS_RUN +# ------------------ +# Define MISSING if not defined so far and test if it supports --run. +# If it does, set am_missing_run to use it, otherwise, to nothing. +AC_DEFUN([AM_MISSING_HAS_RUN], +[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl +test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing" +# Use eval to expand $SHELL +if eval "$MISSING --run true"; then + am_missing_run="$MISSING --run " +else + am_missing_run= + AC_MSG_WARN([`missing' script is too old or missing]) +fi +]) + +# Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_PROG_MKDIR_P +# --------------- +# Check whether `mkdir -p' is supported, fallback to mkinstalldirs otherwise. +# +# Automake 1.8 used `mkdir -m 0755 -p --' to ensure that directories +# created by `make install' are always world readable, even if the +# installer happens to have an overly restrictive umask (e.g. 077). +# This was a mistake. There are at least two reasons why we must not +# use `-m 0755': +# - it causes special bits like SGID to be ignored, +# - it may be too restrictive (some setups expect 775 directories). +# +# Do not use -m 0755 and let people choose whatever they expect by +# setting umask. +# +# We cannot accept any implementation of `mkdir' that recognizes `-p'. +# Some implementations (such as Solaris 8's) are not thread-safe: if a +# parallel make tries to run `mkdir -p a/b' and `mkdir -p a/c' +# concurrently, both version can detect that a/ is missing, but only +# one can create it and the other will error out. Consequently we +# restrict ourselves to GNU make (using the --version option ensures +# this.) +AC_DEFUN([AM_PROG_MKDIR_P], +[if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then + # We used to keeping the `.' as first argument, in order to + # allow $(mkdir_p) to be used without argument. As in + # $(mkdir_p) $(somedir) + # where $(somedir) is conditionally defined. However this is wrong + # for two reasons: + # 1. if the package is installed by a user who cannot write `.' + # make install will fail, + # 2. the above comment should most certainly read + # $(mkdir_p) $(DESTDIR)$(somedir) + # so it does not work when $(somedir) is undefined and + # $(DESTDIR) is not. + # To support the latter case, we have to write + # test -z "$(somedir)" || $(mkdir_p) $(DESTDIR)$(somedir), + # so the `.' trick is pointless. + mkdir_p='mkdir -p --' +else + # On NextStep and OpenStep, the `mkdir' command does not + # recognize any option. It will interpret all options as + # directories to create, and then abort because `.' already + # exists. + for d in ./-p ./--version; + do + test -d $d && rmdir $d + done + # $(mkinstalldirs) is defined by Automake if mkinstalldirs exists. + if test -f "$ac_aux_dir/mkinstalldirs"; then + mkdir_p='$(mkinstalldirs)' + else + mkdir_p='$(install_sh) -d' + fi +fi +AC_SUBST([mkdir_p])]) + +# Helper functions for option handling. -*- Autoconf -*- + +# Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 3 + +# _AM_MANGLE_OPTION(NAME) +# ----------------------- +AC_DEFUN([_AM_MANGLE_OPTION], +[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) + +# _AM_SET_OPTION(NAME) +# ------------------------------ +# Set option NAME. Presently that only means defining a flag for this option. +AC_DEFUN([_AM_SET_OPTION], +[m4_define(_AM_MANGLE_OPTION([$1]), 1)]) + +# _AM_SET_OPTIONS(OPTIONS) +# ---------------------------------- +# OPTIONS is a space-separated list of Automake options. +AC_DEFUN([_AM_SET_OPTIONS], +[AC_FOREACH([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) + +# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET]) +# ------------------------------------------- +# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. +AC_DEFUN([_AM_IF_OPTION], +[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) + +# Check to make sure that the build environment is sane. -*- Autoconf -*- + +# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005 +# Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 4 + +# AM_SANITY_CHECK +# --------------- +AC_DEFUN([AM_SANITY_CHECK], +[AC_MSG_CHECKING([whether build environment is sane]) +# Just in case +sleep 1 +echo timestamp > conftest.file +# Do `set' in a subshell so we don't clobber the current shell's +# arguments. Must try -L first in case configure is actually a +# symlink; some systems play weird games with the mod time of symlinks +# (eg FreeBSD returns the mod time of the symlink's containing +# directory). +if ( + set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null` + if test "$[*]" = "X"; then + # -L didn't work. + set X `ls -t $srcdir/configure conftest.file` + fi + rm -f conftest.file + if test "$[*]" != "X $srcdir/configure conftest.file" \ + && test "$[*]" != "X conftest.file $srcdir/configure"; then + + # If neither matched, then we have a broken ls. This can happen + # if, for instance, CONFIG_SHELL is bash and it inherits a + # broken ls alias from the environment. This has actually + # happened. Such a system could not be considered "sane". + AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken +alias in your environment]) + fi + + test "$[2]" = conftest.file + ) +then + # Ok. + : +else + AC_MSG_ERROR([newly created file is older than distributed files! +Check your system clock]) +fi +AC_MSG_RESULT(yes)]) + +# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_PROG_INSTALL_STRIP +# --------------------- +# One issue with vendor `install' (even GNU) is that you can't +# specify the program used to strip binaries. This is especially +# annoying in cross-compiling environments, where the build's strip +# is unlikely to handle the host's binaries. +# Fortunately install-sh will honor a STRIPPROG variable, so we +# always use install-sh in `make install-strip', and initialize +# STRIPPROG with the value of the STRIP variable (set by the user). +AC_DEFUN([AM_PROG_INSTALL_STRIP], +[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl +# Installed binaries are usually stripped using `strip' when the user +# run `make install-strip'. However `strip' might not be the right +# tool to use in cross-compilation environments, therefore Automake +# will honor the `STRIP' environment variable to overrule this program. +dnl Don't test for $cross_compiling = yes, because it might be `maybe'. +if test "$cross_compiling" != no; then + AC_CHECK_TOOL([STRIP], [strip], :) +fi +INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s" +AC_SUBST([INSTALL_STRIP_PROGRAM])]) + +# Check how to create a tarball. -*- Autoconf -*- + +# Copyright (C) 2004, 2005 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 2 + +# _AM_PROG_TAR(FORMAT) +# -------------------- +# Check how to create a tarball in format FORMAT. +# FORMAT should be one of `v7', `ustar', or `pax'. +# +# Substitute a variable $(am__tar) that is a command +# writing to stdout a FORMAT-tarball containing the directory +# $tardir. +# tardir=directory && $(am__tar) > result.tar +# +# Substitute a variable $(am__untar) that extract such +# a tarball read from stdin. +# $(am__untar) < result.tar +AC_DEFUN([_AM_PROG_TAR], +[# Always define AMTAR for backward compatibility. +AM_MISSING_PROG([AMTAR], [tar]) +m4_if([$1], [v7], + [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'], + [m4_case([$1], [ustar],, [pax],, + [m4_fatal([Unknown tar format])]) +AC_MSG_CHECKING([how to create a $1 tar archive]) +# Loop over all known methods to create a tar archive until one works. +_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none' +_am_tools=${am_cv_prog_tar_$1-$_am_tools} +# Do not fold the above two line into one, because Tru64 sh and +# Solaris sh will not grok spaces in the rhs of `-'. +for _am_tool in $_am_tools +do + case $_am_tool in + gnutar) + for _am_tar in tar gnutar gtar; + do + AM_RUN_LOG([$_am_tar --version]) && break + done + am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"' + am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"' + am__untar="$_am_tar -xf -" + ;; + plaintar) + # Must skip GNU tar: if it does not support --format= it doesn't create + # ustar tarball either. + (tar --version) >/dev/null 2>&1 && continue + am__tar='tar chf - "$$tardir"' + am__tar_='tar chf - "$tardir"' + am__untar='tar xf -' + ;; + pax) + am__tar='pax -L -x $1 -w "$$tardir"' + am__tar_='pax -L -x $1 -w "$tardir"' + am__untar='pax -r' + ;; + cpio) + am__tar='find "$$tardir" -print | cpio -o -H $1 -L' + am__tar_='find "$tardir" -print | cpio -o -H $1 -L' + am__untar='cpio -i -H $1 -d' + ;; + none) + am__tar=false + am__tar_=false + am__untar=false + ;; + esac + + # If the value was cached, stop now. We just wanted to have am__tar + # and am__untar set. + test -n "${am_cv_prog_tar_$1}" && break + + # tar/untar a dummy directory, and stop if the command works + rm -rf conftest.dir + mkdir conftest.dir + echo GrepMe > conftest.dir/file + AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar]) + rm -rf conftest.dir + if test -s conftest.tar; then + AM_RUN_LOG([$am__untar /dev/null 2>&1 && break + fi +done +rm -rf conftest.dir + +AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool]) +AC_MSG_RESULT([$am_cv_prog_tar_$1])]) +AC_SUBST([am__tar]) +AC_SUBST([am__untar]) +]) # _AM_PROG_TAR + diff --git a/app/fonttosfnt/compile b/app/fonttosfnt/compile new file mode 100644 index 000000000..1b1d23216 --- /dev/null +++ b/app/fonttosfnt/compile @@ -0,0 +1,142 @@ +#! /bin/sh +# Wrapper for compilers which do not understand `-c -o'. + +scriptversion=2005-05-14.22 + +# Copyright (C) 1999, 2000, 2003, 2004, 2005 Free Software Foundation, Inc. +# Written by Tom Tromey . +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +# This file is maintained in Automake, please report +# bugs to or send patches to +# . + +case $1 in + '') + echo "$0: No command. Try \`$0 --help' for more information." 1>&2 + exit 1; + ;; + -h | --h*) + cat <<\EOF +Usage: compile [--help] [--version] PROGRAM [ARGS] + +Wrapper for compilers which do not understand `-c -o'. +Remove `-o dest.o' from ARGS, run PROGRAM with the remaining +arguments, and rename the output as expected. + +If you are trying to build a whole package this is not the +right script to run: please start by reading the file `INSTALL'. + +Report bugs to . +EOF + exit $? + ;; + -v | --v*) + echo "compile $scriptversion" + exit $? + ;; +esac + +ofile= +cfile= +eat= + +for arg +do + if test -n "$eat"; then + eat= + else + case $1 in + -o) + # configure might choose to run compile as `compile cc -o foo foo.c'. + # So we strip `-o arg' only if arg is an object. + eat=1 + case $2 in + *.o | *.obj) + ofile=$2 + ;; + *) + set x "$@" -o "$2" + shift + ;; + esac + ;; + *.c) + cfile=$1 + set x "$@" "$1" + shift + ;; + *) + set x "$@" "$1" + shift + ;; + esac + fi + shift +done + +if test -z "$ofile" || test -z "$cfile"; then + # If no `-o' option was seen then we might have been invoked from a + # pattern rule where we don't need one. That is ok -- this is a + # normal compilation that the losing compiler can handle. If no + # `.c' file was seen then we are probably linking. That is also + # ok. + exec "$@" +fi + +# Name of file we expect compiler to create. +cofile=`echo "$cfile" | sed -e 's|^.*/||' -e 's/\.c$/.o/'` + +# Create the lock directory. +# Note: use `[/.-]' here to ensure that we don't use the same name +# that we are using for the .o file. Also, base the name on the expected +# object file name, since that is what matters with a parallel build. +lockdir=`echo "$cofile" | sed -e 's|[/.-]|_|g'`.d +while true; do + if mkdir "$lockdir" >/dev/null 2>&1; then + break + fi + sleep 1 +done +# FIXME: race condition here if user kills between mkdir and trap. +trap "rmdir '$lockdir'; exit 1" 1 2 15 + +# Run the compile. +"$@" +ret=$? + +if test -f "$cofile"; then + mv "$cofile" "$ofile" +elif test -f "${cofile}bj"; then + mv "${cofile}bj" "$ofile" +fi + +rmdir "$lockdir" +exit $ret + +# Local Variables: +# mode: shell-script +# sh-indentation: 2 +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-end: "$" +# End: diff --git a/app/fonttosfnt/config.guess b/app/fonttosfnt/config.guess new file mode 100644 index 000000000..917bbc50f --- /dev/null +++ b/app/fonttosfnt/config.guess @@ -0,0 +1,1463 @@ +#! /bin/sh +# Attempt to guess a canonical system name. +# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, +# 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. + +timestamp='2005-07-08' + +# This file is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA +# 02110-1301, USA. +# +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + + +# Originally written by Per Bothner . +# Please send patches to . Submit a context +# diff and a properly formatted ChangeLog entry. +# +# This script attempts to guess a canonical system name similar to +# config.sub. If it succeeds, it prints the system name on stdout, and +# exits with 0. Otherwise, it exits with 1. +# +# The plan is that this can be called by configure scripts if you +# don't specify an explicit build system type. + +me=`echo "$0" | sed -e 's,.*/,,'` + +usage="\ +Usage: $0 [OPTION] + +Output the configuration name of the system \`$me' is run on. + +Operation modes: + -h, --help print this help, then exit + -t, --time-stamp print date of last modification, then exit + -v, --version print version number, then exit + +Report bugs and patches to ." + +version="\ +GNU config.guess ($timestamp) + +Originally written by Per Bothner. +Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 +Free Software Foundation, Inc. + +This is free software; see the source for copying conditions. There is NO +warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." + +help=" +Try \`$me --help' for more information." + +# Parse command line +while test $# -gt 0 ; do + case $1 in + --time-stamp | --time* | -t ) + echo "$timestamp" ; exit ;; + --version | -v ) + echo "$version" ; exit ;; + --help | --h* | -h ) + echo "$usage"; exit ;; + -- ) # Stop option processing + shift; break ;; + - ) # Use stdin as input. + break ;; + -* ) + echo "$me: invalid option $1$help" >&2 + exit 1 ;; + * ) + break ;; + esac +done + +if test $# != 0; then + echo "$me: too many arguments$help" >&2 + exit 1 +fi + +trap 'exit 1' 1 2 15 + +# CC_FOR_BUILD -- compiler used by this script. Note that the use of a +# compiler to aid in system detection is discouraged as it requires +# temporary files to be created and, as you can see below, it is a +# headache to deal with in a portable fashion. + +# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still +# use `HOST_CC' if defined, but it is deprecated. + +# Portable tmp directory creation inspired by the Autoconf team. + +set_cc_for_build=' +trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ; +trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ; +: ${TMPDIR=/tmp} ; + { tmp=`(umask 077 && mktemp -d -q "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || + { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } || + { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } || + { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ; +dummy=$tmp/dummy ; +tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ; +case $CC_FOR_BUILD,$HOST_CC,$CC in + ,,) echo "int x;" > $dummy.c ; + for c in cc gcc c89 c99 ; do + if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then + CC_FOR_BUILD="$c"; break ; + fi ; + done ; + if test x"$CC_FOR_BUILD" = x ; then + CC_FOR_BUILD=no_compiler_found ; + fi + ;; + ,,*) CC_FOR_BUILD=$CC ;; + ,*,*) CC_FOR_BUILD=$HOST_CC ;; +esac ; set_cc_for_build= ;' + +# This is needed to find uname on a Pyramid OSx when run in the BSD universe. +# (ghazi@noc.rutgers.edu 1994-08-24) +if (test -f /.attbin/uname) >/dev/null 2>&1 ; then + PATH=$PATH:/.attbin ; export PATH +fi + +UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown +UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown +UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown +UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown + +# Note: order is significant - the case branches are not exclusive. + +case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in + *:NetBSD:*:*) + # NetBSD (nbsd) targets should (where applicable) match one or + # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*, + # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently + # switched to ELF, *-*-netbsd* would select the old + # object file format. This provides both forward + # compatibility and a consistent mechanism for selecting the + # object file format. + # + # Note: NetBSD doesn't particularly care about the vendor + # portion of the name. We always set it to "unknown". + sysctl="sysctl -n hw.machine_arch" + UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \ + /usr/sbin/$sysctl 2>/dev/null || echo unknown)` + case "${UNAME_MACHINE_ARCH}" in + armeb) machine=armeb-unknown ;; + arm*) machine=arm-unknown ;; + sh3el) machine=shl-unknown ;; + sh3eb) machine=sh-unknown ;; + *) machine=${UNAME_MACHINE_ARCH}-unknown ;; + esac + # The Operating System including object format, if it has switched + # to ELF recently, or will in the future. + case "${UNAME_MACHINE_ARCH}" in + arm*|i386|m68k|ns32k|sh3*|sparc|vax) + eval $set_cc_for_build + if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ + | grep __ELF__ >/dev/null + then + # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). + # Return netbsd for either. FIX? + os=netbsd + else + os=netbsdelf + fi + ;; + *) + os=netbsd + ;; + esac + # The OS release + # Debian GNU/NetBSD machines have a different userland, and + # thus, need a distinct triplet. However, they do not need + # kernel version information, so it can be replaced with a + # suitable tag, in the style of linux-gnu. + case "${UNAME_VERSION}" in + Debian*) + release='-gnu' + ;; + *) + release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` + ;; + esac + # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: + # contains redundant information, the shorter form: + # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. + echo "${machine}-${os}${release}" + exit ;; + *:OpenBSD:*:*) + UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` + echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE} + exit ;; + *:ekkoBSD:*:*) + echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE} + exit ;; + macppc:MirBSD:*:*) + echo powerppc-unknown-mirbsd${UNAME_RELEASE} + exit ;; + *:MirBSD:*:*) + echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE} + exit ;; + alpha:OSF1:*:*) + case $UNAME_RELEASE in + *4.0) + UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` + ;; + *5.*) + UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` + ;; + esac + # According to Compaq, /usr/sbin/psrinfo has been available on + # OSF/1 and Tru64 systems produced since 1995. I hope that + # covers most systems running today. This code pipes the CPU + # types through head -n 1, so we only detect the type of CPU 0. + ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` + case "$ALPHA_CPU_TYPE" in + "EV4 (21064)") + UNAME_MACHINE="alpha" ;; + "EV4.5 (21064)") + UNAME_MACHINE="alpha" ;; + "LCA4 (21066/21068)") + UNAME_MACHINE="alpha" ;; + "EV5 (21164)") + UNAME_MACHINE="alphaev5" ;; + "EV5.6 (21164A)") + UNAME_MACHINE="alphaev56" ;; + "EV5.6 (21164PC)") + UNAME_MACHINE="alphapca56" ;; + "EV5.7 (21164PC)") + UNAME_MACHINE="alphapca57" ;; + "EV6 (21264)") + UNAME_MACHINE="alphaev6" ;; + "EV6.7 (21264A)") + UNAME_MACHINE="alphaev67" ;; + "EV6.8CB (21264C)") + UNAME_MACHINE="alphaev68" ;; + "EV6.8AL (21264B)") + UNAME_MACHINE="alphaev68" ;; + "EV6.8CX (21264D)") + UNAME_MACHINE="alphaev68" ;; + "EV6.9A (21264/EV69A)") + UNAME_MACHINE="alphaev69" ;; + "EV7 (21364)") + UNAME_MACHINE="alphaev7" ;; + "EV7.9 (21364A)") + UNAME_MACHINE="alphaev79" ;; + esac + # A Pn.n version is a patched version. + # A Vn.n version is a released version. + # A Tn.n version is a released field test version. + # A Xn.n version is an unreleased experimental baselevel. + # 1.2 uses "1.2" for uname -r. + echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + exit ;; + Alpha\ *:Windows_NT*:*) + # How do we know it's Interix rather than the generic POSIX subsystem? + # Should we change UNAME_MACHINE based on the output of uname instead + # of the specific Alpha model? + echo alpha-pc-interix + exit ;; + 21064:Windows_NT:50:3) + echo alpha-dec-winnt3.5 + exit ;; + Amiga*:UNIX_System_V:4.0:*) + echo m68k-unknown-sysv4 + exit ;; + *:[Aa]miga[Oo][Ss]:*:*) + echo ${UNAME_MACHINE}-unknown-amigaos + exit ;; + *:[Mm]orph[Oo][Ss]:*:*) + echo ${UNAME_MACHINE}-unknown-morphos + exit ;; + *:OS/390:*:*) + echo i370-ibm-openedition + exit ;; + *:z/VM:*:*) + echo s390-ibm-zvmoe + exit ;; + *:OS400:*:*) + echo powerpc-ibm-os400 + exit ;; + arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) + echo arm-acorn-riscix${UNAME_RELEASE} + exit ;; + arm:riscos:*:*|arm:RISCOS:*:*) + echo arm-unknown-riscos + exit ;; + SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) + echo hppa1.1-hitachi-hiuxmpp + exit ;; + Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) + # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. + if test "`(/bin/universe) 2>/dev/null`" = att ; then + echo pyramid-pyramid-sysv3 + else + echo pyramid-pyramid-bsd + fi + exit ;; + NILE*:*:*:dcosx) + echo pyramid-pyramid-svr4 + exit ;; + DRS?6000:unix:4.0:6*) + echo sparc-icl-nx6 + exit ;; + DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*) + case `/usr/bin/uname -p` in + sparc) echo sparc-icl-nx7; exit ;; + esac ;; + sun4H:SunOS:5.*:*) + echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; + sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) + echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; + i86pc:SunOS:5.*:*) + echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; + sun4*:SunOS:6*:*) + # According to config.sub, this is the proper way to canonicalize + # SunOS6. Hard to guess exactly what SunOS6 will be like, but + # it's likely to be more like Solaris than SunOS4. + echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; + sun4*:SunOS:*:*) + case "`/usr/bin/arch -k`" in + Series*|S4*) + UNAME_RELEASE=`uname -v` + ;; + esac + # Japanese Language versions have a version number like `4.1.3-JL'. + echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'` + exit ;; + sun3*:SunOS:*:*) + echo m68k-sun-sunos${UNAME_RELEASE} + exit ;; + sun*:*:4.2BSD:*) + UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` + test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3 + case "`/bin/arch`" in + sun3) + echo m68k-sun-sunos${UNAME_RELEASE} + ;; + sun4) + echo sparc-sun-sunos${UNAME_RELEASE} + ;; + esac + exit ;; + aushp:SunOS:*:*) + echo sparc-auspex-sunos${UNAME_RELEASE} + exit ;; + # The situation for MiNT is a little confusing. The machine name + # can be virtually everything (everything which is not + # "atarist" or "atariste" at least should have a processor + # > m68000). The system name ranges from "MiNT" over "FreeMiNT" + # to the lowercase version "mint" (or "freemint"). Finally + # the system name "TOS" denotes a system which is actually not + # MiNT. But MiNT is downward compatible to TOS, so this should + # be no problem. + atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) + echo m68k-atari-mint${UNAME_RELEASE} + exit ;; + atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) + echo m68k-atari-mint${UNAME_RELEASE} + exit ;; + *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) + echo m68k-atari-mint${UNAME_RELEASE} + exit ;; + milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) + echo m68k-milan-mint${UNAME_RELEASE} + exit ;; + hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) + echo m68k-hades-mint${UNAME_RELEASE} + exit ;; + *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) + echo m68k-unknown-mint${UNAME_RELEASE} + exit ;; + m68k:machten:*:*) + echo m68k-apple-machten${UNAME_RELEASE} + exit ;; + powerpc:machten:*:*) + echo powerpc-apple-machten${UNAME_RELEASE} + exit ;; + RISC*:Mach:*:*) + echo mips-dec-mach_bsd4.3 + exit ;; + RISC*:ULTRIX:*:*) + echo mips-dec-ultrix${UNAME_RELEASE} + exit ;; + VAX*:ULTRIX*:*:*) + echo vax-dec-ultrix${UNAME_RELEASE} + exit ;; + 2020:CLIX:*:* | 2430:CLIX:*:*) + echo clipper-intergraph-clix${UNAME_RELEASE} + exit ;; + mips:*:*:UMIPS | mips:*:*:RISCos) + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c +#ifdef __cplusplus +#include /* for printf() prototype */ + int main (int argc, char *argv[]) { +#else + int main (argc, argv) int argc; char *argv[]; { +#endif + #if defined (host_mips) && defined (MIPSEB) + #if defined (SYSTYPE_SYSV) + printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0); + #endif + #if defined (SYSTYPE_SVR4) + printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0); + #endif + #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) + printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0); + #endif + #endif + exit (-1); + } +EOF + $CC_FOR_BUILD -o $dummy $dummy.c && + dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` && + SYSTEM_NAME=`$dummy $dummyarg` && + { echo "$SYSTEM_NAME"; exit; } + echo mips-mips-riscos${UNAME_RELEASE} + exit ;; + Motorola:PowerMAX_OS:*:*) + echo powerpc-motorola-powermax + exit ;; + Motorola:*:4.3:PL8-*) + echo powerpc-harris-powermax + exit ;; + Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) + echo powerpc-harris-powermax + exit ;; + Night_Hawk:Power_UNIX:*:*) + echo powerpc-harris-powerunix + exit ;; + m88k:CX/UX:7*:*) + echo m88k-harris-cxux7 + exit ;; + m88k:*:4*:R4*) + echo m88k-motorola-sysv4 + exit ;; + m88k:*:3*:R3*) + echo m88k-motorola-sysv3 + exit ;; + AViiON:dgux:*:*) + # DG/UX returns AViiON for all architectures + UNAME_PROCESSOR=`/usr/bin/uname -p` + if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ] + then + if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ + [ ${TARGET_BINARY_INTERFACE}x = x ] + then + echo m88k-dg-dgux${UNAME_RELEASE} + else + echo m88k-dg-dguxbcs${UNAME_RELEASE} + fi + else + echo i586-dg-dgux${UNAME_RELEASE} + fi + exit ;; + M88*:DolphinOS:*:*) # DolphinOS (SVR3) + echo m88k-dolphin-sysv3 + exit ;; + M88*:*:R3*:*) + # Delta 88k system running SVR3 + echo m88k-motorola-sysv3 + exit ;; + XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) + echo m88k-tektronix-sysv3 + exit ;; + Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) + echo m68k-tektronix-bsd + exit ;; + *:IRIX*:*:*) + echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` + exit ;; + ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. + echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id + exit ;; # Note that: echo "'`uname -s`'" gives 'AIX ' + i*86:AIX:*:*) + echo i386-ibm-aix + exit ;; + ia64:AIX:*:*) + if [ -x /usr/bin/oslevel ] ; then + IBM_REV=`/usr/bin/oslevel` + else + IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} + fi + echo ${UNAME_MACHINE}-ibm-aix${IBM_REV} + exit ;; + *:AIX:2:3) + if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #include + + main() + { + if (!__power_pc()) + exit(1); + puts("powerpc-ibm-aix3.2.5"); + exit(0); + } +EOF + if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` + then + echo "$SYSTEM_NAME" + else + echo rs6000-ibm-aix3.2.5 + fi + elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then + echo rs6000-ibm-aix3.2.4 + else + echo rs6000-ibm-aix3.2 + fi + exit ;; + *:AIX:*:[45]) + IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` + if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then + IBM_ARCH=rs6000 + else + IBM_ARCH=powerpc + fi + if [ -x /usr/bin/oslevel ] ; then + IBM_REV=`/usr/bin/oslevel` + else + IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} + fi + echo ${IBM_ARCH}-ibm-aix${IBM_REV} + exit ;; + *:AIX:*:*) + echo rs6000-ibm-aix + exit ;; + ibmrt:4.4BSD:*|romp-ibm:BSD:*) + echo romp-ibm-bsd4.4 + exit ;; + ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and + echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to + exit ;; # report: romp-ibm BSD 4.3 + *:BOSX:*:*) + echo rs6000-bull-bosx + exit ;; + DPX/2?00:B.O.S.:*:*) + echo m68k-bull-sysv3 + exit ;; + 9000/[34]??:4.3bsd:1.*:*) + echo m68k-hp-bsd + exit ;; + hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) + echo m68k-hp-bsd4.4 + exit ;; + 9000/[34678]??:HP-UX:*:*) + HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` + case "${UNAME_MACHINE}" in + 9000/31? ) HP_ARCH=m68000 ;; + 9000/[34]?? ) HP_ARCH=m68k ;; + 9000/[678][0-9][0-9]) + if [ -x /usr/bin/getconf ]; then + sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` + sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` + case "${sc_cpu_version}" in + 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 + 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 + 532) # CPU_PA_RISC2_0 + case "${sc_kernel_bits}" in + 32) HP_ARCH="hppa2.0n" ;; + 64) HP_ARCH="hppa2.0w" ;; + '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20 + esac ;; + esac + fi + if [ "${HP_ARCH}" = "" ]; then + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + + #define _HPUX_SOURCE + #include + #include + + int main () + { + #if defined(_SC_KERNEL_BITS) + long bits = sysconf(_SC_KERNEL_BITS); + #endif + long cpu = sysconf (_SC_CPU_VERSION); + + switch (cpu) + { + case CPU_PA_RISC1_0: puts ("hppa1.0"); break; + case CPU_PA_RISC1_1: puts ("hppa1.1"); break; + case CPU_PA_RISC2_0: + #if defined(_SC_KERNEL_BITS) + switch (bits) + { + case 64: puts ("hppa2.0w"); break; + case 32: puts ("hppa2.0n"); break; + default: puts ("hppa2.0"); break; + } break; + #else /* !defined(_SC_KERNEL_BITS) */ + puts ("hppa2.0"); break; + #endif + default: puts ("hppa1.0"); break; + } + exit (0); + } +EOF + (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` + test -z "$HP_ARCH" && HP_ARCH=hppa + fi ;; + esac + if [ ${HP_ARCH} = "hppa2.0w" ] + then + eval $set_cc_for_build + + # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating + # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler + # generating 64-bit code. GNU and HP use different nomenclature: + # + # $ CC_FOR_BUILD=cc ./config.guess + # => hppa2.0w-hp-hpux11.23 + # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess + # => hppa64-hp-hpux11.23 + + if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | + grep __LP64__ >/dev/null + then + HP_ARCH="hppa2.0w" + else + HP_ARCH="hppa64" + fi + fi + echo ${HP_ARCH}-hp-hpux${HPUX_REV} + exit ;; + ia64:HP-UX:*:*) + HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` + echo ia64-hp-hpux${HPUX_REV} + exit ;; + 3050*:HI-UX:*:*) + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #include + int + main () + { + long cpu = sysconf (_SC_CPU_VERSION); + /* The order matters, because CPU_IS_HP_MC68K erroneously returns + true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct + results, however. */ + if (CPU_IS_PA_RISC (cpu)) + { + switch (cpu) + { + case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; + case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; + case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; + default: puts ("hppa-hitachi-hiuxwe2"); break; + } + } + else if (CPU_IS_HP_MC68K (cpu)) + puts ("m68k-hitachi-hiuxwe2"); + else puts ("unknown-hitachi-hiuxwe2"); + exit (0); + } +EOF + $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` && + { echo "$SYSTEM_NAME"; exit; } + echo unknown-hitachi-hiuxwe2 + exit ;; + 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) + echo hppa1.1-hp-bsd + exit ;; + 9000/8??:4.3bsd:*:*) + echo hppa1.0-hp-bsd + exit ;; + *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) + echo hppa1.0-hp-mpeix + exit ;; + hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) + echo hppa1.1-hp-osf + exit ;; + hp8??:OSF1:*:*) + echo hppa1.0-hp-osf + exit ;; + i*86:OSF1:*:*) + if [ -x /usr/sbin/sysversion ] ; then + echo ${UNAME_MACHINE}-unknown-osf1mk + else + echo ${UNAME_MACHINE}-unknown-osf1 + fi + exit ;; + parisc*:Lites*:*:*) + echo hppa1.1-hp-lites + exit ;; + C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) + echo c1-convex-bsd + exit ;; + C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) + if getsysinfo -f scalar_acc + then echo c32-convex-bsd + else echo c2-convex-bsd + fi + exit ;; + C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) + echo c34-convex-bsd + exit ;; + C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) + echo c38-convex-bsd + exit ;; + C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) + echo c4-convex-bsd + exit ;; + CRAY*Y-MP:*:*:*) + echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit ;; + CRAY*[A-Z]90:*:*:*) + echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ + | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ + -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ + -e 's/\.[^.]*$/.X/' + exit ;; + CRAY*TS:*:*:*) + echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit ;; + CRAY*T3E:*:*:*) + echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit ;; + CRAY*SV1:*:*:*) + echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit ;; + *:UNICOS/mp:*:*) + echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit ;; + F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) + FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` + FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` + echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" + exit ;; + 5000:UNIX_System_V:4.*:*) + FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` + FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'` + echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" + exit ;; + i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) + echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} + exit ;; + sparc*:BSD/OS:*:*) + echo sparc-unknown-bsdi${UNAME_RELEASE} + exit ;; + *:BSD/OS:*:*) + echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} + exit ;; + *:FreeBSD:*:*) + echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` + exit ;; + i*:CYGWIN*:*) + echo ${UNAME_MACHINE}-pc-cygwin + exit ;; + i*:MINGW*:*) + echo ${UNAME_MACHINE}-pc-mingw32 + exit ;; + i*:windows32*:*) + # uname -m includes "-pc" on this system. + echo ${UNAME_MACHINE}-mingw32 + exit ;; + i*:PW*:*) + echo ${UNAME_MACHINE}-pc-pw32 + exit ;; + x86:Interix*:[34]*) + echo i586-pc-interix${UNAME_RELEASE}|sed -e 's/\..*//' + exit ;; + [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) + echo i${UNAME_MACHINE}-pc-mks + exit ;; + i*:Windows_NT*:* | Pentium*:Windows_NT*:*) + # How do we know it's Interix rather than the generic POSIX subsystem? + # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we + # UNAME_MACHINE based on the output of uname instead of i386? + echo i586-pc-interix + exit ;; + i*:UWIN*:*) + echo ${UNAME_MACHINE}-pc-uwin + exit ;; + amd64:CYGWIN*:*:*) + echo x86_64-unknown-cygwin + exit ;; + p*:CYGWIN*:*) + echo powerpcle-unknown-cygwin + exit ;; + prep*:SunOS:5.*:*) + echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; + *:GNU:*:*) + # the GNU system + echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` + exit ;; + *:GNU/*:*:*) + # other systems with GNU libc and userland + echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu + exit ;; + i*86:Minix:*:*) + echo ${UNAME_MACHINE}-pc-minix + exit ;; + arm*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + cris:Linux:*:*) + echo cris-axis-linux-gnu + exit ;; + crisv32:Linux:*:*) + echo crisv32-axis-linux-gnu + exit ;; + frv:Linux:*:*) + echo frv-unknown-linux-gnu + exit ;; + ia64:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + m32r*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + m68*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + mips:Linux:*:*) + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #undef CPU + #undef mips + #undef mipsel + #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) + CPU=mipsel + #else + #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) + CPU=mips + #else + CPU= + #endif + #endif +EOF + eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=` + test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } + ;; + mips64:Linux:*:*) + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #undef CPU + #undef mips64 + #undef mips64el + #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) + CPU=mips64el + #else + #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) + CPU=mips64 + #else + CPU= + #endif + #endif +EOF + eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=` + test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } + ;; + ppc:Linux:*:*) + echo powerpc-unknown-linux-gnu + exit ;; + ppc64:Linux:*:*) + echo powerpc64-unknown-linux-gnu + exit ;; + alpha:Linux:*:*) + case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in + EV5) UNAME_MACHINE=alphaev5 ;; + EV56) UNAME_MACHINE=alphaev56 ;; + PCA56) UNAME_MACHINE=alphapca56 ;; + PCA57) UNAME_MACHINE=alphapca56 ;; + EV6) UNAME_MACHINE=alphaev6 ;; + EV67) UNAME_MACHINE=alphaev67 ;; + EV68*) UNAME_MACHINE=alphaev68 ;; + esac + objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null + if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi + echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} + exit ;; + parisc:Linux:*:* | hppa:Linux:*:*) + # Look for CPU level + case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in + PA7*) echo hppa1.1-unknown-linux-gnu ;; + PA8*) echo hppa2.0-unknown-linux-gnu ;; + *) echo hppa-unknown-linux-gnu ;; + esac + exit ;; + parisc64:Linux:*:* | hppa64:Linux:*:*) + echo hppa64-unknown-linux-gnu + exit ;; + s390:Linux:*:* | s390x:Linux:*:*) + echo ${UNAME_MACHINE}-ibm-linux + exit ;; + sh64*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + sh*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + sparc:Linux:*:* | sparc64:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + x86_64:Linux:*:*) + echo x86_64-unknown-linux-gnu + exit ;; + i*86:Linux:*:*) + # The BFD linker knows what the default object file format is, so + # first see if it will tell us. cd to the root directory to prevent + # problems with other programs or directories called `ld' in the path. + # Set LC_ALL=C to ensure ld outputs messages in English. + ld_supported_targets=`cd /; LC_ALL=C ld --help 2>&1 \ + | sed -ne '/supported targets:/!d + s/[ ][ ]*/ /g + s/.*supported targets: *// + s/ .*// + p'` + case "$ld_supported_targets" in + elf32-i386) + TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu" + ;; + a.out-i386-linux) + echo "${UNAME_MACHINE}-pc-linux-gnuaout" + exit ;; + coff-i386) + echo "${UNAME_MACHINE}-pc-linux-gnucoff" + exit ;; + "") + # Either a pre-BFD a.out linker (linux-gnuoldld) or + # one that does not give us useful --help. + echo "${UNAME_MACHINE}-pc-linux-gnuoldld" + exit ;; + esac + # Determine whether the default compiler is a.out or elf + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #include + #ifdef __ELF__ + # ifdef __GLIBC__ + # if __GLIBC__ >= 2 + LIBC=gnu + # else + LIBC=gnulibc1 + # endif + # else + LIBC=gnulibc1 + # endif + #else + #ifdef __INTEL_COMPILER + LIBC=gnu + #else + LIBC=gnuaout + #endif + #endif + #ifdef __dietlibc__ + LIBC=dietlibc + #endif +EOF + eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=` + test x"${LIBC}" != x && { + echo "${UNAME_MACHINE}-pc-linux-${LIBC}" + exit + } + test x"${TENTATIVE}" != x && { echo "${TENTATIVE}"; exit; } + ;; + i*86:DYNIX/ptx:4*:*) + # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. + # earlier versions are messed up and put the nodename in both + # sysname and nodename. + echo i386-sequent-sysv4 + exit ;; + i*86:UNIX_SV:4.2MP:2.*) + # Unixware is an offshoot of SVR4, but it has its own version + # number series starting with 2... + # I am not positive that other SVR4 systems won't match this, + # I just have to hope. -- rms. + # Use sysv4.2uw... so that sysv4* matches it. + echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} + exit ;; + i*86:OS/2:*:*) + # If we were able to find `uname', then EMX Unix compatibility + # is probably installed. + echo ${UNAME_MACHINE}-pc-os2-emx + exit ;; + i*86:XTS-300:*:STOP) + echo ${UNAME_MACHINE}-unknown-stop + exit ;; + i*86:atheos:*:*) + echo ${UNAME_MACHINE}-unknown-atheos + exit ;; + i*86:syllable:*:*) + echo ${UNAME_MACHINE}-pc-syllable + exit ;; + i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*) + echo i386-unknown-lynxos${UNAME_RELEASE} + exit ;; + i*86:*DOS:*:*) + echo ${UNAME_MACHINE}-pc-msdosdjgpp + exit ;; + i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*) + UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` + if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then + echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL} + else + echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} + fi + exit ;; + i*86:*:5:[678]*) + # UnixWare 7.x, OpenUNIX and OpenServer 6. + case `/bin/uname -X | grep "^Machine"` in + *486*) UNAME_MACHINE=i486 ;; + *Pentium) UNAME_MACHINE=i586 ;; + *Pent*|*Celeron) UNAME_MACHINE=i686 ;; + esac + echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} + exit ;; + i*86:*:3.2:*) + if test -f /usr/options/cb.name; then + UNAME_REL=`sed -n 's/.*Version //p' /dev/null >/dev/null ; then + UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` + (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 + (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \ + && UNAME_MACHINE=i586 + (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \ + && UNAME_MACHINE=i686 + (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ + && UNAME_MACHINE=i686 + echo ${UNAME_MACHINE}-pc-sco$UNAME_REL + else + echo ${UNAME_MACHINE}-pc-sysv32 + fi + exit ;; + pc:*:*:*) + # Left here for compatibility: + # uname -m prints for DJGPP always 'pc', but it prints nothing about + # the processor, so we play safe by assuming i386. + echo i386-pc-msdosdjgpp + exit ;; + Intel:Mach:3*:*) + echo i386-pc-mach3 + exit ;; + paragon:*:*:*) + echo i860-intel-osf1 + exit ;; + i860:*:4.*:*) # i860-SVR4 + if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then + echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4 + else # Add other i860-SVR4 vendors below as they are discovered. + echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4 + fi + exit ;; + mini*:CTIX:SYS*5:*) + # "miniframe" + echo m68010-convergent-sysv + exit ;; + mc68k:UNIX:SYSTEM5:3.51m) + echo m68k-convergent-sysv + exit ;; + M680?0:D-NIX:5.3:*) + echo m68k-diab-dnix + exit ;; + M68*:*:R3V[5678]*:*) + test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;; + 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0) + OS_REL='' + test -r /etc/.relid \ + && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` + /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ + && { echo i486-ncr-sysv4.3${OS_REL}; exit; } + /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ + && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; + 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) + /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ + && { echo i486-ncr-sysv4; exit; } ;; + m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) + echo m68k-unknown-lynxos${UNAME_RELEASE} + exit ;; + mc68030:UNIX_System_V:4.*:*) + echo m68k-atari-sysv4 + exit ;; + TSUNAMI:LynxOS:2.*:*) + echo sparc-unknown-lynxos${UNAME_RELEASE} + exit ;; + rs6000:LynxOS:2.*:*) + echo rs6000-unknown-lynxos${UNAME_RELEASE} + exit ;; + PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*) + echo powerpc-unknown-lynxos${UNAME_RELEASE} + exit ;; + SM[BE]S:UNIX_SV:*:*) + echo mips-dde-sysv${UNAME_RELEASE} + exit ;; + RM*:ReliantUNIX-*:*:*) + echo mips-sni-sysv4 + exit ;; + RM*:SINIX-*:*:*) + echo mips-sni-sysv4 + exit ;; + *:SINIX-*:*:*) + if uname -p 2>/dev/null >/dev/null ; then + UNAME_MACHINE=`(uname -p) 2>/dev/null` + echo ${UNAME_MACHINE}-sni-sysv4 + else + echo ns32k-sni-sysv + fi + exit ;; + PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort + # says + echo i586-unisys-sysv4 + exit ;; + *:UNIX_System_V:4*:FTX*) + # From Gerald Hewes . + # How about differentiating between stratus architectures? -djm + echo hppa1.1-stratus-sysv4 + exit ;; + *:*:*:FTX*) + # From seanf@swdc.stratus.com. + echo i860-stratus-sysv4 + exit ;; + i*86:VOS:*:*) + # From Paul.Green@stratus.com. + echo ${UNAME_MACHINE}-stratus-vos + exit ;; + *:VOS:*:*) + # From Paul.Green@stratus.com. + echo hppa1.1-stratus-vos + exit ;; + mc68*:A/UX:*:*) + echo m68k-apple-aux${UNAME_RELEASE} + exit ;; + news*:NEWS-OS:6*:*) + echo mips-sony-newsos6 + exit ;; + R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) + if [ -d /usr/nec ]; then + echo mips-nec-sysv${UNAME_RELEASE} + else + echo mips-unknown-sysv${UNAME_RELEASE} + fi + exit ;; + BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. + echo powerpc-be-beos + exit ;; + BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. + echo powerpc-apple-beos + exit ;; + BePC:BeOS:*:*) # BeOS running on Intel PC compatible. + echo i586-pc-beos + exit ;; + SX-4:SUPER-UX:*:*) + echo sx4-nec-superux${UNAME_RELEASE} + exit ;; + SX-5:SUPER-UX:*:*) + echo sx5-nec-superux${UNAME_RELEASE} + exit ;; + SX-6:SUPER-UX:*:*) + echo sx6-nec-superux${UNAME_RELEASE} + exit ;; + Power*:Rhapsody:*:*) + echo powerpc-apple-rhapsody${UNAME_RELEASE} + exit ;; + *:Rhapsody:*:*) + echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} + exit ;; + *:Darwin:*:*) + UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown + case $UNAME_PROCESSOR in + *86) UNAME_PROCESSOR=i686 ;; + unknown) UNAME_PROCESSOR=powerpc ;; + esac + echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} + exit ;; + *:procnto*:*:* | *:QNX:[0123456789]*:*) + UNAME_PROCESSOR=`uname -p` + if test "$UNAME_PROCESSOR" = "x86"; then + UNAME_PROCESSOR=i386 + UNAME_MACHINE=pc + fi + echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE} + exit ;; + *:QNX:*:4*) + echo i386-pc-qnx + exit ;; + NSE-?:NONSTOP_KERNEL:*:*) + echo nse-tandem-nsk${UNAME_RELEASE} + exit ;; + NSR-?:NONSTOP_KERNEL:*:*) + echo nsr-tandem-nsk${UNAME_RELEASE} + exit ;; + *:NonStop-UX:*:*) + echo mips-compaq-nonstopux + exit ;; + BS2000:POSIX*:*:*) + echo bs2000-siemens-sysv + exit ;; + DS/*:UNIX_System_V:*:*) + echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} + exit ;; + *:Plan9:*:*) + # "uname -m" is not consistent, so use $cputype instead. 386 + # is converted to i386 for consistency with other x86 + # operating systems. + if test "$cputype" = "386"; then + UNAME_MACHINE=i386 + else + UNAME_MACHINE="$cputype" + fi + echo ${UNAME_MACHINE}-unknown-plan9 + exit ;; + *:TOPS-10:*:*) + echo pdp10-unknown-tops10 + exit ;; + *:TENEX:*:*) + echo pdp10-unknown-tenex + exit ;; + KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) + echo pdp10-dec-tops20 + exit ;; + XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) + echo pdp10-xkl-tops20 + exit ;; + *:TOPS-20:*:*) + echo pdp10-unknown-tops20 + exit ;; + *:ITS:*:*) + echo pdp10-unknown-its + exit ;; + SEI:*:*:SEIUX) + echo mips-sei-seiux${UNAME_RELEASE} + exit ;; + *:DragonFly:*:*) + echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` + exit ;; + *:*VMS:*:*) + UNAME_MACHINE=`(uname -p) 2>/dev/null` + case "${UNAME_MACHINE}" in + A*) echo alpha-dec-vms ; exit ;; + I*) echo ia64-dec-vms ; exit ;; + V*) echo vax-dec-vms ; exit ;; + esac ;; + *:XENIX:*:SysV) + echo i386-pc-xenix + exit ;; + i*86:skyos:*:*) + echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//' + exit ;; +esac + +#echo '(No uname command or uname output not recognized.)' 1>&2 +#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2 + +eval $set_cc_for_build +cat >$dummy.c < +# include +#endif +main () +{ +#if defined (sony) +#if defined (MIPSEB) + /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed, + I don't know.... */ + printf ("mips-sony-bsd\n"); exit (0); +#else +#include + printf ("m68k-sony-newsos%s\n", +#ifdef NEWSOS4 + "4" +#else + "" +#endif + ); exit (0); +#endif +#endif + +#if defined (__arm) && defined (__acorn) && defined (__unix) + printf ("arm-acorn-riscix\n"); exit (0); +#endif + +#if defined (hp300) && !defined (hpux) + printf ("m68k-hp-bsd\n"); exit (0); +#endif + +#if defined (NeXT) +#if !defined (__ARCHITECTURE__) +#define __ARCHITECTURE__ "m68k" +#endif + int version; + version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; + if (version < 4) + printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); + else + printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version); + exit (0); +#endif + +#if defined (MULTIMAX) || defined (n16) +#if defined (UMAXV) + printf ("ns32k-encore-sysv\n"); exit (0); +#else +#if defined (CMU) + printf ("ns32k-encore-mach\n"); exit (0); +#else + printf ("ns32k-encore-bsd\n"); exit (0); +#endif +#endif +#endif + +#if defined (__386BSD__) + printf ("i386-pc-bsd\n"); exit (0); +#endif + +#if defined (sequent) +#if defined (i386) + printf ("i386-sequent-dynix\n"); exit (0); +#endif +#if defined (ns32000) + printf ("ns32k-sequent-dynix\n"); exit (0); +#endif +#endif + +#if defined (_SEQUENT_) + struct utsname un; + + uname(&un); + + if (strncmp(un.version, "V2", 2) == 0) { + printf ("i386-sequent-ptx2\n"); exit (0); + } + if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */ + printf ("i386-sequent-ptx1\n"); exit (0); + } + printf ("i386-sequent-ptx\n"); exit (0); + +#endif + +#if defined (vax) +# if !defined (ultrix) +# include +# if defined (BSD) +# if BSD == 43 + printf ("vax-dec-bsd4.3\n"); exit (0); +# else +# if BSD == 199006 + printf ("vax-dec-bsd4.3reno\n"); exit (0); +# else + printf ("vax-dec-bsd\n"); exit (0); +# endif +# endif +# else + printf ("vax-dec-bsd\n"); exit (0); +# endif +# else + printf ("vax-dec-ultrix\n"); exit (0); +# endif +#endif + +#if defined (alliant) && defined (i860) + printf ("i860-alliant-bsd\n"); exit (0); +#endif + + exit (1); +} +EOF + +$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` && + { echo "$SYSTEM_NAME"; exit; } + +# Apollos put the system type in the environment. + +test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; } + +# Convex versions that predate uname can use getsysinfo(1) + +if [ -x /usr/convex/getsysinfo ] +then + case `getsysinfo -f cpu_type` in + c1*) + echo c1-convex-bsd + exit ;; + c2*) + if getsysinfo -f scalar_acc + then echo c32-convex-bsd + else echo c2-convex-bsd + fi + exit ;; + c34*) + echo c34-convex-bsd + exit ;; + c38*) + echo c38-convex-bsd + exit ;; + c4*) + echo c4-convex-bsd + exit ;; + esac +fi + +cat >&2 < in order to provide the needed +information to handle your system. + +config.guess timestamp = $timestamp + +uname -m = `(uname -m) 2>/dev/null || echo unknown` +uname -r = `(uname -r) 2>/dev/null || echo unknown` +uname -s = `(uname -s) 2>/dev/null || echo unknown` +uname -v = `(uname -v) 2>/dev/null || echo unknown` + +/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null` +/bin/uname -X = `(/bin/uname -X) 2>/dev/null` + +hostinfo = `(hostinfo) 2>/dev/null` +/bin/universe = `(/bin/universe) 2>/dev/null` +/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` +/bin/arch = `(/bin/arch) 2>/dev/null` +/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` +/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` + +UNAME_MACHINE = ${UNAME_MACHINE} +UNAME_RELEASE = ${UNAME_RELEASE} +UNAME_SYSTEM = ${UNAME_SYSTEM} +UNAME_VERSION = ${UNAME_VERSION} +EOF + +exit 1 + +# Local variables: +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "timestamp='" +# time-stamp-format: "%:y-%02m-%02d" +# time-stamp-end: "'" +# End: diff --git a/app/fonttosfnt/config.h.in b/app/fonttosfnt/config.h.in new file mode 100644 index 000000000..c364eda45 --- /dev/null +++ b/app/fonttosfnt/config.h.in @@ -0,0 +1,22 @@ +/* config.h.in. Generated from configure.ac by autoheader. */ + +/* Name of package */ +#undef PACKAGE + +/* Define to the address where bug reports for this package should be sent. */ +#undef PACKAGE_BUGREPORT + +/* Define to the full name of this package. */ +#undef PACKAGE_NAME + +/* Define to the full name and version of this package. */ +#undef PACKAGE_STRING + +/* Define to the one symbol short name of this package. */ +#undef PACKAGE_TARNAME + +/* Define to the version of this package. */ +#undef PACKAGE_VERSION + +/* Version number of package */ +#undef VERSION diff --git a/app/fonttosfnt/config.sub b/app/fonttosfnt/config.sub new file mode 100644 index 000000000..1c366dfde --- /dev/null +++ b/app/fonttosfnt/config.sub @@ -0,0 +1,1579 @@ +#! /bin/sh +# Configuration validation subroutine script. +# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, +# 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. + +timestamp='2005-07-08' + +# This file is (in principle) common to ALL GNU software. +# The presence of a machine in this file suggests that SOME GNU software +# can handle that machine. It does not imply ALL GNU software can. +# +# This file is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA +# 02110-1301, USA. +# +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + + +# Please send patches to . Submit a context +# diff and a properly formatted ChangeLog entry. +# +# Configuration subroutine to validate and canonicalize a configuration type. +# Supply the specified configuration type as an argument. +# If it is invalid, we print an error message on stderr and exit with code 1. +# Otherwise, we print the canonical config type on stdout and succeed. + +# This file is supposed to be the same for all GNU packages +# and recognize all the CPU types, system types and aliases +# that are meaningful with *any* GNU software. +# Each package is responsible for reporting which valid configurations +# it does not support. The user should be able to distinguish +# a failure to support a valid configuration from a meaningless +# configuration. + +# The goal of this file is to map all the various variations of a given +# machine specification into a single specification in the form: +# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM +# or in some cases, the newer four-part form: +# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM +# It is wrong to echo any other type of specification. + +me=`echo "$0" | sed -e 's,.*/,,'` + +usage="\ +Usage: $0 [OPTION] CPU-MFR-OPSYS + $0 [OPTION] ALIAS + +Canonicalize a configuration name. + +Operation modes: + -h, --help print this help, then exit + -t, --time-stamp print date of last modification, then exit + -v, --version print version number, then exit + +Report bugs and patches to ." + +version="\ +GNU config.sub ($timestamp) + +Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 +Free Software Foundation, Inc. + +This is free software; see the source for copying conditions. There is NO +warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." + +help=" +Try \`$me --help' for more information." + +# Parse command line +while test $# -gt 0 ; do + case $1 in + --time-stamp | --time* | -t ) + echo "$timestamp" ; exit ;; + --version | -v ) + echo "$version" ; exit ;; + --help | --h* | -h ) + echo "$usage"; exit ;; + -- ) # Stop option processing + shift; break ;; + - ) # Use stdin as input. + break ;; + -* ) + echo "$me: invalid option $1$help" + exit 1 ;; + + *local*) + # First pass through any local machine types. + echo $1 + exit ;; + + * ) + break ;; + esac +done + +case $# in + 0) echo "$me: missing argument$help" >&2 + exit 1;; + 1) ;; + *) echo "$me: too many arguments$help" >&2 + exit 1;; +esac + +# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). +# Here we must recognize all the valid KERNEL-OS combinations. +maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` +case $maybe_os in + nto-qnx* | linux-gnu* | linux-dietlibc | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | \ + kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | storm-chaos* | os2-emx* | rtmk-nova*) + os=-$maybe_os + basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` + ;; + *) + basic_machine=`echo $1 | sed 's/-[^-]*$//'` + if [ $basic_machine != $1 ] + then os=`echo $1 | sed 's/.*-/-/'` + else os=; fi + ;; +esac + +### Let's recognize common machines as not being operating systems so +### that things like config.sub decstation-3100 work. We also +### recognize some manufacturers as not being operating systems, so we +### can provide default operating systems below. +case $os in + -sun*os*) + # Prevent following clause from handling this invalid input. + ;; + -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \ + -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \ + -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \ + -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ + -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ + -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ + -apple | -axis | -knuth | -cray) + os= + basic_machine=$1 + ;; + -sim | -cisco | -oki | -wec | -winbond) + os= + basic_machine=$1 + ;; + -scout) + ;; + -wrs) + os=-vxworks + basic_machine=$1 + ;; + -chorusos*) + os=-chorusos + basic_machine=$1 + ;; + -chorusrdb) + os=-chorusrdb + basic_machine=$1 + ;; + -hiux*) + os=-hiuxwe2 + ;; + -sco5) + os=-sco3.2v5 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco4) + os=-sco3.2v4 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco3.2.[4-9]*) + os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco3.2v[4-9]*) + # Don't forget version if it is 3.2v4 or newer. + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco*) + os=-sco3.2v2 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -udk*) + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -isc) + os=-isc2.2 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -clix*) + basic_machine=clipper-intergraph + ;; + -isc*) + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -lynx*) + os=-lynxos + ;; + -ptx*) + basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'` + ;; + -windowsnt*) + os=`echo $os | sed -e 's/windowsnt/winnt/'` + ;; + -psos*) + os=-psos + ;; + -mint | -mint[0-9]*) + basic_machine=m68k-atari + os=-mint + ;; +esac + +# Decode aliases for certain CPU-COMPANY combinations. +case $basic_machine in + # Recognize the basic CPU types without company name. + # Some are omitted here because they have special meanings below. + 1750a | 580 \ + | a29k \ + | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ + | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ + | am33_2.0 \ + | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr \ + | bfin \ + | c4x | clipper \ + | d10v | d30v | dlx | dsp16xx \ + | fr30 | frv \ + | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ + | i370 | i860 | i960 | ia64 \ + | ip2k | iq2000 \ + | m32r | m32rle | m68000 | m68k | m88k | maxq | mcore \ + | mips | mipsbe | mipseb | mipsel | mipsle \ + | mips16 \ + | mips64 | mips64el \ + | mips64vr | mips64vrel \ + | mips64orion | mips64orionel \ + | mips64vr4100 | mips64vr4100el \ + | mips64vr4300 | mips64vr4300el \ + | mips64vr5000 | mips64vr5000el \ + | mips64vr5900 | mips64vr5900el \ + | mipsisa32 | mipsisa32el \ + | mipsisa32r2 | mipsisa32r2el \ + | mipsisa64 | mipsisa64el \ + | mipsisa64r2 | mipsisa64r2el \ + | mipsisa64sb1 | mipsisa64sb1el \ + | mipsisa64sr71k | mipsisa64sr71kel \ + | mipstx39 | mipstx39el \ + | mn10200 | mn10300 \ + | ms1 \ + | msp430 \ + | ns16k | ns32k \ + | or32 \ + | pdp10 | pdp11 | pj | pjl \ + | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \ + | pyramid \ + | sh | sh[1234] | sh[24]a | sh[23]e | sh[34]eb | shbe | shle | sh[1234]le | sh3ele \ + | sh64 | sh64le \ + | sparc | sparc64 | sparc64b | sparc86x | sparclet | sparclite \ + | sparcv8 | sparcv9 | sparcv9b \ + | strongarm \ + | tahoe | thumb | tic4x | tic80 | tron \ + | v850 | v850e \ + | we32k \ + | x86 | xscale | xscalee[bl] | xstormy16 | xtensa \ + | z8k) + basic_machine=$basic_machine-unknown + ;; + m32c) + basic_machine=$basic_machine-unknown + ;; + m6811 | m68hc11 | m6812 | m68hc12) + # Motorola 68HC11/12. + basic_machine=$basic_machine-unknown + os=-none + ;; + m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) + ;; + + # We use `pc' rather than `unknown' + # because (1) that's what they normally are, and + # (2) the word "unknown" tends to confuse beginning users. + i*86 | x86_64) + basic_machine=$basic_machine-pc + ;; + # Object if more than one company name word. + *-*-*) + echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 + exit 1 + ;; + # Recognize the basic CPU types with company name. + 580-* \ + | a29k-* \ + | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ + | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ + | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \ + | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ + | avr-* \ + | bfin-* | bs2000-* \ + | c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \ + | clipper-* | craynv-* | cydra-* \ + | d10v-* | d30v-* | dlx-* \ + | elxsi-* \ + | f30[01]-* | f700-* | fr30-* | frv-* | fx80-* \ + | h8300-* | h8500-* \ + | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ + | i*86-* | i860-* | i960-* | ia64-* \ + | ip2k-* | iq2000-* \ + | m32r-* | m32rle-* \ + | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ + | m88110-* | m88k-* | maxq-* | mcore-* \ + | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ + | mips16-* \ + | mips64-* | mips64el-* \ + | mips64vr-* | mips64vrel-* \ + | mips64orion-* | mips64orionel-* \ + | mips64vr4100-* | mips64vr4100el-* \ + | mips64vr4300-* | mips64vr4300el-* \ + | mips64vr5000-* | mips64vr5000el-* \ + | mips64vr5900-* | mips64vr5900el-* \ + | mipsisa32-* | mipsisa32el-* \ + | mipsisa32r2-* | mipsisa32r2el-* \ + | mipsisa64-* | mipsisa64el-* \ + | mipsisa64r2-* | mipsisa64r2el-* \ + | mipsisa64sb1-* | mipsisa64sb1el-* \ + | mipsisa64sr71k-* | mipsisa64sr71kel-* \ + | mipstx39-* | mipstx39el-* \ + | mmix-* \ + | ms1-* \ + | msp430-* \ + | none-* | np1-* | ns16k-* | ns32k-* \ + | orion-* \ + | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ + | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \ + | pyramid-* \ + | romp-* | rs6000-* \ + | sh-* | sh[1234]-* | sh[24]a-* | sh[23]e-* | sh[34]eb-* | shbe-* \ + | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ + | sparc-* | sparc64-* | sparc64b-* | sparc86x-* | sparclet-* \ + | sparclite-* \ + | sparcv8-* | sparcv9-* | sparcv9b-* | strongarm-* | sv1-* | sx?-* \ + | tahoe-* | thumb-* \ + | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ + | tron-* \ + | v850-* | v850e-* | vax-* \ + | we32k-* \ + | x86-* | x86_64-* | xps100-* | xscale-* | xscalee[bl]-* \ + | xstormy16-* | xtensa-* \ + | ymp-* \ + | z8k-*) + ;; + m32c-*) + ;; + # Recognize the various machine names and aliases which stand + # for a CPU type and a company and sometimes even an OS. + 386bsd) + basic_machine=i386-unknown + os=-bsd + ;; + 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) + basic_machine=m68000-att + ;; + 3b*) + basic_machine=we32k-att + ;; + a29khif) + basic_machine=a29k-amd + os=-udi + ;; + abacus) + basic_machine=abacus-unknown + ;; + adobe68k) + basic_machine=m68010-adobe + os=-scout + ;; + alliant | fx80) + basic_machine=fx80-alliant + ;; + altos | altos3068) + basic_machine=m68k-altos + ;; + am29k) + basic_machine=a29k-none + os=-bsd + ;; + amd64) + basic_machine=x86_64-pc + ;; + amd64-*) + basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + amdahl) + basic_machine=580-amdahl + os=-sysv + ;; + amiga | amiga-*) + basic_machine=m68k-unknown + ;; + amigaos | amigados) + basic_machine=m68k-unknown + os=-amigaos + ;; + amigaunix | amix) + basic_machine=m68k-unknown + os=-sysv4 + ;; + apollo68) + basic_machine=m68k-apollo + os=-sysv + ;; + apollo68bsd) + basic_machine=m68k-apollo + os=-bsd + ;; + aux) + basic_machine=m68k-apple + os=-aux + ;; + balance) + basic_machine=ns32k-sequent + os=-dynix + ;; + c90) + basic_machine=c90-cray + os=-unicos + ;; + convex-c1) + basic_machine=c1-convex + os=-bsd + ;; + convex-c2) + basic_machine=c2-convex + os=-bsd + ;; + convex-c32) + basic_machine=c32-convex + os=-bsd + ;; + convex-c34) + basic_machine=c34-convex + os=-bsd + ;; + convex-c38) + basic_machine=c38-convex + os=-bsd + ;; + cray | j90) + basic_machine=j90-cray + os=-unicos + ;; + craynv) + basic_machine=craynv-cray + os=-unicosmp + ;; + cr16c) + basic_machine=cr16c-unknown + os=-elf + ;; + crds | unos) + basic_machine=m68k-crds + ;; + crisv32 | crisv32-* | etraxfs*) + basic_machine=crisv32-axis + ;; + cris | cris-* | etrax*) + basic_machine=cris-axis + ;; + crx) + basic_machine=crx-unknown + os=-elf + ;; + da30 | da30-*) + basic_machine=m68k-da30 + ;; + decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn) + basic_machine=mips-dec + ;; + decsystem10* | dec10*) + basic_machine=pdp10-dec + os=-tops10 + ;; + decsystem20* | dec20*) + basic_machine=pdp10-dec + os=-tops20 + ;; + delta | 3300 | motorola-3300 | motorola-delta \ + | 3300-motorola | delta-motorola) + basic_machine=m68k-motorola + ;; + delta88) + basic_machine=m88k-motorola + os=-sysv3 + ;; + djgpp) + basic_machine=i586-pc + os=-msdosdjgpp + ;; + dpx20 | dpx20-*) + basic_machine=rs6000-bull + os=-bosx + ;; + dpx2* | dpx2*-bull) + basic_machine=m68k-bull + os=-sysv3 + ;; + ebmon29k) + basic_machine=a29k-amd + os=-ebmon + ;; + elxsi) + basic_machine=elxsi-elxsi + os=-bsd + ;; + encore | umax | mmax) + basic_machine=ns32k-encore + ;; + es1800 | OSE68k | ose68k | ose | OSE) + basic_machine=m68k-ericsson + os=-ose + ;; + fx2800) + basic_machine=i860-alliant + ;; + genix) + basic_machine=ns32k-ns + ;; + gmicro) + basic_machine=tron-gmicro + os=-sysv + ;; + go32) + basic_machine=i386-pc + os=-go32 + ;; + h3050r* | hiux*) + basic_machine=hppa1.1-hitachi + os=-hiuxwe2 + ;; + h8300hms) + basic_machine=h8300-hitachi + os=-hms + ;; + h8300xray) + basic_machine=h8300-hitachi + os=-xray + ;; + h8500hms) + basic_machine=h8500-hitachi + os=-hms + ;; + harris) + basic_machine=m88k-harris + os=-sysv3 + ;; + hp300-*) + basic_machine=m68k-hp + ;; + hp300bsd) + basic_machine=m68k-hp + os=-bsd + ;; + hp300hpux) + basic_machine=m68k-hp + os=-hpux + ;; + hp3k9[0-9][0-9] | hp9[0-9][0-9]) + basic_machine=hppa1.0-hp + ;; + hp9k2[0-9][0-9] | hp9k31[0-9]) + basic_machine=m68000-hp + ;; + hp9k3[2-9][0-9]) + basic_machine=m68k-hp + ;; + hp9k6[0-9][0-9] | hp6[0-9][0-9]) + basic_machine=hppa1.0-hp + ;; + hp9k7[0-79][0-9] | hp7[0-79][0-9]) + basic_machine=hppa1.1-hp + ;; + hp9k78[0-9] | hp78[0-9]) + # FIXME: really hppa2.0-hp + basic_machine=hppa1.1-hp + ;; + hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) + # FIXME: really hppa2.0-hp + basic_machine=hppa1.1-hp + ;; + hp9k8[0-9][13679] | hp8[0-9][13679]) + basic_machine=hppa1.1-hp + ;; + hp9k8[0-9][0-9] | hp8[0-9][0-9]) + basic_machine=hppa1.0-hp + ;; + hppa-next) + os=-nextstep3 + ;; + hppaosf) + basic_machine=hppa1.1-hp + os=-osf + ;; + hppro) + basic_machine=hppa1.1-hp + os=-proelf + ;; + i370-ibm* | ibm*) + basic_machine=i370-ibm + ;; +# I'm not sure what "Sysv32" means. Should this be sysv3.2? + i*86v32) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-sysv32 + ;; + i*86v4*) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-sysv4 + ;; + i*86v) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-sysv + ;; + i*86sol2) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-solaris2 + ;; + i386mach) + basic_machine=i386-mach + os=-mach + ;; + i386-vsta | vsta) + basic_machine=i386-unknown + os=-vsta + ;; + iris | iris4d) + basic_machine=mips-sgi + case $os in + -irix*) + ;; + *) + os=-irix4 + ;; + esac + ;; + isi68 | isi) + basic_machine=m68k-isi + os=-sysv + ;; + m88k-omron*) + basic_machine=m88k-omron + ;; + magnum | m3230) + basic_machine=mips-mips + os=-sysv + ;; + merlin) + basic_machine=ns32k-utek + os=-sysv + ;; + mingw32) + basic_machine=i386-pc + os=-mingw32 + ;; + miniframe) + basic_machine=m68000-convergent + ;; + *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*) + basic_machine=m68k-atari + os=-mint + ;; + mips3*-*) + basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` + ;; + mips3*) + basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown + ;; + monitor) + basic_machine=m68k-rom68k + os=-coff + ;; + morphos) + basic_machine=powerpc-unknown + os=-morphos + ;; + msdos) + basic_machine=i386-pc + os=-msdos + ;; + mvs) + basic_machine=i370-ibm + os=-mvs + ;; + ncr3000) + basic_machine=i486-ncr + os=-sysv4 + ;; + netbsd386) + basic_machine=i386-unknown + os=-netbsd + ;; + netwinder) + basic_machine=armv4l-rebel + os=-linux + ;; + news | news700 | news800 | news900) + basic_machine=m68k-sony + os=-newsos + ;; + news1000) + basic_machine=m68030-sony + os=-newsos + ;; + news-3600 | risc-news) + basic_machine=mips-sony + os=-newsos + ;; + necv70) + basic_machine=v70-nec + os=-sysv + ;; + next | m*-next ) + basic_machine=m68k-next + case $os in + -nextstep* ) + ;; + -ns2*) + os=-nextstep2 + ;; + *) + os=-nextstep3 + ;; + esac + ;; + nh3000) + basic_machine=m68k-harris + os=-cxux + ;; + nh[45]000) + basic_machine=m88k-harris + os=-cxux + ;; + nindy960) + basic_machine=i960-intel + os=-nindy + ;; + mon960) + basic_machine=i960-intel + os=-mon960 + ;; + nonstopux) + basic_machine=mips-compaq + os=-nonstopux + ;; + np1) + basic_machine=np1-gould + ;; + nsr-tandem) + basic_machine=nsr-tandem + ;; + op50n-* | op60c-*) + basic_machine=hppa1.1-oki + os=-proelf + ;; + openrisc | openrisc-*) + basic_machine=or32-unknown + ;; + os400) + basic_machine=powerpc-ibm + os=-os400 + ;; + OSE68000 | ose68000) + basic_machine=m68000-ericsson + os=-ose + ;; + os68k) + basic_machine=m68k-none + os=-os68k + ;; + pa-hitachi) + basic_machine=hppa1.1-hitachi + os=-hiuxwe2 + ;; + paragon) + basic_machine=i860-intel + os=-osf + ;; + pbd) + basic_machine=sparc-tti + ;; + pbb) + basic_machine=m68k-tti + ;; + pc532 | pc532-*) + basic_machine=ns32k-pc532 + ;; + pentium | p5 | k5 | k6 | nexgen | viac3) + basic_machine=i586-pc + ;; + pentiumpro | p6 | 6x86 | athlon | athlon_*) + basic_machine=i686-pc + ;; + pentiumii | pentium2 | pentiumiii | pentium3) + basic_machine=i686-pc + ;; + pentium4) + basic_machine=i786-pc + ;; + pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) + basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pentiumpro-* | p6-* | 6x86-* | athlon-*) + basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*) + basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pentium4-*) + basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pn) + basic_machine=pn-gould + ;; + power) basic_machine=power-ibm + ;; + ppc) basic_machine=powerpc-unknown + ;; + ppc-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ppcle | powerpclittle | ppc-le | powerpc-little) + basic_machine=powerpcle-unknown + ;; + ppcle-* | powerpclittle-*) + basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ppc64) basic_machine=powerpc64-unknown + ;; + ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ppc64le | powerpc64little | ppc64-le | powerpc64-little) + basic_machine=powerpc64le-unknown + ;; + ppc64le-* | powerpc64little-*) + basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ps2) + basic_machine=i386-ibm + ;; + pw32) + basic_machine=i586-unknown + os=-pw32 + ;; + rom68k) + basic_machine=m68k-rom68k + os=-coff + ;; + rm[46]00) + basic_machine=mips-siemens + ;; + rtpc | rtpc-*) + basic_machine=romp-ibm + ;; + s390 | s390-*) + basic_machine=s390-ibm + ;; + s390x | s390x-*) + basic_machine=s390x-ibm + ;; + sa29200) + basic_machine=a29k-amd + os=-udi + ;; + sb1) + basic_machine=mipsisa64sb1-unknown + ;; + sb1el) + basic_machine=mipsisa64sb1el-unknown + ;; + sei) + basic_machine=mips-sei + os=-seiux + ;; + sequent) + basic_machine=i386-sequent + ;; + sh) + basic_machine=sh-hitachi + os=-hms + ;; + sh64) + basic_machine=sh64-unknown + ;; + sparclite-wrs | simso-wrs) + basic_machine=sparclite-wrs + os=-vxworks + ;; + sps7) + basic_machine=m68k-bull + os=-sysv2 + ;; + spur) + basic_machine=spur-unknown + ;; + st2000) + basic_machine=m68k-tandem + ;; + stratus) + basic_machine=i860-stratus + os=-sysv4 + ;; + sun2) + basic_machine=m68000-sun + ;; + sun2os3) + basic_machine=m68000-sun + os=-sunos3 + ;; + sun2os4) + basic_machine=m68000-sun + os=-sunos4 + ;; + sun3os3) + basic_machine=m68k-sun + os=-sunos3 + ;; + sun3os4) + basic_machine=m68k-sun + os=-sunos4 + ;; + sun4os3) + basic_machine=sparc-sun + os=-sunos3 + ;; + sun4os4) + basic_machine=sparc-sun + os=-sunos4 + ;; + sun4sol2) + basic_machine=sparc-sun + os=-solaris2 + ;; + sun3 | sun3-*) + basic_machine=m68k-sun + ;; + sun4) + basic_machine=sparc-sun + ;; + sun386 | sun386i | roadrunner) + basic_machine=i386-sun + ;; + sv1) + basic_machine=sv1-cray + os=-unicos + ;; + symmetry) + basic_machine=i386-sequent + os=-dynix + ;; + t3e) + basic_machine=alphaev5-cray + os=-unicos + ;; + t90) + basic_machine=t90-cray + os=-unicos + ;; + tic54x | c54x*) + basic_machine=tic54x-unknown + os=-coff + ;; + tic55x | c55x*) + basic_machine=tic55x-unknown + os=-coff + ;; + tic6x | c6x*) + basic_machine=tic6x-unknown + os=-coff + ;; + tx39) + basic_machine=mipstx39-unknown + ;; + tx39el) + basic_machine=mipstx39el-unknown + ;; + toad1) + basic_machine=pdp10-xkl + os=-tops20 + ;; + tower | tower-32) + basic_machine=m68k-ncr + ;; + tpf) + basic_machine=s390x-ibm + os=-tpf + ;; + udi29k) + basic_machine=a29k-amd + os=-udi + ;; + ultra3) + basic_machine=a29k-nyu + os=-sym1 + ;; + v810 | necv810) + basic_machine=v810-nec + os=-none + ;; + vaxv) + basic_machine=vax-dec + os=-sysv + ;; + vms) + basic_machine=vax-dec + os=-vms + ;; + vpp*|vx|vx-*) + basic_machine=f301-fujitsu + ;; + vxworks960) + basic_machine=i960-wrs + os=-vxworks + ;; + vxworks68) + basic_machine=m68k-wrs + os=-vxworks + ;; + vxworks29k) + basic_machine=a29k-wrs + os=-vxworks + ;; + w65*) + basic_machine=w65-wdc + os=-none + ;; + w89k-*) + basic_machine=hppa1.1-winbond + os=-proelf + ;; + xbox) + basic_machine=i686-pc + os=-mingw32 + ;; + xps | xps100) + basic_machine=xps100-honeywell + ;; + ymp) + basic_machine=ymp-cray + os=-unicos + ;; + z8k-*-coff) + basic_machine=z8k-unknown + os=-sim + ;; + none) + basic_machine=none-none + os=-none + ;; + +# Here we handle the default manufacturer of certain CPU types. It is in +# some cases the only manufacturer, in others, it is the most popular. + w89k) + basic_machine=hppa1.1-winbond + ;; + op50n) + basic_machine=hppa1.1-oki + ;; + op60c) + basic_machine=hppa1.1-oki + ;; + romp) + basic_machine=romp-ibm + ;; + mmix) + basic_machine=mmix-knuth + ;; + rs6000) + basic_machine=rs6000-ibm + ;; + vax) + basic_machine=vax-dec + ;; + pdp10) + # there are many clones, so DEC is not a safe bet + basic_machine=pdp10-unknown + ;; + pdp11) + basic_machine=pdp11-dec + ;; + we32k) + basic_machine=we32k-att + ;; + sh[1234] | sh[24]a | sh[34]eb | sh[1234]le | sh[23]ele) + basic_machine=sh-unknown + ;; + sparc | sparcv8 | sparcv9 | sparcv9b) + basic_machine=sparc-sun + ;; + cydra) + basic_machine=cydra-cydrome + ;; + orion) + basic_machine=orion-highlevel + ;; + orion105) + basic_machine=clipper-highlevel + ;; + mac | mpw | mac-mpw) + basic_machine=m68k-apple + ;; + pmac | pmac-mpw) + basic_machine=powerpc-apple + ;; + *-unknown) + # Make sure to match an already-canonicalized machine name. + ;; + *) + echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 + exit 1 + ;; +esac + +# Here we canonicalize certain aliases for manufacturers. +case $basic_machine in + *-digital*) + basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'` + ;; + *-commodore*) + basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'` + ;; + *) + ;; +esac + +# Decode manufacturer-specific aliases for certain operating systems. + +if [ x"$os" != x"" ] +then +case $os in + # First match some system type aliases + # that might get confused with valid system types. + # -solaris* is a basic system type, with this one exception. + -solaris1 | -solaris1.*) + os=`echo $os | sed -e 's|solaris1|sunos4|'` + ;; + -solaris) + os=-solaris2 + ;; + -svr4*) + os=-sysv4 + ;; + -unixware*) + os=-sysv4.2uw + ;; + -gnu/linux*) + os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` + ;; + # First accept the basic system types. + # The portable systems comes first. + # Each alternative MUST END IN A *, to match a version number. + # -sysv* is not here because it comes later, after sysvr4. + -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ + | -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\ + | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \ + | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ + | -aos* \ + | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ + | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ + | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* | -openbsd* \ + | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \ + | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ + | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ + | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ + | -chorusos* | -chorusrdb* \ + | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ + | -mingw32* | -linux-gnu* | -linux-uclibc* | -uxpv* | -beos* | -mpeix* | -udk* \ + | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ + | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ + | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ + | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ + | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ + | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ + | -skyos* | -haiku*) + # Remember, each alternative MUST END IN *, to match a version number. + ;; + -qnx*) + case $basic_machine in + x86-* | i*86-*) + ;; + *) + os=-nto$os + ;; + esac + ;; + -nto-qnx*) + ;; + -nto*) + os=`echo $os | sed -e 's|nto|nto-qnx|'` + ;; + -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ + | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \ + | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) + ;; + -mac*) + os=`echo $os | sed -e 's|mac|macos|'` + ;; + -linux-dietlibc) + os=-linux-dietlibc + ;; + -linux*) + os=`echo $os | sed -e 's|linux|linux-gnu|'` + ;; + -sunos5*) + os=`echo $os | sed -e 's|sunos5|solaris2|'` + ;; + -sunos6*) + os=`echo $os | sed -e 's|sunos6|solaris3|'` + ;; + -opened*) + os=-openedition + ;; + -os400*) + os=-os400 + ;; + -wince*) + os=-wince + ;; + -osfrose*) + os=-osfrose + ;; + -osf*) + os=-osf + ;; + -utek*) + os=-bsd + ;; + -dynix*) + os=-bsd + ;; + -acis*) + os=-aos + ;; + -atheos*) + os=-atheos + ;; + -syllable*) + os=-syllable + ;; + -386bsd) + os=-bsd + ;; + -ctix* | -uts*) + os=-sysv + ;; + -nova*) + os=-rtmk-nova + ;; + -ns2 ) + os=-nextstep2 + ;; + -nsk*) + os=-nsk + ;; + # Preserve the version number of sinix5. + -sinix5.*) + os=`echo $os | sed -e 's|sinix|sysv|'` + ;; + -sinix*) + os=-sysv4 + ;; + -tpf*) + os=-tpf + ;; + -triton*) + os=-sysv3 + ;; + -oss*) + os=-sysv3 + ;; + -svr4) + os=-sysv4 + ;; + -svr3) + os=-sysv3 + ;; + -sysvr4) + os=-sysv4 + ;; + # This must come after -sysvr4. + -sysv*) + ;; + -ose*) + os=-ose + ;; + -es1800*) + os=-ose + ;; + -xenix) + os=-xenix + ;; + -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) + os=-mint + ;; + -aros*) + os=-aros + ;; + -kaos*) + os=-kaos + ;; + -zvmoe) + os=-zvmoe + ;; + -none) + ;; + *) + # Get rid of the `-' at the beginning of $os. + os=`echo $os | sed 's/[^-]*-//'` + echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2 + exit 1 + ;; +esac +else + +# Here we handle the default operating systems that come with various machines. +# The value should be what the vendor currently ships out the door with their +# machine or put another way, the most popular os provided with the machine. + +# Note that if you're going to try to match "-MANUFACTURER" here (say, +# "-sun"), then you have to tell the case statement up towards the top +# that MANUFACTURER isn't an operating system. Otherwise, code above +# will signal an error saying that MANUFACTURER isn't an operating +# system, and we'll never get to this point. + +case $basic_machine in + *-acorn) + os=-riscix1.2 + ;; + arm*-rebel) + os=-linux + ;; + arm*-semi) + os=-aout + ;; + c4x-* | tic4x-*) + os=-coff + ;; + # This must come before the *-dec entry. + pdp10-*) + os=-tops20 + ;; + pdp11-*) + os=-none + ;; + *-dec | vax-*) + os=-ultrix4.2 + ;; + m68*-apollo) + os=-domain + ;; + i386-sun) + os=-sunos4.0.2 + ;; + m68000-sun) + os=-sunos3 + # This also exists in the configure program, but was not the + # default. + # os=-sunos4 + ;; + m68*-cisco) + os=-aout + ;; + mips*-cisco) + os=-elf + ;; + mips*-*) + os=-elf + ;; + or32-*) + os=-coff + ;; + *-tti) # must be before sparc entry or we get the wrong os. + os=-sysv3 + ;; + sparc-* | *-sun) + os=-sunos4.1.1 + ;; + *-be) + os=-beos + ;; + *-haiku) + os=-haiku + ;; + *-ibm) + os=-aix + ;; + *-knuth) + os=-mmixware + ;; + *-wec) + os=-proelf + ;; + *-winbond) + os=-proelf + ;; + *-oki) + os=-proelf + ;; + *-hp) + os=-hpux + ;; + *-hitachi) + os=-hiux + ;; + i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) + os=-sysv + ;; + *-cbm) + os=-amigaos + ;; + *-dg) + os=-dgux + ;; + *-dolphin) + os=-sysv3 + ;; + m68k-ccur) + os=-rtu + ;; + m88k-omron*) + os=-luna + ;; + *-next ) + os=-nextstep + ;; + *-sequent) + os=-ptx + ;; + *-crds) + os=-unos + ;; + *-ns) + os=-genix + ;; + i370-*) + os=-mvs + ;; + *-next) + os=-nextstep3 + ;; + *-gould) + os=-sysv + ;; + *-highlevel) + os=-bsd + ;; + *-encore) + os=-bsd + ;; + *-sgi) + os=-irix + ;; + *-siemens) + os=-sysv4 + ;; + *-masscomp) + os=-rtu + ;; + f30[01]-fujitsu | f700-fujitsu) + os=-uxpv + ;; + *-rom68k) + os=-coff + ;; + *-*bug) + os=-coff + ;; + *-apple) + os=-macos + ;; + *-atari*) + os=-mint + ;; + *) + os=-none + ;; +esac +fi + +# Here we handle the case where we know the os, and the CPU type, but not the +# manufacturer. We pick the logical manufacturer. +vendor=unknown +case $basic_machine in + *-unknown) + case $os in + -riscix*) + vendor=acorn + ;; + -sunos*) + vendor=sun + ;; + -aix*) + vendor=ibm + ;; + -beos*) + vendor=be + ;; + -hpux*) + vendor=hp + ;; + -mpeix*) + vendor=hp + ;; + -hiux*) + vendor=hitachi + ;; + -unos*) + vendor=crds + ;; + -dgux*) + vendor=dg + ;; + -luna*) + vendor=omron + ;; + -genix*) + vendor=ns + ;; + -mvs* | -opened*) + vendor=ibm + ;; + -os400*) + vendor=ibm + ;; + -ptx*) + vendor=sequent + ;; + -tpf*) + vendor=ibm + ;; + -vxsim* | -vxworks* | -windiss*) + vendor=wrs + ;; + -aux*) + vendor=apple + ;; + -hms*) + vendor=hitachi + ;; + -mpw* | -macos*) + vendor=apple + ;; + -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) + vendor=atari + ;; + -vos*) + vendor=stratus + ;; + esac + basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"` + ;; +esac + +echo $basic_machine$os +exit + +# Local variables: +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "timestamp='" +# time-stamp-format: "%:y-%02m-%02d" +# time-stamp-end: "'" +# End: diff --git a/app/fonttosfnt/configure b/app/fonttosfnt/configure new file mode 100644 index 000000000..15fb2d314 --- /dev/null +++ b/app/fonttosfnt/configure @@ -0,0 +1,4854 @@ +#! /bin/sh +# Guess values for system-dependent variables and create Makefiles. +# Generated by GNU Autoconf 2.59 for fonttosfnt 1.0.2. +# +# Report bugs to . +# +# Copyright (C) 2003 Free Software Foundation, Inc. +# This configure script is free software; the Free Software Foundation +# gives unlimited permission to copy, distribute and modify it. +## --------------------- ## +## M4sh Initialization. ## +## --------------------- ## + +# Be Bourne compatible +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then + emulate sh + NULLCMD=: + # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' +elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then + set -o posix +fi +DUALCASE=1; export DUALCASE # for MKS sh + +# Support unset when possible. +if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then + as_unset=unset +else + as_unset=false +fi + + +# Work around bugs in pre-3.0 UWIN ksh. +$as_unset ENV MAIL MAILPATH +PS1='$ ' +PS2='> ' +PS4='+ ' + +# NLS nuisances. +for as_var in \ + LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ + LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ + LC_TELEPHONE LC_TIME +do + if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then + eval $as_var=C; export $as_var + else + $as_unset $as_var + fi +done + +# Required to use basename. +if expr a : '\(a\)' >/dev/null 2>&1; then + as_expr=expr +else + as_expr=false +fi + +if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then + as_basename=basename +else + as_basename=false +fi + + +# Name of the executable. +as_me=`$as_basename "$0" || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)$' \| \ + . : '\(.\)' 2>/dev/null || +echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; } + /^X\/\(\/\/\)$/{ s//\1/; q; } + /^X\/\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + + +# PATH needs CR, and LINENO needs CR and PATH. +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + echo "#! /bin/sh" >conf$$.sh + echo "exit 0" >>conf$$.sh + chmod +x conf$$.sh + if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then + PATH_SEPARATOR=';' + else + PATH_SEPARATOR=: + fi + rm -f conf$$.sh +fi + + + as_lineno_1=$LINENO + as_lineno_2=$LINENO + as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` + test "x$as_lineno_1" != "x$as_lineno_2" && + test "x$as_lineno_3" = "x$as_lineno_2" || { + # Find who we are. Look in the path if we contain no path at all + # relative or not. + case $0 in + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break +done + + ;; + esac + # We did not find ourselves, most probably we were run as `sh COMMAND' + # in which case we are not to be found in the path. + if test "x$as_myself" = x; then + as_myself=$0 + fi + if test ! -f "$as_myself"; then + { echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2 + { (exit 1); exit 1; }; } + fi + case $CONFIG_SHELL in + '') + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for as_base in sh bash ksh sh5; do + case $as_dir in + /*) + if ("$as_dir/$as_base" -c ' + as_lineno_1=$LINENO + as_lineno_2=$LINENO + as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` + test "x$as_lineno_1" != "x$as_lineno_2" && + test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then + $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; } + $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; } + CONFIG_SHELL=$as_dir/$as_base + export CONFIG_SHELL + exec "$CONFIG_SHELL" "$0" ${1+"$@"} + fi;; + esac + done +done +;; + esac + + # Create $as_me.lineno as a copy of $as_myself, but with $LINENO + # uniformly replaced by the line number. The first 'sed' inserts a + # line-number line before each line; the second 'sed' does the real + # work. The second script uses 'N' to pair each line-number line + # with the numbered line, and appends trailing '-' during + # substitution so that $LINENO is not a special case at line end. + # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the + # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-) + sed '=' <$as_myself | + sed ' + N + s,$,-, + : loop + s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3, + t loop + s,-$,, + s,^['$as_cr_digits']*\n,, + ' >$as_me.lineno && + chmod +x $as_me.lineno || + { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 + { (exit 1); exit 1; }; } + + # Don't try to exec as it changes $[0], causing all sort of problems + # (the dirname of $[0] is not the place where we might find the + # original and so on. Autoconf is especially sensible to this). + . ./$as_me.lineno + # Exit status is that of the last command. + exit +} + + +case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in + *c*,-n*) ECHO_N= ECHO_C=' +' ECHO_T=' ' ;; + *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; + *) ECHO_N= ECHO_C='\c' ECHO_T= ;; +esac + +if expr a : '\(a\)' >/dev/null 2>&1; then + as_expr=expr +else + as_expr=false +fi + +rm -f conf$$ conf$$.exe conf$$.file +echo >conf$$.file +if ln -s conf$$.file conf$$ 2>/dev/null; then + # We could just check for DJGPP; but this test a) works b) is more generic + # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). + if test -f conf$$.exe; then + # Don't use ln at all; we don't have any links + as_ln_s='cp -p' + else + as_ln_s='ln -s' + fi +elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln +else + as_ln_s='cp -p' +fi +rm -f conf$$ conf$$.exe conf$$.file + +if mkdir -p . 2>/dev/null; then + as_mkdir_p=: +else + test -d ./-p && rmdir ./-p + as_mkdir_p=false +fi + +as_executable_p="test -f" + +# Sed expression to map a string onto a valid CPP name. +as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" + +# Sed expression to map a string onto a valid variable name. +as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" + + +# IFS +# We need space, tab and new line, in precisely that order. +as_nl=' +' +IFS=" $as_nl" + +# CDPATH. +$as_unset CDPATH + + +# Name of the host. +# hostname on some systems (SVR3.2, Linux) returns a bogus exit status, +# so uname gets run too. +ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` + +exec 6>&1 + +# +# Initializations. +# +ac_default_prefix=/usr/local +ac_config_libobj_dir=. +cross_compiling=no +subdirs= +MFLAGS= +MAKEFLAGS= +SHELL=${CONFIG_SHELL-/bin/sh} + +# Maximum number of lines to put in a shell here document. +# This variable seems obsolete. It should probably be removed, and +# only ac_max_sed_lines should be used. +: ${ac_max_here_lines=38} + +# Identity of this package. +PACKAGE_NAME='fonttosfnt' +PACKAGE_TARNAME='fonttosfnt' +PACKAGE_VERSION='1.0.2' +PACKAGE_STRING='fonttosfnt 1.0.2' +PACKAGE_BUGREPORT='https://bugs.freedesktop.org/enter_bug.cgi?product=xorg' + +ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CYGPATH_W PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO install_sh STRIP ac_ct_STRIP INSTALL_STRIP_PROGRAM mkdir_p AWK SET_MAKE am__leading_dot AMTAR am__tar am__untar MAINTAINER_MODE_TRUE MAINTAINER_MODE_FALSE MAINT CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT DEPDIR am__include am__quote AMDEP_TRUE AMDEP_FALSE AMDEPBACKSLASH CCDEPMODE am__fastdepCC_TRUE am__fastdepCC_FALSE NEED_SETENV_TRUE NEED_SETENV_FALSE PKG_CONFIG ac_pt_PKG_CONFIG FONTTOSFNT_CFLAGS FONTTOSFNT_LIBS build build_cpu build_vendor build_os host host_cpu host_vendor host_os APP_MAN_SUFFIX LIB_MAN_SUFFIX FILE_MAN_SUFFIX MISC_MAN_SUFFIX DRIVER_MAN_SUFFIX ADMIN_MAN_SUFFIX APP_MAN_DIR LIB_MAN_DIR FILE_MAN_DIR MISC_MAN_DIR DRIVER_MAN_DIR ADMIN_MAN_DIR LIBOBJS LTLIBOBJS' +ac_subst_files='' + +# Initialize some variables set by options. +ac_init_help= +ac_init_version=false +# The variables have the same names as the options, with +# dashes changed to underlines. +cache_file=/dev/null +exec_prefix=NONE +no_create= +no_recursion= +prefix=NONE +program_prefix=NONE +program_suffix=NONE +program_transform_name=s,x,x, +silent= +site= +srcdir= +verbose= +x_includes=NONE +x_libraries=NONE + +# Installation directory options. +# These are left unexpanded so users can "make install exec_prefix=/foo" +# and all the variables that are supposed to be based on exec_prefix +# by default will actually change. +# Use braces instead of parens because sh, perl, etc. also accept them. +bindir='${exec_prefix}/bin' +sbindir='${exec_prefix}/sbin' +libexecdir='${exec_prefix}/libexec' +datadir='${prefix}/share' +sysconfdir='${prefix}/etc' +sharedstatedir='${prefix}/com' +localstatedir='${prefix}/var' +libdir='${exec_prefix}/lib' +includedir='${prefix}/include' +oldincludedir='/usr/include' +infodir='${prefix}/info' +mandir='${prefix}/man' + +ac_prev= +for ac_option +do + # If the previous option needs an argument, assign it. + if test -n "$ac_prev"; then + eval "$ac_prev=\$ac_option" + ac_prev= + continue + fi + + ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'` + + # Accept the important Cygnus configure options, so we can diagnose typos. + + case $ac_option in + + -bindir | --bindir | --bindi | --bind | --bin | --bi) + ac_prev=bindir ;; + -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) + bindir=$ac_optarg ;; + + -build | --build | --buil | --bui | --bu) + ac_prev=build_alias ;; + -build=* | --build=* | --buil=* | --bui=* | --bu=*) + build_alias=$ac_optarg ;; + + -cache-file | --cache-file | --cache-fil | --cache-fi \ + | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) + ac_prev=cache_file ;; + -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ + | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) + cache_file=$ac_optarg ;; + + --config-cache | -C) + cache_file=config.cache ;; + + -datadir | --datadir | --datadi | --datad | --data | --dat | --da) + ac_prev=datadir ;; + -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \ + | --da=*) + datadir=$ac_optarg ;; + + -disable-* | --disable-*) + ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid feature name: $ac_feature" >&2 + { (exit 1); exit 1; }; } + ac_feature=`echo $ac_feature | sed 's/-/_/g'` + eval "enable_$ac_feature=no" ;; + + -enable-* | --enable-*) + ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid feature name: $ac_feature" >&2 + { (exit 1); exit 1; }; } + ac_feature=`echo $ac_feature | sed 's/-/_/g'` + case $ac_option in + *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; + *) ac_optarg=yes ;; + esac + eval "enable_$ac_feature='$ac_optarg'" ;; + + -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ + | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ + | --exec | --exe | --ex) + ac_prev=exec_prefix ;; + -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ + | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ + | --exec=* | --exe=* | --ex=*) + exec_prefix=$ac_optarg ;; + + -gas | --gas | --ga | --g) + # Obsolete; use --with-gas. + with_gas=yes ;; + + -help | --help | --hel | --he | -h) + ac_init_help=long ;; + -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) + ac_init_help=recursive ;; + -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) + ac_init_help=short ;; + + -host | --host | --hos | --ho) + ac_prev=host_alias ;; + -host=* | --host=* | --hos=* | --ho=*) + host_alias=$ac_optarg ;; + + -includedir | --includedir | --includedi | --included | --include \ + | --includ | --inclu | --incl | --inc) + ac_prev=includedir ;; + -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ + | --includ=* | --inclu=* | --incl=* | --inc=*) + includedir=$ac_optarg ;; + + -infodir | --infodir | --infodi | --infod | --info | --inf) + ac_prev=infodir ;; + -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) + infodir=$ac_optarg ;; + + -libdir | --libdir | --libdi | --libd) + ac_prev=libdir ;; + -libdir=* | --libdir=* | --libdi=* | --libd=*) + libdir=$ac_optarg ;; + + -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ + | --libexe | --libex | --libe) + ac_prev=libexecdir ;; + -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ + | --libexe=* | --libex=* | --libe=*) + libexecdir=$ac_optarg ;; + + -localstatedir | --localstatedir | --localstatedi | --localstated \ + | --localstate | --localstat | --localsta | --localst \ + | --locals | --local | --loca | --loc | --lo) + ac_prev=localstatedir ;; + -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ + | --localstate=* | --localstat=* | --localsta=* | --localst=* \ + | --locals=* | --local=* | --loca=* | --loc=* | --lo=*) + localstatedir=$ac_optarg ;; + + -mandir | --mandir | --mandi | --mand | --man | --ma | --m) + ac_prev=mandir ;; + -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) + mandir=$ac_optarg ;; + + -nfp | --nfp | --nf) + # Obsolete; use --without-fp. + with_fp=no ;; + + -no-create | --no-create | --no-creat | --no-crea | --no-cre \ + | --no-cr | --no-c | -n) + no_create=yes ;; + + -no-recursion | --no-recursion | --no-recursio | --no-recursi \ + | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) + no_recursion=yes ;; + + -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ + | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ + | --oldin | --oldi | --old | --ol | --o) + ac_prev=oldincludedir ;; + -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ + | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ + | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) + oldincludedir=$ac_optarg ;; + + -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) + ac_prev=prefix ;; + -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) + prefix=$ac_optarg ;; + + -program-prefix | --program-prefix | --program-prefi | --program-pref \ + | --program-pre | --program-pr | --program-p) + ac_prev=program_prefix ;; + -program-prefix=* | --program-prefix=* | --program-prefi=* \ + | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) + program_prefix=$ac_optarg ;; + + -program-suffix | --program-suffix | --program-suffi | --program-suff \ + | --program-suf | --program-su | --program-s) + ac_prev=program_suffix ;; + -program-suffix=* | --program-suffix=* | --program-suffi=* \ + | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) + program_suffix=$ac_optarg ;; + + -program-transform-name | --program-transform-name \ + | --program-transform-nam | --program-transform-na \ + | --program-transform-n | --program-transform- \ + | --program-transform | --program-transfor \ + | --program-transfo | --program-transf \ + | --program-trans | --program-tran \ + | --progr-tra | --program-tr | --program-t) + ac_prev=program_transform_name ;; + -program-transform-name=* | --program-transform-name=* \ + | --program-transform-nam=* | --program-transform-na=* \ + | --program-transform-n=* | --program-transform-=* \ + | --program-transform=* | --program-transfor=* \ + | --program-transfo=* | --program-transf=* \ + | --program-trans=* | --program-tran=* \ + | --progr-tra=* | --program-tr=* | --program-t=*) + program_transform_name=$ac_optarg ;; + + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + silent=yes ;; + + -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) + ac_prev=sbindir ;; + -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ + | --sbi=* | --sb=*) + sbindir=$ac_optarg ;; + + -sharedstatedir | --sharedstatedir | --sharedstatedi \ + | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ + | --sharedst | --shareds | --shared | --share | --shar \ + | --sha | --sh) + ac_prev=sharedstatedir ;; + -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ + | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ + | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ + | --sha=* | --sh=*) + sharedstatedir=$ac_optarg ;; + + -site | --site | --sit) + ac_prev=site ;; + -site=* | --site=* | --sit=*) + site=$ac_optarg ;; + + -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) + ac_prev=srcdir ;; + -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) + srcdir=$ac_optarg ;; + + -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ + | --syscon | --sysco | --sysc | --sys | --sy) + ac_prev=sysconfdir ;; + -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ + | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) + sysconfdir=$ac_optarg ;; + + -target | --target | --targe | --targ | --tar | --ta | --t) + ac_prev=target_alias ;; + -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) + target_alias=$ac_optarg ;; + + -v | -verbose | --verbose | --verbos | --verbo | --verb) + verbose=yes ;; + + -version | --version | --versio | --versi | --vers | -V) + ac_init_version=: ;; + + -with-* | --with-*) + ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid package name: $ac_package" >&2 + { (exit 1); exit 1; }; } + ac_package=`echo $ac_package| sed 's/-/_/g'` + case $ac_option in + *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; + *) ac_optarg=yes ;; + esac + eval "with_$ac_package='$ac_optarg'" ;; + + -without-* | --without-*) + ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid package name: $ac_package" >&2 + { (exit 1); exit 1; }; } + ac_package=`echo $ac_package | sed 's/-/_/g'` + eval "with_$ac_package=no" ;; + + --x) + # Obsolete; use --with-x. + with_x=yes ;; + + -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ + | --x-incl | --x-inc | --x-in | --x-i) + ac_prev=x_includes ;; + -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ + | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) + x_includes=$ac_optarg ;; + + -x-libraries | --x-libraries | --x-librarie | --x-librari \ + | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) + ac_prev=x_libraries ;; + -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ + | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) + x_libraries=$ac_optarg ;; + + -*) { echo "$as_me: error: unrecognized option: $ac_option +Try \`$0 --help' for more information." >&2 + { (exit 1); exit 1; }; } + ;; + + *=*) + ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` + # Reject names that are not valid shell variable names. + expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid variable name: $ac_envvar" >&2 + { (exit 1); exit 1; }; } + ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` + eval "$ac_envvar='$ac_optarg'" + export $ac_envvar ;; + + *) + # FIXME: should be removed in autoconf 3.0. + echo "$as_me: WARNING: you should use --build, --host, --target" >&2 + expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && + echo "$as_me: WARNING: invalid host type: $ac_option" >&2 + : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option} + ;; + + esac +done + +if test -n "$ac_prev"; then + ac_option=--`echo $ac_prev | sed 's/_/-/g'` + { echo "$as_me: error: missing argument to $ac_option" >&2 + { (exit 1); exit 1; }; } +fi + +# Be sure to have absolute paths. +for ac_var in exec_prefix prefix +do + eval ac_val=$`echo $ac_var` + case $ac_val in + [\\/$]* | ?:[\\/]* | NONE | '' ) ;; + *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 + { (exit 1); exit 1; }; };; + esac +done + +# Be sure to have absolute paths. +for ac_var in bindir sbindir libexecdir datadir sysconfdir sharedstatedir \ + localstatedir libdir includedir oldincludedir infodir mandir +do + eval ac_val=$`echo $ac_var` + case $ac_val in + [\\/$]* | ?:[\\/]* ) ;; + *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 + { (exit 1); exit 1; }; };; + esac +done + +# There might be people who depend on the old broken behavior: `$host' +# used to hold the argument of --host etc. +# FIXME: To remove some day. +build=$build_alias +host=$host_alias +target=$target_alias + +# FIXME: To remove some day. +if test "x$host_alias" != x; then + if test "x$build_alias" = x; then + cross_compiling=maybe + echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host. + If a cross compiler is detected then cross compile mode will be used." >&2 + elif test "x$build_alias" != "x$host_alias"; then + cross_compiling=yes + fi +fi + +ac_tool_prefix= +test -n "$host_alias" && ac_tool_prefix=$host_alias- + +test "$silent" = yes && exec 6>/dev/null + + +# Find the source files, if location was not specified. +if test -z "$srcdir"; then + ac_srcdir_defaulted=yes + # Try the directory containing this script, then its parent. + ac_confdir=`(dirname "$0") 2>/dev/null || +$as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$0" : 'X\(//\)[^/]' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$0" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + srcdir=$ac_confdir + if test ! -r $srcdir/$ac_unique_file; then + srcdir=.. + fi +else + ac_srcdir_defaulted=no +fi +if test ! -r $srcdir/$ac_unique_file; then + if test "$ac_srcdir_defaulted" = yes; then + { echo "$as_me: error: cannot find sources ($ac_unique_file) in $ac_confdir or .." >&2 + { (exit 1); exit 1; }; } + else + { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 + { (exit 1); exit 1; }; } + fi +fi +(cd $srcdir && test -r ./$ac_unique_file) 2>/dev/null || + { echo "$as_me: error: sources are in $srcdir, but \`cd $srcdir' does not work" >&2 + { (exit 1); exit 1; }; } +srcdir=`echo "$srcdir" | sed 's%\([^\\/]\)[\\/]*$%\1%'` +ac_env_build_alias_set=${build_alias+set} +ac_env_build_alias_value=$build_alias +ac_cv_env_build_alias_set=${build_alias+set} +ac_cv_env_build_alias_value=$build_alias +ac_env_host_alias_set=${host_alias+set} +ac_env_host_alias_value=$host_alias +ac_cv_env_host_alias_set=${host_alias+set} +ac_cv_env_host_alias_value=$host_alias +ac_env_target_alias_set=${target_alias+set} +ac_env_target_alias_value=$target_alias +ac_cv_env_target_alias_set=${target_alias+set} +ac_cv_env_target_alias_value=$target_alias +ac_env_CC_set=${CC+set} +ac_env_CC_value=$CC +ac_cv_env_CC_set=${CC+set} +ac_cv_env_CC_value=$CC +ac_env_CFLAGS_set=${CFLAGS+set} +ac_env_CFLAGS_value=$CFLAGS +ac_cv_env_CFLAGS_set=${CFLAGS+set} +ac_cv_env_CFLAGS_value=$CFLAGS +ac_env_LDFLAGS_set=${LDFLAGS+set} +ac_env_LDFLAGS_value=$LDFLAGS +ac_cv_env_LDFLAGS_set=${LDFLAGS+set} +ac_cv_env_LDFLAGS_value=$LDFLAGS +ac_env_CPPFLAGS_set=${CPPFLAGS+set} +ac_env_CPPFLAGS_value=$CPPFLAGS +ac_cv_env_CPPFLAGS_set=${CPPFLAGS+set} +ac_cv_env_CPPFLAGS_value=$CPPFLAGS +ac_env_PKG_CONFIG_set=${PKG_CONFIG+set} +ac_env_PKG_CONFIG_value=$PKG_CONFIG +ac_cv_env_PKG_CONFIG_set=${PKG_CONFIG+set} +ac_cv_env_PKG_CONFIG_value=$PKG_CONFIG +ac_env_FONTTOSFNT_CFLAGS_set=${FONTTOSFNT_CFLAGS+set} +ac_env_FONTTOSFNT_CFLAGS_value=$FONTTOSFNT_CFLAGS +ac_cv_env_FONTTOSFNT_CFLAGS_set=${FONTTOSFNT_CFLAGS+set} +ac_cv_env_FONTTOSFNT_CFLAGS_value=$FONTTOSFNT_CFLAGS +ac_env_FONTTOSFNT_LIBS_set=${FONTTOSFNT_LIBS+set} +ac_env_FONTTOSFNT_LIBS_value=$FONTTOSFNT_LIBS +ac_cv_env_FONTTOSFNT_LIBS_set=${FONTTOSFNT_LIBS+set} +ac_cv_env_FONTTOSFNT_LIBS_value=$FONTTOSFNT_LIBS + +# +# Report the --help message. +# +if test "$ac_init_help" = "long"; then + # Omit some internal or obsolete options to make the list less imposing. + # This message is too long to be a string in the A/UX 3.1 sh. + cat <<_ACEOF +\`configure' configures fonttosfnt 1.0.2 to adapt to many kinds of systems. + +Usage: $0 [OPTION]... [VAR=VALUE]... + +To assign environment variables (e.g., CC, CFLAGS...), specify them as +VAR=VALUE. See below for descriptions of some of the useful variables. + +Defaults for the options are specified in brackets. + +Configuration: + -h, --help display this help and exit + --help=short display options specific to this package + --help=recursive display the short help of all the included packages + -V, --version display version information and exit + -q, --quiet, --silent do not print \`checking...' messages + --cache-file=FILE cache test results in FILE [disabled] + -C, --config-cache alias for \`--cache-file=config.cache' + -n, --no-create do not create output files + --srcdir=DIR find the sources in DIR [configure dir or \`..'] + +_ACEOF + + cat <<_ACEOF +Installation directories: + --prefix=PREFIX install architecture-independent files in PREFIX + [$ac_default_prefix] + --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX + [PREFIX] + +By default, \`make install' will install all the files in +\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify +an installation prefix other than \`$ac_default_prefix' using \`--prefix', +for instance \`--prefix=\$HOME'. + +For better control, use the options below. + +Fine tuning of the installation directories: + --bindir=DIR user executables [EPREFIX/bin] + --sbindir=DIR system admin executables [EPREFIX/sbin] + --libexecdir=DIR program executables [EPREFIX/libexec] + --datadir=DIR read-only architecture-independent data [PREFIX/share] + --sysconfdir=DIR read-only single-machine data [PREFIX/etc] + --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] + --localstatedir=DIR modifiable single-machine data [PREFIX/var] + --libdir=DIR object code libraries [EPREFIX/lib] + --includedir=DIR C header files [PREFIX/include] + --oldincludedir=DIR C header files for non-gcc [/usr/include] + --infodir=DIR info documentation [PREFIX/info] + --mandir=DIR man documentation [PREFIX/man] +_ACEOF + + cat <<\_ACEOF + +Program names: + --program-prefix=PREFIX prepend PREFIX to installed program names + --program-suffix=SUFFIX append SUFFIX to installed program names + --program-transform-name=PROGRAM run sed PROGRAM on installed program names + +System types: + --build=BUILD configure for building on BUILD [guessed] + --host=HOST cross-compile to build programs to run on HOST [BUILD] +_ACEOF +fi + +if test -n "$ac_init_help"; then + case $ac_init_help in + short | recursive ) echo "Configuration of fonttosfnt 1.0.2:";; + esac + cat <<\_ACEOF + +Optional Features: + --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) + --enable-FEATURE[=ARG] include FEATURE [ARG=yes] + --enable-maintainer-mode enable make rules and dependencies not useful + (and sometimes confusing) to the casual installer + --disable-dependency-tracking speeds up one-time build + --enable-dependency-tracking do not reject slow dependency extractors + +Optional Packages: + --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] + --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) + --with-release-version=STRING + Use release version string in package name + +Some influential environment variables: + CC C compiler command + CFLAGS C compiler flags + LDFLAGS linker flags, e.g. -L if you have libraries in a + nonstandard directory + CPPFLAGS C/C++ preprocessor flags, e.g. -I if you have + headers in a nonstandard directory + PKG_CONFIG path to pkg-config utility + FONTTOSFNT_CFLAGS + C compiler flags for FONTTOSFNT, overriding pkg-config + FONTTOSFNT_LIBS + linker flags for FONTTOSFNT, overriding pkg-config + +Use these variables to override the choices made by `configure' or to help +it to find libraries and programs with nonstandard names/locations. + +Report bugs to . +_ACEOF +fi + +if test "$ac_init_help" = "recursive"; then + # If there are subdirs, report their specific --help. + ac_popdir=`pwd` + for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue + test -d $ac_dir || continue + ac_builddir=. + +if test "$ac_dir" != .; then + ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` + # A "../" for each directory in $ac_dir_suffix. + ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` +else + ac_dir_suffix= ac_top_builddir= +fi + +case $srcdir in + .) # No --srcdir option. We are building in place. + ac_srcdir=. + if test -z "$ac_top_builddir"; then + ac_top_srcdir=. + else + ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` + fi ;; + [\\/]* | ?:[\\/]* ) # Absolute path. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir ;; + *) # Relative path. + ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_builddir$srcdir ;; +esac + +# Do not use `cd foo && pwd` to compute absolute paths, because +# the directories may not exist. +case `pwd` in +.) ac_abs_builddir="$ac_dir";; +*) + case "$ac_dir" in + .) ac_abs_builddir=`pwd`;; + [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";; + *) ac_abs_builddir=`pwd`/"$ac_dir";; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_top_builddir=${ac_top_builddir}.;; +*) + case ${ac_top_builddir}. in + .) ac_abs_top_builddir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;; + *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_srcdir=$ac_srcdir;; +*) + case $ac_srcdir in + .) ac_abs_srcdir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;; + *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_top_srcdir=$ac_top_srcdir;; +*) + case $ac_top_srcdir in + .) ac_abs_top_srcdir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;; + *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;; + esac;; +esac + + cd $ac_dir + # Check for guested configure; otherwise get Cygnus style configure. + if test -f $ac_srcdir/configure.gnu; then + echo + $SHELL $ac_srcdir/configure.gnu --help=recursive + elif test -f $ac_srcdir/configure; then + echo + $SHELL $ac_srcdir/configure --help=recursive + elif test -f $ac_srcdir/configure.ac || + test -f $ac_srcdir/configure.in; then + echo + $ac_configure --help + else + echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 + fi + cd $ac_popdir + done +fi + +test -n "$ac_init_help" && exit 0 +if $ac_init_version; then + cat <<\_ACEOF +fonttosfnt configure 1.0.2 +generated by GNU Autoconf 2.59 + +Copyright (C) 2003 Free Software Foundation, Inc. +This configure script is free software; the Free Software Foundation +gives unlimited permission to copy, distribute and modify it. +_ACEOF + exit 0 +fi +exec 5>config.log +cat >&5 <<_ACEOF +This file contains any messages produced by compilers while +running configure, to aid debugging if configure makes a mistake. + +It was created by fonttosfnt $as_me 1.0.2, which was +generated by GNU Autoconf 2.59. Invocation command line was + + $ $0 $@ + +_ACEOF +{ +cat <<_ASUNAME +## --------- ## +## Platform. ## +## --------- ## + +hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` +uname -m = `(uname -m) 2>/dev/null || echo unknown` +uname -r = `(uname -r) 2>/dev/null || echo unknown` +uname -s = `(uname -s) 2>/dev/null || echo unknown` +uname -v = `(uname -v) 2>/dev/null || echo unknown` + +/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` +/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` + +/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` +/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` +/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` +hostinfo = `(hostinfo) 2>/dev/null || echo unknown` +/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` +/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` +/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` + +_ASUNAME + +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + echo "PATH: $as_dir" +done + +} >&5 + +cat >&5 <<_ACEOF + + +## ----------- ## +## Core tests. ## +## ----------- ## + +_ACEOF + + +# Keep a trace of the command line. +# Strip out --no-create and --no-recursion so they do not pile up. +# Strip out --silent because we don't want to record it for future runs. +# Also quote any args containing shell meta-characters. +# Make two passes to allow for proper duplicate-argument suppression. +ac_configure_args= +ac_configure_args0= +ac_configure_args1= +ac_sep= +ac_must_keep_next=false +for ac_pass in 1 2 +do + for ac_arg + do + case $ac_arg in + -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + continue ;; + *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*) + ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + case $ac_pass in + 1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;; + 2) + ac_configure_args1="$ac_configure_args1 '$ac_arg'" + if test $ac_must_keep_next = true; then + ac_must_keep_next=false # Got value, back to normal. + else + case $ac_arg in + *=* | --config-cache | -C | -disable-* | --disable-* \ + | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ + | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ + | -with-* | --with-* | -without-* | --without-* | --x) + case "$ac_configure_args0 " in + "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; + esac + ;; + -* ) ac_must_keep_next=true ;; + esac + fi + ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'" + # Get rid of the leading space. + ac_sep=" " + ;; + esac + done +done +$as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; } +$as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export ac_configure_args1; } + +# When interrupted or exit'd, cleanup temporary files, and complete +# config.log. We remove comments because anyway the quotes in there +# would cause problems or look ugly. +# WARNING: Be sure not to use single quotes in there, as some shells, +# such as our DU 5.0 friend, will then `close' the trap. +trap 'exit_status=$? + # Save into config.log some information that might help in debugging. + { + echo + + cat <<\_ASBOX +## ---------------- ## +## Cache variables. ## +## ---------------- ## +_ASBOX + echo + # The following way of writing the cache mishandles newlines in values, +{ + (set) 2>&1 | + case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in + *ac_space=\ *) + sed -n \ + "s/'"'"'/'"'"'\\\\'"'"''"'"'/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p" + ;; + *) + sed -n \ + "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" + ;; + esac; +} + echo + + cat <<\_ASBOX +## ----------------- ## +## Output variables. ## +## ----------------- ## +_ASBOX + echo + for ac_var in $ac_subst_vars + do + eval ac_val=$`echo $ac_var` + echo "$ac_var='"'"'$ac_val'"'"'" + done | sort + echo + + if test -n "$ac_subst_files"; then + cat <<\_ASBOX +## ------------- ## +## Output files. ## +## ------------- ## +_ASBOX + echo + for ac_var in $ac_subst_files + do + eval ac_val=$`echo $ac_var` + echo "$ac_var='"'"'$ac_val'"'"'" + done | sort + echo + fi + + if test -s confdefs.h; then + cat <<\_ASBOX +## ----------- ## +## confdefs.h. ## +## ----------- ## +_ASBOX + echo + sed "/^$/d" confdefs.h | sort + echo + fi + test "$ac_signal" != 0 && + echo "$as_me: caught signal $ac_signal" + echo "$as_me: exit $exit_status" + } >&5 + rm -f core *.core && + rm -rf conftest* confdefs* conf$$* $ac_clean_files && + exit $exit_status + ' 0 +for ac_signal in 1 2 13 15; do + trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal +done +ac_signal=0 + +# confdefs.h avoids OS command line length limits that DEFS can exceed. +rm -rf conftest* confdefs.h +# AIX cpp loses on an empty file, so make sure it contains at least a newline. +echo >confdefs.h + +# Predefined preprocessor variables. + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_NAME "$PACKAGE_NAME" +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_TARNAME "$PACKAGE_TARNAME" +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_VERSION "$PACKAGE_VERSION" +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_STRING "$PACKAGE_STRING" +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" +_ACEOF + + +# Let the site file select an alternate cache file if it wants to. +# Prefer explicitly selected file to automatically selected ones. +if test -z "$CONFIG_SITE"; then + if test "x$prefix" != xNONE; then + CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" + else + CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" + fi +fi +for ac_site_file in $CONFIG_SITE; do + if test -r "$ac_site_file"; then + { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5 +echo "$as_me: loading site script $ac_site_file" >&6;} + sed 's/^/| /' "$ac_site_file" >&5 + . "$ac_site_file" + fi +done + +if test -r "$cache_file"; then + # Some versions of bash will fail to source /dev/null (special + # files actually), so we avoid doing that. + if test -f "$cache_file"; then + { echo "$as_me:$LINENO: loading cache $cache_file" >&5 +echo "$as_me: loading cache $cache_file" >&6;} + case $cache_file in + [\\/]* | ?:[\\/]* ) . $cache_file;; + *) . ./$cache_file;; + esac + fi +else + { echo "$as_me:$LINENO: creating cache $cache_file" >&5 +echo "$as_me: creating cache $cache_file" >&6;} + >$cache_file +fi + +# Check that the precious variables saved in the cache have kept the same +# value. +ac_cache_corrupted=false +for ac_var in `(set) 2>&1 | + sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do + eval ac_old_set=\$ac_cv_env_${ac_var}_set + eval ac_new_set=\$ac_env_${ac_var}_set + eval ac_old_val="\$ac_cv_env_${ac_var}_value" + eval ac_new_val="\$ac_env_${ac_var}_value" + case $ac_old_set,$ac_new_set in + set,) + { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 +echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,set) + { echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5 +echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,);; + *) + if test "x$ac_old_val" != "x$ac_new_val"; then + { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5 +echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} + { echo "$as_me:$LINENO: former value: $ac_old_val" >&5 +echo "$as_me: former value: $ac_old_val" >&2;} + { echo "$as_me:$LINENO: current value: $ac_new_val" >&5 +echo "$as_me: current value: $ac_new_val" >&2;} + ac_cache_corrupted=: + fi;; + esac + # Pass precious variables to config.status. + if test "$ac_new_set" = set; then + case $ac_new_val in + *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*) + ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; + *) ac_arg=$ac_var=$ac_new_val ;; + esac + case " $ac_configure_args " in + *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. + *) ac_configure_args="$ac_configure_args '$ac_arg'" ;; + esac + fi +done +if $ac_cache_corrupted; then + { echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5 +echo "$as_me: error: changes in the environment can compromise the build" >&2;} + { { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5 +echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;} + { (exit 1); exit 1; }; } +fi + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + + + + + + + + + + + + + + + + + + + + + + + + + + +am__api_version="1.9" +ac_aux_dir= +for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do + if test -f $ac_dir/install-sh; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install-sh -c" + break + elif test -f $ac_dir/install.sh; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install.sh -c" + break + elif test -f $ac_dir/shtool; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/shtool install -c" + break + fi +done +if test -z "$ac_aux_dir"; then + { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&5 +echo "$as_me: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&2;} + { (exit 1); exit 1; }; } +fi +ac_config_guess="$SHELL $ac_aux_dir/config.guess" +ac_config_sub="$SHELL $ac_aux_dir/config.sub" +ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure. + +# Find a good install program. We prefer a C program (faster), +# so one script is as good as another. But avoid the broken or +# incompatible versions: +# SysV /etc/install, /usr/sbin/install +# SunOS /usr/etc/install +# IRIX /sbin/install +# AIX /bin/install +# AmigaOS /C/install, which installs bootblocks on floppy discs +# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag +# AFS /usr/afsws/bin/install, which mishandles nonexistent args +# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" +# OS/2's system install, which has a completely different semantic +# ./install, which can be erroneously created by make from ./install.sh. +echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5 +echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6 +if test -z "$INSTALL"; then +if test "${ac_cv_path_install+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + # Account for people who put trailing slashes in PATH elements. +case $as_dir/ in + ./ | .// | /cC/* | \ + /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ + ?:\\/os2\\/install\\/* | ?:\\/OS2\\/INSTALL\\/* | \ + /usr/ucb/* ) ;; + *) + # OSF1 and SCO ODT 3.0 have their own names for install. + # Don't use installbsd from OSF since it installs stuff as root + # by default. + for ac_prog in ginstall scoinst install; do + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then + if test $ac_prog = install && + grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + # AIX install. It has an incompatible calling convention. + : + elif test $ac_prog = install && + grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + # program-specific install script used by HP pwplus--don't use. + : + else + ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" + break 3 + fi + fi + done + done + ;; +esac +done + + +fi + if test "${ac_cv_path_install+set}" = set; then + INSTALL=$ac_cv_path_install + else + # As a last resort, use the slow shell script. We don't cache a + # path for INSTALL within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the path is relative. + INSTALL=$ac_install_sh + fi +fi +echo "$as_me:$LINENO: result: $INSTALL" >&5 +echo "${ECHO_T}$INSTALL" >&6 + +# Use test -z because SunOS4 sh mishandles braces in ${var-val}. +# It thinks the first close brace ends the variable substitution. +test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' + +test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' + +test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' + +echo "$as_me:$LINENO: checking whether build environment is sane" >&5 +echo $ECHO_N "checking whether build environment is sane... $ECHO_C" >&6 +# Just in case +sleep 1 +echo timestamp > conftest.file +# Do `set' in a subshell so we don't clobber the current shell's +# arguments. Must try -L first in case configure is actually a +# symlink; some systems play weird games with the mod time of symlinks +# (eg FreeBSD returns the mod time of the symlink's containing +# directory). +if ( + set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null` + if test "$*" = "X"; then + # -L didn't work. + set X `ls -t $srcdir/configure conftest.file` + fi + rm -f conftest.file + if test "$*" != "X $srcdir/configure conftest.file" \ + && test "$*" != "X conftest.file $srcdir/configure"; then + + # If neither matched, then we have a broken ls. This can happen + # if, for instance, CONFIG_SHELL is bash and it inherits a + # broken ls alias from the environment. This has actually + # happened. Such a system could not be considered "sane". + { { echo "$as_me:$LINENO: error: ls -t appears to fail. Make sure there is not a broken +alias in your environment" >&5 +echo "$as_me: error: ls -t appears to fail. Make sure there is not a broken +alias in your environment" >&2;} + { (exit 1); exit 1; }; } + fi + + test "$2" = conftest.file + ) +then + # Ok. + : +else + { { echo "$as_me:$LINENO: error: newly created file is older than distributed files! +Check your system clock" >&5 +echo "$as_me: error: newly created file is older than distributed files! +Check your system clock" >&2;} + { (exit 1); exit 1; }; } +fi +echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 +test "$program_prefix" != NONE && + program_transform_name="s,^,$program_prefix,;$program_transform_name" +# Use a double $ so make ignores it. +test "$program_suffix" != NONE && + program_transform_name="s,\$,$program_suffix,;$program_transform_name" +# Double any \ or $. echo might interpret backslashes. +# By default was `s,x,x', remove it if useless. +cat <<\_ACEOF >conftest.sed +s/[\\$]/&&/g;s/;s,x,x,$// +_ACEOF +program_transform_name=`echo $program_transform_name | sed -f conftest.sed` +rm conftest.sed + +# expand $ac_aux_dir to an absolute path +am_aux_dir=`cd $ac_aux_dir && pwd` + +test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing" +# Use eval to expand $SHELL +if eval "$MISSING --run true"; then + am_missing_run="$MISSING --run " +else + am_missing_run= + { echo "$as_me:$LINENO: WARNING: \`missing' script is too old or missing" >&5 +echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;} +fi + +if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then + # We used to keeping the `.' as first argument, in order to + # allow $(mkdir_p) to be used without argument. As in + # $(mkdir_p) $(somedir) + # where $(somedir) is conditionally defined. However this is wrong + # for two reasons: + # 1. if the package is installed by a user who cannot write `.' + # make install will fail, + # 2. the above comment should most certainly read + # $(mkdir_p) $(DESTDIR)$(somedir) + # so it does not work when $(somedir) is undefined and + # $(DESTDIR) is not. + # To support the latter case, we have to write + # test -z "$(somedir)" || $(mkdir_p) $(DESTDIR)$(somedir), + # so the `.' trick is pointless. + mkdir_p='mkdir -p --' +else + # On NextStep and OpenStep, the `mkdir' command does not + # recognize any option. It will interpret all options as + # directories to create, and then abort because `.' already + # exists. + for d in ./-p ./--version; + do + test -d $d && rmdir $d + done + # $(mkinstalldirs) is defined by Automake if mkinstalldirs exists. + if test -f "$ac_aux_dir/mkinstalldirs"; then + mkdir_p='$(mkinstalldirs)' + else + mkdir_p='$(install_sh) -d' + fi +fi + +for ac_prog in gawk mawk nawk awk +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_AWK+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$AWK"; then + ac_cv_prog_AWK="$AWK" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_AWK="$ac_prog" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +AWK=$ac_cv_prog_AWK +if test -n "$AWK"; then + echo "$as_me:$LINENO: result: $AWK" >&5 +echo "${ECHO_T}$AWK" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + test -n "$AWK" && break +done + +echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5 +echo $ECHO_N "checking whether ${MAKE-make} sets \$(MAKE)... $ECHO_C" >&6 +set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,:./+-,___p_,'` +if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.make <<\_ACEOF +all: + @echo 'ac_maketemp="$(MAKE)"' +_ACEOF +# GNU make sometimes prints "make[1]: Entering...", which would confuse us. +eval `${MAKE-make} -f conftest.make 2>/dev/null | grep temp=` +if test -n "$ac_maketemp"; then + eval ac_cv_prog_make_${ac_make}_set=yes +else + eval ac_cv_prog_make_${ac_make}_set=no +fi +rm -f conftest.make +fi +if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 + SET_MAKE= +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 + SET_MAKE="MAKE=${MAKE-make}" +fi + +rm -rf .tst 2>/dev/null +mkdir .tst 2>/dev/null +if test -d .tst; then + am__leading_dot=. +else + am__leading_dot=_ +fi +rmdir .tst 2>/dev/null + +# test to see if srcdir already configured +if test "`cd $srcdir && pwd`" != "`pwd`" && + test -f $srcdir/config.status; then + { { echo "$as_me:$LINENO: error: source directory already configured; run \"make distclean\" there first" >&5 +echo "$as_me: error: source directory already configured; run \"make distclean\" there first" >&2;} + { (exit 1); exit 1; }; } +fi + +# test whether we have cygpath +if test -z "$CYGPATH_W"; then + if (cygpath --version) >/dev/null 2>/dev/null; then + CYGPATH_W='cygpath -w' + else + CYGPATH_W=echo + fi +fi + + +# Define the identity of the package. + PACKAGE='fonttosfnt' + VERSION='1.0.2' + + +cat >>confdefs.h <<_ACEOF +#define PACKAGE "$PACKAGE" +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define VERSION "$VERSION" +_ACEOF + +# Some tools Automake needs. + +ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"} + + +AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"} + + +AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"} + + +AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"} + + +MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} + +install_sh=${install_sh-"$am_aux_dir/install-sh"} + +# Installed binaries are usually stripped using `strip' when the user +# run `make install-strip'. However `strip' might not be the right +# tool to use in cross-compilation environments, therefore Automake +# will honor the `STRIP' environment variable to overrule this program. +if test "$cross_compiling" != no; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. +set dummy ${ac_tool_prefix}strip; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_STRIP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$STRIP"; then + ac_cv_prog_STRIP="$STRIP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_STRIP="${ac_tool_prefix}strip" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +STRIP=$ac_cv_prog_STRIP +if test -n "$STRIP"; then + echo "$as_me:$LINENO: result: $STRIP" >&5 +echo "${ECHO_T}$STRIP" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + +fi +if test -z "$ac_cv_prog_STRIP"; then + ac_ct_STRIP=$STRIP + # Extract the first word of "strip", so it can be a program name with args. +set dummy strip; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_STRIP"; then + ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_STRIP="strip" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + + test -z "$ac_cv_prog_ac_ct_STRIP" && ac_cv_prog_ac_ct_STRIP=":" +fi +fi +ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP +if test -n "$ac_ct_STRIP"; then + echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5 +echo "${ECHO_T}$ac_ct_STRIP" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + STRIP=$ac_ct_STRIP +else + STRIP="$ac_cv_prog_STRIP" +fi + +fi +INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s" + +# We need awk for the "check" target. The system "awk" is bad on +# some platforms. +# Always define AMTAR for backward compatibility. + +AMTAR=${AMTAR-"${am_missing_run}tar"} + +am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -' + + + + + +echo "$as_me:$LINENO: checking whether to enable maintainer-specific portions of Makefiles" >&5 +echo $ECHO_N "checking whether to enable maintainer-specific portions of Makefiles... $ECHO_C" >&6 + # Check whether --enable-maintainer-mode or --disable-maintainer-mode was given. +if test "${enable_maintainer_mode+set}" = set; then + enableval="$enable_maintainer_mode" + USE_MAINTAINER_MODE=$enableval +else + USE_MAINTAINER_MODE=no +fi; + echo "$as_me:$LINENO: result: $USE_MAINTAINER_MODE" >&5 +echo "${ECHO_T}$USE_MAINTAINER_MODE" >&6 + + +if test $USE_MAINTAINER_MODE = yes; then + MAINTAINER_MODE_TRUE= + MAINTAINER_MODE_FALSE='#' +else + MAINTAINER_MODE_TRUE='#' + MAINTAINER_MODE_FALSE= +fi + + MAINT=$MAINTAINER_MODE_TRUE + + + + ac_config_headers="$ac_config_headers config.h" + + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. +set dummy ${ac_tool_prefix}gcc; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="${ac_tool_prefix}gcc" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + +fi +if test -z "$ac_cv_prog_CC"; then + ac_ct_CC=$CC + # Extract the first word of "gcc", so it can be a program name with args. +set dummy gcc; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_ac_ct_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CC="gcc" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 +echo "${ECHO_T}$ac_ct_CC" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + CC=$ac_ct_CC +else + CC="$ac_cv_prog_CC" +fi + +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. +set dummy ${ac_tool_prefix}cc; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="${ac_tool_prefix}cc" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + +fi +if test -z "$ac_cv_prog_CC"; then + ac_ct_CC=$CC + # Extract the first word of "cc", so it can be a program name with args. +set dummy cc; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_ac_ct_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CC="cc" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 +echo "${ECHO_T}$ac_ct_CC" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + CC=$ac_ct_CC +else + CC="$ac_cv_prog_CC" +fi + +fi +if test -z "$CC"; then + # Extract the first word of "cc", so it can be a program name with args. +set dummy cc; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + ac_prog_rejected=no +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then + ac_prog_rejected=yes + continue + fi + ac_cv_prog_CC="cc" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +if test $ac_prog_rejected = yes; then + # We found a bogon in the path, so make sure we never use it. + set dummy $ac_cv_prog_CC + shift + if test $# != 0; then + # We chose a different compiler from the bogus one. + # However, it has the same basename, so the bogon will be chosen + # first if we set CC to just the basename; use the full file name. + shift + ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" + fi +fi +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + +fi +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + for ac_prog in cl + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="$ac_tool_prefix$ac_prog" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + test -n "$CC" && break + done +fi +if test -z "$CC"; then + ac_ct_CC=$CC + for ac_prog in cl +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_ac_ct_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CC="$ac_prog" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 +echo "${ECHO_T}$ac_ct_CC" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + test -n "$ac_ct_CC" && break +done + + CC=$ac_ct_CC +fi + +fi + + +test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH +See \`config.log' for more details." >&5 +echo "$as_me: error: no acceptable C compiler found in \$PATH +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } + +# Provide some information about the compiler. +echo "$as_me:$LINENO:" \ + "checking for C compiler version" >&5 +ac_compiler=`set X $ac_compile; echo $2` +{ (eval echo "$as_me:$LINENO: \"$ac_compiler --version &5\"") >&5 + (eval $ac_compiler --version &5) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } +{ (eval echo "$as_me:$LINENO: \"$ac_compiler -v &5\"") >&5 + (eval $ac_compiler -v &5) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } +{ (eval echo "$as_me:$LINENO: \"$ac_compiler -V &5\"") >&5 + (eval $ac_compiler -V &5) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } + +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +ac_clean_files_save=$ac_clean_files +ac_clean_files="$ac_clean_files a.out a.exe b.out" +# Try to create an executable without -o first, disregard a.out. +# It will help us diagnose broken compilers, and finding out an intuition +# of exeext. +echo "$as_me:$LINENO: checking for C compiler default output file name" >&5 +echo $ECHO_N "checking for C compiler default output file name... $ECHO_C" >&6 +ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` +if { (eval echo "$as_me:$LINENO: \"$ac_link_default\"") >&5 + (eval $ac_link_default) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + # Find the output, starting from the most likely. This scheme is +# not robust to junk in `.', hence go to wildcards (a.*) only as a last +# resort. + +# Be careful to initialize this variable, since it used to be cached. +# Otherwise an old cache value of `no' led to `EXEEXT = no' in a Makefile. +ac_cv_exeext= +# b.out is created by i960 compilers. +for ac_file in a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out +do + test -f "$ac_file" || continue + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) + ;; + conftest.$ac_ext ) + # This is the source file. + ;; + [ab].out ) + # We found the default executable, but exeext='' is most + # certainly right. + break;; + *.* ) + ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + # FIXME: I believe we export ac_cv_exeext for Libtool, + # but it would be cool to find out if it's true. Does anybody + # maintain Libtool? --akim. + export ac_cv_exeext + break;; + * ) + break;; + esac +done +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +{ { echo "$as_me:$LINENO: error: C compiler cannot create executables +See \`config.log' for more details." >&5 +echo "$as_me: error: C compiler cannot create executables +See \`config.log' for more details." >&2;} + { (exit 77); exit 77; }; } +fi + +ac_exeext=$ac_cv_exeext +echo "$as_me:$LINENO: result: $ac_file" >&5 +echo "${ECHO_T}$ac_file" >&6 + +# Check the compiler produces executables we can run. If not, either +# the compiler is broken, or we cross compile. +echo "$as_me:$LINENO: checking whether the C compiler works" >&5 +echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6 +# FIXME: These cross compiler hacks should be removed for Autoconf 3.0 +# If not cross compiling, check that we can run a simple program. +if test "$cross_compiling" != yes; then + if { ac_try='./$ac_file' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + cross_compiling=no + else + if test "$cross_compiling" = maybe; then + cross_compiling=yes + else + { { echo "$as_me:$LINENO: error: cannot run C compiled programs. +If you meant to cross compile, use \`--host'. +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot run C compiled programs. +If you meant to cross compile, use \`--host'. +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } + fi + fi +fi +echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 + +rm -f a.out a.exe conftest$ac_cv_exeext b.out +ac_clean_files=$ac_clean_files_save +# Check the compiler produces executables we can run. If not, either +# the compiler is broken, or we cross compile. +echo "$as_me:$LINENO: checking whether we are cross compiling" >&5 +echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6 +echo "$as_me:$LINENO: result: $cross_compiling" >&5 +echo "${ECHO_T}$cross_compiling" >&6 + +echo "$as_me:$LINENO: checking for suffix of executables" >&5 +echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6 +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + # If both `conftest.exe' and `conftest' are `present' (well, observable) +# catch `conftest.exe'. For instance with Cygwin, `ls conftest' will +# work properly (i.e., refer to `conftest.exe'), while it won't with +# `rm'. +for ac_file in conftest.exe conftest conftest.*; do + test -f "$ac_file" || continue + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) ;; + *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + export ac_cv_exeext + break;; + * ) break;; + esac +done +else + { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot compute suffix of executables: cannot compile and link +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } +fi + +rm -f conftest$ac_cv_exeext +echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5 +echo "${ECHO_T}$ac_cv_exeext" >&6 + +rm -f conftest.$ac_ext +EXEEXT=$ac_cv_exeext +ac_exeext=$EXEEXT +echo "$as_me:$LINENO: checking for suffix of object files" >&5 +echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6 +if test "${ac_cv_objext+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.o conftest.obj +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg ) ;; + *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` + break;; + esac +done +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +{ { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot compute suffix of object files: cannot compile +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } +fi + +rm -f conftest.$ac_cv_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_objext" >&5 +echo "${ECHO_T}$ac_cv_objext" >&6 +OBJEXT=$ac_cv_objext +ac_objext=$OBJEXT +echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 +echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6 +if test "${ac_cv_c_compiler_gnu+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ +#ifndef __GNUC__ + choke me +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_compiler_gnu=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_compiler_gnu=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +ac_cv_c_compiler_gnu=$ac_compiler_gnu + +fi +echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 +echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6 +GCC=`test $ac_compiler_gnu = yes && echo yes` +ac_test_CFLAGS=${CFLAGS+set} +ac_save_CFLAGS=$CFLAGS +CFLAGS="-g" +echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 +echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6 +if test "${ac_cv_prog_cc_g+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_prog_cc_g=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_prog_cc_g=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 +echo "${ECHO_T}$ac_cv_prog_cc_g" >&6 +if test "$ac_test_CFLAGS" = set; then + CFLAGS=$ac_save_CFLAGS +elif test $ac_cv_prog_cc_g = yes; then + if test "$GCC" = yes; then + CFLAGS="-g -O2" + else + CFLAGS="-g" + fi +else + if test "$GCC" = yes; then + CFLAGS="-O2" + else + CFLAGS= + fi +fi +echo "$as_me:$LINENO: checking for $CC option to accept ANSI C" >&5 +echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6 +if test "${ac_cv_prog_cc_stdc+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_prog_cc_stdc=no +ac_save_CC=$CC +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +#include +#include +#include +/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ +struct buf { int x; }; +FILE * (*rcsopen) (struct buf *, struct stat *, int); +static char *e (p, i) + char **p; + int i; +{ + return p[i]; +} +static char *f (char * (*g) (char **, int), char **p, ...) +{ + char *s; + va_list v; + va_start (v,p); + s = g (p, va_arg (v,int)); + va_end (v); + return s; +} + +/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has + function prototypes and stuff, but not '\xHH' hex character constants. + These don't provoke an error unfortunately, instead are silently treated + as 'x'. The following induces an error, until -std1 is added to get + proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an + array size at least. It's necessary to write '\x00'==0 to get something + that's true only with -std1. */ +int osf4_cc_array ['\x00' == 0 ? 1 : -1]; + +int test (int i, double x); +struct s1 {int (*f) (int a);}; +struct s2 {int (*f) (double a);}; +int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); +int argc; +char **argv; +int +main () +{ +return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; + ; + return 0; +} +_ACEOF +# Don't try gcc -ansi; that turns off useful extensions and +# breaks some systems' header files. +# AIX -qlanglvl=ansi +# Ultrix and OSF/1 -std1 +# HP-UX 10.20 and later -Ae +# HP-UX older versions -Aa -D_HPUX_SOURCE +# SVR4 -Xc -D__EXTENSIONS__ +for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" +do + CC="$ac_save_CC $ac_arg" + rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_prog_cc_stdc=$ac_arg +break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.err conftest.$ac_objext +done +rm -f conftest.$ac_ext conftest.$ac_objext +CC=$ac_save_CC + +fi + +case "x$ac_cv_prog_cc_stdc" in + x|xno) + echo "$as_me:$LINENO: result: none needed" >&5 +echo "${ECHO_T}none needed" >&6 ;; + *) + echo "$as_me:$LINENO: result: $ac_cv_prog_cc_stdc" >&5 +echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6 + CC="$CC $ac_cv_prog_cc_stdc" ;; +esac + +# Some people use a C++ compiler to compile C. Since we use `exit', +# in C++ we need to declare it. In case someone uses the same compiler +# for both compiling C and C++ we need to have the C++ compiler decide +# the declaration of exit, since it's the most demanding environment. +cat >conftest.$ac_ext <<_ACEOF +#ifndef __cplusplus + choke me +#endif +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + for ac_declaration in \ + '' \ + 'extern "C" void std::exit (int) throw (); using std::exit;' \ + 'extern "C" void std::exit (int); using std::exit;' \ + 'extern "C" void exit (int) throw ();' \ + 'extern "C" void exit (int);' \ + 'void exit (int);' +do + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_declaration +#include +int +main () +{ +exit (42); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + : +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +continue +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_declaration +int +main () +{ +exit (42); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +done +rm -f conftest* +if test -n "$ac_declaration"; then + echo '#ifdef __cplusplus' >>confdefs.h + echo $ac_declaration >>confdefs.h + echo '#endif' >>confdefs.h +fi + +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +DEPDIR="${am__leading_dot}deps" + + ac_config_commands="$ac_config_commands depfiles" + + +am_make=${MAKE-make} +cat > confinc << 'END' +am__doit: + @echo done +.PHONY: am__doit +END +# If we don't find an include directive, just comment out the code. +echo "$as_me:$LINENO: checking for style of include used by $am_make" >&5 +echo $ECHO_N "checking for style of include used by $am_make... $ECHO_C" >&6 +am__include="#" +am__quote= +_am_result=none +# First try GNU make style include. +echo "include confinc" > confmf +# We grep out `Entering directory' and `Leaving directory' +# messages which can occur if `w' ends up in MAKEFLAGS. +# In particular we don't look at `^make:' because GNU make might +# be invoked under some other name (usually "gmake"), in which +# case it prints its new name instead of `make'. +if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then + am__include=include + am__quote= + _am_result=GNU +fi +# Now try BSD make style include. +if test "$am__include" = "#"; then + echo '.include "confinc"' > confmf + if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then + am__include=.include + am__quote="\"" + _am_result=BSD + fi +fi + + +echo "$as_me:$LINENO: result: $_am_result" >&5 +echo "${ECHO_T}$_am_result" >&6 +rm -f confinc confmf + +# Check whether --enable-dependency-tracking or --disable-dependency-tracking was given. +if test "${enable_dependency_tracking+set}" = set; then + enableval="$enable_dependency_tracking" + +fi; +if test "x$enable_dependency_tracking" != xno; then + am_depcomp="$ac_aux_dir/depcomp" + AMDEPBACKSLASH='\' +fi + + +if test "x$enable_dependency_tracking" != xno; then + AMDEP_TRUE= + AMDEP_FALSE='#' +else + AMDEP_TRUE='#' + AMDEP_FALSE= +fi + + + + +depcc="$CC" am_compiler_list= + +echo "$as_me:$LINENO: checking dependency style of $depcc" >&5 +echo $ECHO_N "checking dependency style of $depcc... $ECHO_C" >&6 +if test "${am_cv_CC_dependencies_compiler_type+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then + # We make a subdir and do the tests there. Otherwise we can end up + # making bogus files that we don't know about and never remove. For + # instance it was reported that on HP-UX the gcc test will end up + # making a dummy file named `D' -- because `-MD' means `put the output + # in D'. + mkdir conftest.dir + # Copy depcomp to subdir because otherwise we won't find it if we're + # using a relative directory. + cp "$am_depcomp" conftest.dir + cd conftest.dir + # We will build objects and dependencies in a subdirectory because + # it helps to detect inapplicable dependency modes. For instance + # both Tru64's cc and ICC support -MD to output dependencies as a + # side effect of compilation, but ICC will put the dependencies in + # the current directory while Tru64 will put them in the object + # directory. + mkdir sub + + am_cv_CC_dependencies_compiler_type=none + if test "$am_compiler_list" = ""; then + am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` + fi + for depmode in $am_compiler_list; do + # Setup a source with many dependencies, because some compilers + # like to wrap large dependency lists on column 80 (with \), and + # we should not choose a depcomp mode which is confused by this. + # + # We need to recreate these files for each test, as the compiler may + # overwrite some of them when testing with obscure command lines. + # This happens at least with the AIX C compiler. + : > sub/conftest.c + for i in 1 2 3 4 5 6; do + echo '#include "conftst'$i'.h"' >> sub/conftest.c + # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with + # Solaris 8's {/usr,}/bin/sh. + touch sub/conftst$i.h + done + echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf + + case $depmode in + nosideeffect) + # after this tag, mechanisms are not by side-effect, so they'll + # only be used when explicitly requested + if test "x$enable_dependency_tracking" = xyes; then + continue + else + break + fi + ;; + none) break ;; + esac + # We check with `-c' and `-o' for the sake of the "dashmstdout" + # mode. It turns out that the SunPro C++ compiler does not properly + # handle `-M -o', and we need to detect this. + if depmode=$depmode \ + source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \ + depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ + $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \ + >/dev/null 2>conftest.err && + grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && + grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 && + ${MAKE-make} -s -f confmf > /dev/null 2>&1; then + # icc doesn't choke on unknown options, it will just issue warnings + # or remarks (even with -Werror). So we grep stderr for any message + # that says an option was ignored or not supported. + # When given -MP, icc 7.0 and 7.1 complain thusly: + # icc: Command line warning: ignoring option '-M'; no argument required + # The diagnosis changed in icc 8.0: + # icc: Command line remark: option '-MP' not supported + if (grep 'ignoring option' conftest.err || + grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else + am_cv_CC_dependencies_compiler_type=$depmode + break + fi + fi + done + + cd .. + rm -rf conftest.dir +else + am_cv_CC_dependencies_compiler_type=none +fi + +fi +echo "$as_me:$LINENO: result: $am_cv_CC_dependencies_compiler_type" >&5 +echo "${ECHO_T}$am_cv_CC_dependencies_compiler_type" >&6 +CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type + + + +if + test "x$enable_dependency_tracking" != xno \ + && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then + am__fastdepCC_TRUE= + am__fastdepCC_FALSE='#' +else + am__fastdepCC_TRUE='#' + am__fastdepCC_FALSE= +fi + + +# Find a good install program. We prefer a C program (faster), +# so one script is as good as another. But avoid the broken or +# incompatible versions: +# SysV /etc/install, /usr/sbin/install +# SunOS /usr/etc/install +# IRIX /sbin/install +# AIX /bin/install +# AmigaOS /C/install, which installs bootblocks on floppy discs +# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag +# AFS /usr/afsws/bin/install, which mishandles nonexistent args +# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" +# OS/2's system install, which has a completely different semantic +# ./install, which can be erroneously created by make from ./install.sh. +echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5 +echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6 +if test -z "$INSTALL"; then +if test "${ac_cv_path_install+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + # Account for people who put trailing slashes in PATH elements. +case $as_dir/ in + ./ | .// | /cC/* | \ + /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ + ?:\\/os2\\/install\\/* | ?:\\/OS2\\/INSTALL\\/* | \ + /usr/ucb/* ) ;; + *) + # OSF1 and SCO ODT 3.0 have their own names for install. + # Don't use installbsd from OSF since it installs stuff as root + # by default. + for ac_prog in ginstall scoinst install; do + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then + if test $ac_prog = install && + grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + # AIX install. It has an incompatible calling convention. + : + elif test $ac_prog = install && + grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + # program-specific install script used by HP pwplus--don't use. + : + else + ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" + break 3 + fi + fi + done + done + ;; +esac +done + + +fi + if test "${ac_cv_path_install+set}" = set; then + INSTALL=$ac_cv_path_install + else + # As a last resort, use the slow shell script. We don't cache a + # path for INSTALL within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the path is relative. + INSTALL=$ac_install_sh + fi +fi +echo "$as_me:$LINENO: result: $INSTALL" >&5 +echo "${ECHO_T}$INSTALL" >&6 + +# Use test -z because SunOS4 sh mishandles braces in ${var-val}. +# It thinks the first close brace ends the variable substitution. +test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' + +test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' + +test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' + + + +echo "$as_me:$LINENO: checking for setenv" >&5 +echo $ECHO_N "checking for setenv... $ECHO_C" >&6 +if test "${ac_cv_func_setenv+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +/* Define setenv to an innocuous variant, in case declares setenv. + For example, HP-UX 11i declares gettimeofday. */ +#define setenv innocuous_setenv + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char setenv (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef setenv + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +{ +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char setenv (); +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_setenv) || defined (__stub___setenv) +choke me +#else +char (*f) () = setenv; +#endif +#ifdef __cplusplus +} +#endif + +int +main () +{ +return f != setenv; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_func_setenv=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_func_setenv=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_func_setenv" >&5 +echo "${ECHO_T}$ac_cv_func_setenv" >&6 +if test $ac_cv_func_setenv = yes; then + have_setenv=yes +else + have_setenv=no +fi + + + + +if test x$have_setenv = xno; then + NEED_SETENV_TRUE= + NEED_SETENV_FALSE='#' +else + NEED_SETENV_TRUE='#' + NEED_SETENV_FALSE= +fi + + +# Checks for pkg-config packages + + +if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args. +set dummy ${ac_tool_prefix}pkg-config; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_path_PKG_CONFIG+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + case $PKG_CONFIG in + [\\/]* | ?:[\\/]*) + ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + + ;; +esac +fi +PKG_CONFIG=$ac_cv_path_PKG_CONFIG + +if test -n "$PKG_CONFIG"; then + echo "$as_me:$LINENO: result: $PKG_CONFIG" >&5 +echo "${ECHO_T}$PKG_CONFIG" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + +fi +if test -z "$ac_cv_path_PKG_CONFIG"; then + ac_pt_PKG_CONFIG=$PKG_CONFIG + # Extract the first word of "pkg-config", so it can be a program name with args. +set dummy pkg-config; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_path_ac_pt_PKG_CONFIG+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + case $ac_pt_PKG_CONFIG in + [\\/]* | ?:[\\/]*) + ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_ac_pt_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + + ;; +esac +fi +ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG + +if test -n "$ac_pt_PKG_CONFIG"; then + echo "$as_me:$LINENO: result: $ac_pt_PKG_CONFIG" >&5 +echo "${ECHO_T}$ac_pt_PKG_CONFIG" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + PKG_CONFIG=$ac_pt_PKG_CONFIG +else + PKG_CONFIG="$ac_cv_path_PKG_CONFIG" +fi + +fi +if test -n "$PKG_CONFIG"; then + _pkg_min_version=0.9.0 + echo "$as_me:$LINENO: checking pkg-config is at least version $_pkg_min_version" >&5 +echo $ECHO_N "checking pkg-config is at least version $_pkg_min_version... $ECHO_C" >&6 + if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 + else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 + PKG_CONFIG="" + fi + +fi + +pkg_failed=no +echo "$as_me:$LINENO: checking for FONTTOSFNT" >&5 +echo $ECHO_N "checking for FONTTOSFNT... $ECHO_C" >&6 + +if test -n "$PKG_CONFIG"; then + if test -n "$FONTTOSFNT_CFLAGS"; then + pkg_cv_FONTTOSFNT_CFLAGS="$FONTTOSFNT_CFLAGS" + else + if test -n "$PKG_CONFIG" && \ + { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"xproto freetype2 fontenc\"") >&5 + ($PKG_CONFIG --exists --print-errors "xproto freetype2 fontenc") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + pkg_cv_FONTTOSFNT_CFLAGS=`$PKG_CONFIG --cflags "xproto freetype2 fontenc" 2>/dev/null` +else + pkg_failed=yes +fi + fi +else + pkg_failed=untried +fi +if test -n "$PKG_CONFIG"; then + if test -n "$FONTTOSFNT_LIBS"; then + pkg_cv_FONTTOSFNT_LIBS="$FONTTOSFNT_LIBS" + else + if test -n "$PKG_CONFIG" && \ + { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"xproto freetype2 fontenc\"") >&5 + ($PKG_CONFIG --exists --print-errors "xproto freetype2 fontenc") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + pkg_cv_FONTTOSFNT_LIBS=`$PKG_CONFIG --libs "xproto freetype2 fontenc" 2>/dev/null` +else + pkg_failed=yes +fi + fi +else + pkg_failed=untried +fi + + + +if test $pkg_failed = yes; then + +if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then + _pkg_short_errors_supported=yes +else + _pkg_short_errors_supported=no +fi + if test $_pkg_short_errors_supported = yes; then + FONTTOSFNT_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "xproto freetype2 fontenc"` + else + FONTTOSFNT_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "xproto freetype2 fontenc"` + fi + # Put the nasty error message in config.log where it belongs + echo "$FONTTOSFNT_PKG_ERRORS" >&5 + + { { echo "$as_me:$LINENO: error: Package requirements (xproto freetype2 fontenc) were not met: + +$FONTTOSFNT_PKG_ERRORS + +Consider adjusting the PKG_CONFIG_PATH environment variable if you +installed software in a non-standard prefix. + +Alternatively, you may set the environment variables FONTTOSFNT_CFLAGS +and FONTTOSFNT_LIBS to avoid the need to call pkg-config. +See the pkg-config man page for more details. +" >&5 +echo "$as_me: error: Package requirements (xproto freetype2 fontenc) were not met: + +$FONTTOSFNT_PKG_ERRORS + +Consider adjusting the PKG_CONFIG_PATH environment variable if you +installed software in a non-standard prefix. + +Alternatively, you may set the environment variables FONTTOSFNT_CFLAGS +and FONTTOSFNT_LIBS to avoid the need to call pkg-config. +See the pkg-config man page for more details. +" >&2;} + { (exit 1); exit 1; }; } +elif test $pkg_failed = untried; then + { { echo "$as_me:$LINENO: error: The pkg-config script could not be found or is too old. Make sure it +is in your PATH or set the PKG_CONFIG environment variable to the full +path to pkg-config. + +Alternatively, you may set the environment variables FONTTOSFNT_CFLAGS +and FONTTOSFNT_LIBS to avoid the need to call pkg-config. +See the pkg-config man page for more details. + +To get pkg-config, see . +See \`config.log' for more details." >&5 +echo "$as_me: error: The pkg-config script could not be found or is too old. Make sure it +is in your PATH or set the PKG_CONFIG environment variable to the full +path to pkg-config. + +Alternatively, you may set the environment variables FONTTOSFNT_CFLAGS +and FONTTOSFNT_LIBS to avoid the need to call pkg-config. +See the pkg-config man page for more details. + +To get pkg-config, see . +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } +else + FONTTOSFNT_CFLAGS=$pkg_cv_FONTTOSFNT_CFLAGS + FONTTOSFNT_LIBS=$pkg_cv_FONTTOSFNT_LIBS + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 + : +fi + + + +# Make sure we can run config.sub. +$ac_config_sub sun4 >/dev/null 2>&1 || + { { echo "$as_me:$LINENO: error: cannot run $ac_config_sub" >&5 +echo "$as_me: error: cannot run $ac_config_sub" >&2;} + { (exit 1); exit 1; }; } + +echo "$as_me:$LINENO: checking build system type" >&5 +echo $ECHO_N "checking build system type... $ECHO_C" >&6 +if test "${ac_cv_build+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_build_alias=$build_alias +test -z "$ac_cv_build_alias" && + ac_cv_build_alias=`$ac_config_guess` +test -z "$ac_cv_build_alias" && + { { echo "$as_me:$LINENO: error: cannot guess build type; you must specify one" >&5 +echo "$as_me: error: cannot guess build type; you must specify one" >&2;} + { (exit 1); exit 1; }; } +ac_cv_build=`$ac_config_sub $ac_cv_build_alias` || + { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_build_alias failed" >&5 +echo "$as_me: error: $ac_config_sub $ac_cv_build_alias failed" >&2;} + { (exit 1); exit 1; }; } + +fi +echo "$as_me:$LINENO: result: $ac_cv_build" >&5 +echo "${ECHO_T}$ac_cv_build" >&6 +build=$ac_cv_build +build_cpu=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` +build_vendor=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` +build_os=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` + + +echo "$as_me:$LINENO: checking host system type" >&5 +echo $ECHO_N "checking host system type... $ECHO_C" >&6 +if test "${ac_cv_host+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_host_alias=$host_alias +test -z "$ac_cv_host_alias" && + ac_cv_host_alias=$ac_cv_build_alias +ac_cv_host=`$ac_config_sub $ac_cv_host_alias` || + { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_host_alias failed" >&5 +echo "$as_me: error: $ac_config_sub $ac_cv_host_alias failed" >&2;} + { (exit 1); exit 1; }; } + +fi +echo "$as_me:$LINENO: result: $ac_cv_host" >&5 +echo "${ECHO_T}$ac_cv_host" >&6 +host=$ac_cv_host +host_cpu=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` +host_vendor=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` +host_os=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` + + + + + +if test x$APP_MAN_SUFFIX = x ; then + APP_MAN_SUFFIX=1 +fi +if test x$APP_MAN_DIR = x ; then + APP_MAN_DIR='$(mandir)/man$(APP_MAN_SUFFIX)' +fi + +if test x$LIB_MAN_SUFFIX = x ; then + LIB_MAN_SUFFIX=3 +fi +if test x$LIB_MAN_DIR = x ; then + LIB_MAN_DIR='$(mandir)/man$(LIB_MAN_SUFFIX)' +fi + +if test x$FILE_MAN_SUFFIX = x ; then + case $host_os in + solaris*) FILE_MAN_SUFFIX=4 ;; + *) FILE_MAN_SUFFIX=5 ;; + esac +fi +if test x$FILE_MAN_DIR = x ; then + FILE_MAN_DIR='$(mandir)/man$(FILE_MAN_SUFFIX)' +fi + +if test x$MISC_MAN_SUFFIX = x ; then + case $host_os in + solaris*) MISC_MAN_SUFFIX=5 ;; + *) MISC_MAN_SUFFIX=7 ;; + esac +fi +if test x$MISC_MAN_DIR = x ; then + MISC_MAN_DIR='$(mandir)/man$(MISC_MAN_SUFFIX)' +fi + +if test x$DRIVER_MAN_SUFFIX = x ; then + case $host_os in + solaris*) DRIVER_MAN_SUFFIX=7 ;; + *) DRIVER_MAN_SUFFIX=4 ;; + esac +fi +if test x$DRIVER_MAN_DIR = x ; then + DRIVER_MAN_DIR='$(mandir)/man$(DRIVER_MAN_SUFFIX)' +fi + +if test x$ADMIN_MAN_SUFFIX = x ; then + case $host_os in + solaris*) ADMIN_MAN_SUFFIX=1m ;; + *) ADMIN_MAN_SUFFIX=8 ;; + esac +fi +if test x$ADMIN_MAN_DIR = x ; then + ADMIN_MAN_DIR='$(mandir)/man$(ADMIN_MAN_SUFFIX)' +fi + + + + + + + + + + + + + + + + + +# Check whether --with-release-version or --without-release-version was given. +if test "${with_release_version+set}" = set; then + withval="$with_release_version" + RELEASE_VERSION="$withval" +else + RELEASE_VERSION="" +fi; + if test "x$RELEASE_VERSION" != "x"; then + PACKAGE="$PACKAGE-$RELEASE_VERSION" + PACKAGE_TARNAME="$PACKAGE_TARNAME-$RELEASE_VERSION" + { echo "$as_me:$LINENO: Building with package name set to $PACKAGE" >&5 +echo "$as_me: Building with package name set to $PACKAGE" >&6;} + fi + + + ac_config_files="$ac_config_files Makefile" +cat >confcache <<\_ACEOF +# This file is a shell script that caches the results of configure +# tests run on this system so they can be shared between configure +# scripts and configure runs, see configure's option --config-cache. +# It is not useful on other systems. If it contains results you don't +# want to keep, you may remove or edit it. +# +# config.status only pays attention to the cache file if you give it +# the --recheck option to rerun configure. +# +# `ac_cv_env_foo' variables (set or unset) will be overridden when +# loading this file, other *unset* `ac_cv_foo' will be assigned the +# following values. + +_ACEOF + +# The following way of writing the cache mishandles newlines in values, +# but we know of no workaround that is simple, portable, and efficient. +# So, don't put newlines in cache variables' values. +# Ultrix sh set writes to stderr and can't be redirected directly, +# and sets the high bit in the cache file unless we assign to the vars. +{ + (set) 2>&1 | + case `(ac_space=' '; set | grep ac_space) 2>&1` in + *ac_space=\ *) + # `set' does not quote correctly, so add quotes (double-quote + # substitution turns \\\\ into \\, and sed turns \\ into \). + sed -n \ + "s/'/'\\\\''/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" + ;; + *) + # `set' quotes correctly as required by POSIX, so do not add quotes. + sed -n \ + "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" + ;; + esac; +} | + sed ' + t clear + : clear + s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ + t end + /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ + : end' >>confcache +if diff $cache_file confcache >/dev/null 2>&1; then :; else + if test -w $cache_file; then + test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file" + cat confcache >$cache_file + else + echo "not updating unwritable cache $cache_file" + fi +fi +rm -f confcache + +test "x$prefix" = xNONE && prefix=$ac_default_prefix +# Let make expand exec_prefix. +test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' + +# VPATH may cause trouble with some makes, so we remove $(srcdir), +# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and +# trailing colons and then remove the whole line if VPATH becomes empty +# (actually we leave an empty line to preserve line numbers). +if test "x$srcdir" = x.; then + ac_vpsub='/^[ ]*VPATH[ ]*=/{ +s/:*\$(srcdir):*/:/; +s/:*\${srcdir}:*/:/; +s/:*@srcdir@:*/:/; +s/^\([^=]*=[ ]*\):*/\1/; +s/:*$//; +s/^[^=]*=[ ]*$//; +}' +fi + +DEFS=-DHAVE_CONFIG_H + +ac_libobjs= +ac_ltlibobjs= +for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue + # 1. Remove the extension, and $U if already installed. + ac_i=`echo "$ac_i" | + sed 's/\$U\././;s/\.o$//;s/\.obj$//'` + # 2. Add them. + ac_libobjs="$ac_libobjs $ac_i\$U.$ac_objext" + ac_ltlibobjs="$ac_ltlibobjs $ac_i"'$U.lo' +done +LIBOBJS=$ac_libobjs + +LTLIBOBJS=$ac_ltlibobjs + + +if test -z "${MAINTAINER_MODE_TRUE}" && test -z "${MAINTAINER_MODE_FALSE}"; then + { { echo "$as_me:$LINENO: error: conditional \"MAINTAINER_MODE\" was never defined. +Usually this means the macro was only invoked conditionally." >&5 +echo "$as_me: error: conditional \"MAINTAINER_MODE\" was never defined. +Usually this means the macro was only invoked conditionally." >&2;} + { (exit 1); exit 1; }; } +fi +if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then + { { echo "$as_me:$LINENO: error: conditional \"AMDEP\" was never defined. +Usually this means the macro was only invoked conditionally." >&5 +echo "$as_me: error: conditional \"AMDEP\" was never defined. +Usually this means the macro was only invoked conditionally." >&2;} + { (exit 1); exit 1; }; } +fi +if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then + { { echo "$as_me:$LINENO: error: conditional \"am__fastdepCC\" was never defined. +Usually this means the macro was only invoked conditionally." >&5 +echo "$as_me: error: conditional \"am__fastdepCC\" was never defined. +Usually this means the macro was only invoked conditionally." >&2;} + { (exit 1); exit 1; }; } +fi +if test -z "${NEED_SETENV_TRUE}" && test -z "${NEED_SETENV_FALSE}"; then + { { echo "$as_me:$LINENO: error: conditional \"NEED_SETENV\" was never defined. +Usually this means the macro was only invoked conditionally." >&5 +echo "$as_me: error: conditional \"NEED_SETENV\" was never defined. +Usually this means the macro was only invoked conditionally." >&2;} + { (exit 1); exit 1; }; } +fi + +: ${CONFIG_STATUS=./config.status} +ac_clean_files_save=$ac_clean_files +ac_clean_files="$ac_clean_files $CONFIG_STATUS" +{ echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5 +echo "$as_me: creating $CONFIG_STATUS" >&6;} +cat >$CONFIG_STATUS <<_ACEOF +#! $SHELL +# Generated by $as_me. +# Run this file to recreate the current configuration. +# Compiler output produced by configure, useful for debugging +# configure, is in config.log if it exists. + +debug=false +ac_cs_recheck=false +ac_cs_silent=false +SHELL=\${CONFIG_SHELL-$SHELL} +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF +## --------------------- ## +## M4sh Initialization. ## +## --------------------- ## + +# Be Bourne compatible +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then + emulate sh + NULLCMD=: + # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' +elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then + set -o posix +fi +DUALCASE=1; export DUALCASE # for MKS sh + +# Support unset when possible. +if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then + as_unset=unset +else + as_unset=false +fi + + +# Work around bugs in pre-3.0 UWIN ksh. +$as_unset ENV MAIL MAILPATH +PS1='$ ' +PS2='> ' +PS4='+ ' + +# NLS nuisances. +for as_var in \ + LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ + LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ + LC_TELEPHONE LC_TIME +do + if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then + eval $as_var=C; export $as_var + else + $as_unset $as_var + fi +done + +# Required to use basename. +if expr a : '\(a\)' >/dev/null 2>&1; then + as_expr=expr +else + as_expr=false +fi + +if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then + as_basename=basename +else + as_basename=false +fi + + +# Name of the executable. +as_me=`$as_basename "$0" || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)$' \| \ + . : '\(.\)' 2>/dev/null || +echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; } + /^X\/\(\/\/\)$/{ s//\1/; q; } + /^X\/\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + + +# PATH needs CR, and LINENO needs CR and PATH. +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + echo "#! /bin/sh" >conf$$.sh + echo "exit 0" >>conf$$.sh + chmod +x conf$$.sh + if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then + PATH_SEPARATOR=';' + else + PATH_SEPARATOR=: + fi + rm -f conf$$.sh +fi + + + as_lineno_1=$LINENO + as_lineno_2=$LINENO + as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` + test "x$as_lineno_1" != "x$as_lineno_2" && + test "x$as_lineno_3" = "x$as_lineno_2" || { + # Find who we are. Look in the path if we contain no path at all + # relative or not. + case $0 in + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break +done + + ;; + esac + # We did not find ourselves, most probably we were run as `sh COMMAND' + # in which case we are not to be found in the path. + if test "x$as_myself" = x; then + as_myself=$0 + fi + if test ! -f "$as_myself"; then + { { echo "$as_me:$LINENO: error: cannot find myself; rerun with an absolute path" >&5 +echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2;} + { (exit 1); exit 1; }; } + fi + case $CONFIG_SHELL in + '') + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for as_base in sh bash ksh sh5; do + case $as_dir in + /*) + if ("$as_dir/$as_base" -c ' + as_lineno_1=$LINENO + as_lineno_2=$LINENO + as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` + test "x$as_lineno_1" != "x$as_lineno_2" && + test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then + $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; } + $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; } + CONFIG_SHELL=$as_dir/$as_base + export CONFIG_SHELL + exec "$CONFIG_SHELL" "$0" ${1+"$@"} + fi;; + esac + done +done +;; + esac + + # Create $as_me.lineno as a copy of $as_myself, but with $LINENO + # uniformly replaced by the line number. The first 'sed' inserts a + # line-number line before each line; the second 'sed' does the real + # work. The second script uses 'N' to pair each line-number line + # with the numbered line, and appends trailing '-' during + # substitution so that $LINENO is not a special case at line end. + # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the + # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-) + sed '=' <$as_myself | + sed ' + N + s,$,-, + : loop + s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3, + t loop + s,-$,, + s,^['$as_cr_digits']*\n,, + ' >$as_me.lineno && + chmod +x $as_me.lineno || + { { echo "$as_me:$LINENO: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&5 +echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2;} + { (exit 1); exit 1; }; } + + # Don't try to exec as it changes $[0], causing all sort of problems + # (the dirname of $[0] is not the place where we might find the + # original and so on. Autoconf is especially sensible to this). + . ./$as_me.lineno + # Exit status is that of the last command. + exit +} + + +case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in + *c*,-n*) ECHO_N= ECHO_C=' +' ECHO_T=' ' ;; + *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; + *) ECHO_N= ECHO_C='\c' ECHO_T= ;; +esac + +if expr a : '\(a\)' >/dev/null 2>&1; then + as_expr=expr +else + as_expr=false +fi + +rm -f conf$$ conf$$.exe conf$$.file +echo >conf$$.file +if ln -s conf$$.file conf$$ 2>/dev/null; then + # We could just check for DJGPP; but this test a) works b) is more generic + # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). + if test -f conf$$.exe; then + # Don't use ln at all; we don't have any links + as_ln_s='cp -p' + else + as_ln_s='ln -s' + fi +elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln +else + as_ln_s='cp -p' +fi +rm -f conf$$ conf$$.exe conf$$.file + +if mkdir -p . 2>/dev/null; then + as_mkdir_p=: +else + test -d ./-p && rmdir ./-p + as_mkdir_p=false +fi + +as_executable_p="test -f" + +# Sed expression to map a string onto a valid CPP name. +as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" + +# Sed expression to map a string onto a valid variable name. +as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" + + +# IFS +# We need space, tab and new line, in precisely that order. +as_nl=' +' +IFS=" $as_nl" + +# CDPATH. +$as_unset CDPATH + +exec 6>&1 + +# Open the log real soon, to keep \$[0] and so on meaningful, and to +# report actual input values of CONFIG_FILES etc. instead of their +# values after options handling. Logging --version etc. is OK. +exec 5>>config.log +{ + echo + sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX +## Running $as_me. ## +_ASBOX +} >&5 +cat >&5 <<_CSEOF + +This file was extended by fonttosfnt $as_me 1.0.2, which was +generated by GNU Autoconf 2.59. Invocation command line was + + CONFIG_FILES = $CONFIG_FILES + CONFIG_HEADERS = $CONFIG_HEADERS + CONFIG_LINKS = $CONFIG_LINKS + CONFIG_COMMANDS = $CONFIG_COMMANDS + $ $0 $@ + +_CSEOF +echo "on `(hostname || uname -n) 2>/dev/null | sed 1q`" >&5 +echo >&5 +_ACEOF + +# Files that config.status was made for. +if test -n "$ac_config_files"; then + echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS +fi + +if test -n "$ac_config_headers"; then + echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS +fi + +if test -n "$ac_config_links"; then + echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS +fi + +if test -n "$ac_config_commands"; then + echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS +fi + +cat >>$CONFIG_STATUS <<\_ACEOF + +ac_cs_usage="\ +\`$as_me' instantiates files from templates according to the +current configuration. + +Usage: $0 [OPTIONS] [FILE]... + + -h, --help print this help, then exit + -V, --version print version number, then exit + -q, --quiet do not print progress messages + -d, --debug don't remove temporary files + --recheck update $as_me by reconfiguring in the same conditions + --file=FILE[:TEMPLATE] + instantiate the configuration file FILE + --header=FILE[:TEMPLATE] + instantiate the configuration header FILE + +Configuration files: +$config_files + +Configuration headers: +$config_headers + +Configuration commands: +$config_commands + +Report bugs to ." +_ACEOF + +cat >>$CONFIG_STATUS <<_ACEOF +ac_cs_version="\\ +fonttosfnt config.status 1.0.2 +configured by $0, generated by GNU Autoconf 2.59, + with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\" + +Copyright (C) 2003 Free Software Foundation, Inc. +This config.status script is free software; the Free Software Foundation +gives unlimited permission to copy, distribute and modify it." +srcdir=$srcdir +INSTALL="$INSTALL" +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF +# If no file are specified by the user, then we need to provide default +# value. By we need to know if files were specified by the user. +ac_need_defaults=: +while test $# != 0 +do + case $1 in + --*=*) + ac_option=`expr "x$1" : 'x\([^=]*\)='` + ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'` + ac_shift=: + ;; + -*) + ac_option=$1 + ac_optarg=$2 + ac_shift=shift + ;; + *) # This is not an option, so the user has probably given explicit + # arguments. + ac_option=$1 + ac_need_defaults=false;; + esac + + case $ac_option in + # Handling of the options. +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF + -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) + ac_cs_recheck=: ;; + --version | --vers* | -V ) + echo "$ac_cs_version"; exit 0 ;; + --he | --h) + # Conflict between --help and --header + { { echo "$as_me:$LINENO: error: ambiguous option: $1 +Try \`$0 --help' for more information." >&5 +echo "$as_me: error: ambiguous option: $1 +Try \`$0 --help' for more information." >&2;} + { (exit 1); exit 1; }; };; + --help | --hel | -h ) + echo "$ac_cs_usage"; exit 0 ;; + --debug | --d* | -d ) + debug=: ;; + --file | --fil | --fi | --f ) + $ac_shift + CONFIG_FILES="$CONFIG_FILES $ac_optarg" + ac_need_defaults=false;; + --header | --heade | --head | --hea ) + $ac_shift + CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg" + ac_need_defaults=false;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil | --si | --s) + ac_cs_silent=: ;; + + # This is an error. + -*) { { echo "$as_me:$LINENO: error: unrecognized option: $1 +Try \`$0 --help' for more information." >&5 +echo "$as_me: error: unrecognized option: $1 +Try \`$0 --help' for more information." >&2;} + { (exit 1); exit 1; }; } ;; + + *) ac_config_targets="$ac_config_targets $1" ;; + + esac + shift +done + +ac_configure_extra_args= + +if $ac_cs_silent; then + exec 6>/dev/null + ac_configure_extra_args="$ac_configure_extra_args --silent" +fi + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF +if \$ac_cs_recheck; then + echo "running $SHELL $0 " $ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6 + exec $SHELL $0 $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion +fi + +_ACEOF + +cat >>$CONFIG_STATUS <<_ACEOF +# +# INIT-COMMANDS section. +# + +AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir" + +_ACEOF + + + +cat >>$CONFIG_STATUS <<\_ACEOF +for ac_config_target in $ac_config_targets +do + case "$ac_config_target" in + # Handling of arguments. + "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;; + "depfiles" ) CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; + "config.h" ) CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;; + *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 +echo "$as_me: error: invalid argument: $ac_config_target" >&2;} + { (exit 1); exit 1; }; };; + esac +done + +# If the user did not use the arguments to specify the items to instantiate, +# then the envvar interface is used. Set only those that are not. +# We use the long form for the default assignment because of an extremely +# bizarre bug on SunOS 4.1.3. +if $ac_need_defaults; then + test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files + test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers + test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands +fi + +# Have a temporary directory for convenience. Make it in the build tree +# simply because there is no reason to put it here, and in addition, +# creating and moving files from /tmp can sometimes cause problems. +# Create a temporary directory, and hook for its removal unless debugging. +$debug || +{ + trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0 + trap '{ (exit 1); exit 1; }' 1 2 13 15 +} + +# Create a (secure) tmp directory for tmp files. + +{ + tmp=`(umask 077 && mktemp -d -q "./confstatXXXXXX") 2>/dev/null` && + test -n "$tmp" && test -d "$tmp" +} || +{ + tmp=./confstat$$-$RANDOM + (umask 077 && mkdir $tmp) +} || +{ + echo "$me: cannot create a temporary directory in ." >&2 + { (exit 1); exit 1; } +} + +_ACEOF + +cat >>$CONFIG_STATUS <<_ACEOF + +# +# CONFIG_FILES section. +# + +# No need to generate the scripts if there are no CONFIG_FILES. +# This happens for instance when ./config.status config.h +if test -n "\$CONFIG_FILES"; then + # Protect against being on the right side of a sed subst in config.status. + sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g; + s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF +s,@SHELL@,$SHELL,;t t +s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t +s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t +s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t +s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t +s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t +s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t +s,@exec_prefix@,$exec_prefix,;t t +s,@prefix@,$prefix,;t t +s,@program_transform_name@,$program_transform_name,;t t +s,@bindir@,$bindir,;t t +s,@sbindir@,$sbindir,;t t +s,@libexecdir@,$libexecdir,;t t +s,@datadir@,$datadir,;t t +s,@sysconfdir@,$sysconfdir,;t t +s,@sharedstatedir@,$sharedstatedir,;t t +s,@localstatedir@,$localstatedir,;t t +s,@libdir@,$libdir,;t t +s,@includedir@,$includedir,;t t +s,@oldincludedir@,$oldincludedir,;t t +s,@infodir@,$infodir,;t t +s,@mandir@,$mandir,;t t +s,@build_alias@,$build_alias,;t t +s,@host_alias@,$host_alias,;t t +s,@target_alias@,$target_alias,;t t +s,@DEFS@,$DEFS,;t t +s,@ECHO_C@,$ECHO_C,;t t +s,@ECHO_N@,$ECHO_N,;t t +s,@ECHO_T@,$ECHO_T,;t t +s,@LIBS@,$LIBS,;t t +s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t +s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t +s,@INSTALL_DATA@,$INSTALL_DATA,;t t +s,@CYGPATH_W@,$CYGPATH_W,;t t +s,@PACKAGE@,$PACKAGE,;t t +s,@VERSION@,$VERSION,;t t +s,@ACLOCAL@,$ACLOCAL,;t t +s,@AUTOCONF@,$AUTOCONF,;t t +s,@AUTOMAKE@,$AUTOMAKE,;t t +s,@AUTOHEADER@,$AUTOHEADER,;t t +s,@MAKEINFO@,$MAKEINFO,;t t +s,@install_sh@,$install_sh,;t t +s,@STRIP@,$STRIP,;t t +s,@ac_ct_STRIP@,$ac_ct_STRIP,;t t +s,@INSTALL_STRIP_PROGRAM@,$INSTALL_STRIP_PROGRAM,;t t +s,@mkdir_p@,$mkdir_p,;t t +s,@AWK@,$AWK,;t t +s,@SET_MAKE@,$SET_MAKE,;t t +s,@am__leading_dot@,$am__leading_dot,;t t +s,@AMTAR@,$AMTAR,;t t +s,@am__tar@,$am__tar,;t t +s,@am__untar@,$am__untar,;t t +s,@MAINTAINER_MODE_TRUE@,$MAINTAINER_MODE_TRUE,;t t +s,@MAINTAINER_MODE_FALSE@,$MAINTAINER_MODE_FALSE,;t t +s,@MAINT@,$MAINT,;t t +s,@CC@,$CC,;t t +s,@CFLAGS@,$CFLAGS,;t t +s,@LDFLAGS@,$LDFLAGS,;t t +s,@CPPFLAGS@,$CPPFLAGS,;t t +s,@ac_ct_CC@,$ac_ct_CC,;t t +s,@EXEEXT@,$EXEEXT,;t t +s,@OBJEXT@,$OBJEXT,;t t +s,@DEPDIR@,$DEPDIR,;t t +s,@am__include@,$am__include,;t t +s,@am__quote@,$am__quote,;t t +s,@AMDEP_TRUE@,$AMDEP_TRUE,;t t +s,@AMDEP_FALSE@,$AMDEP_FALSE,;t t +s,@AMDEPBACKSLASH@,$AMDEPBACKSLASH,;t t +s,@CCDEPMODE@,$CCDEPMODE,;t t +s,@am__fastdepCC_TRUE@,$am__fastdepCC_TRUE,;t t +s,@am__fastdepCC_FALSE@,$am__fastdepCC_FALSE,;t t +s,@NEED_SETENV_TRUE@,$NEED_SETENV_TRUE,;t t +s,@NEED_SETENV_FALSE@,$NEED_SETENV_FALSE,;t t +s,@PKG_CONFIG@,$PKG_CONFIG,;t t +s,@ac_pt_PKG_CONFIG@,$ac_pt_PKG_CONFIG,;t t +s,@FONTTOSFNT_CFLAGS@,$FONTTOSFNT_CFLAGS,;t t +s,@FONTTOSFNT_LIBS@,$FONTTOSFNT_LIBS,;t t +s,@build@,$build,;t t +s,@build_cpu@,$build_cpu,;t t +s,@build_vendor@,$build_vendor,;t t +s,@build_os@,$build_os,;t t +s,@host@,$host,;t t +s,@host_cpu@,$host_cpu,;t t +s,@host_vendor@,$host_vendor,;t t +s,@host_os@,$host_os,;t t +s,@APP_MAN_SUFFIX@,$APP_MAN_SUFFIX,;t t +s,@LIB_MAN_SUFFIX@,$LIB_MAN_SUFFIX,;t t +s,@FILE_MAN_SUFFIX@,$FILE_MAN_SUFFIX,;t t +s,@MISC_MAN_SUFFIX@,$MISC_MAN_SUFFIX,;t t +s,@DRIVER_MAN_SUFFIX@,$DRIVER_MAN_SUFFIX,;t t +s,@ADMIN_MAN_SUFFIX@,$ADMIN_MAN_SUFFIX,;t t +s,@APP_MAN_DIR@,$APP_MAN_DIR,;t t +s,@LIB_MAN_DIR@,$LIB_MAN_DIR,;t t +s,@FILE_MAN_DIR@,$FILE_MAN_DIR,;t t +s,@MISC_MAN_DIR@,$MISC_MAN_DIR,;t t +s,@DRIVER_MAN_DIR@,$DRIVER_MAN_DIR,;t t +s,@ADMIN_MAN_DIR@,$ADMIN_MAN_DIR,;t t +s,@LIBOBJS@,$LIBOBJS,;t t +s,@LTLIBOBJS@,$LTLIBOBJS,;t t +CEOF + +_ACEOF + + cat >>$CONFIG_STATUS <<\_ACEOF + # Split the substitutions into bite-sized pieces for seds with + # small command number limits, like on Digital OSF/1 and HP-UX. + ac_max_sed_lines=48 + ac_sed_frag=1 # Number of current file. + ac_beg=1 # First line for current file. + ac_end=$ac_max_sed_lines # Line after last line for current file. + ac_more_lines=: + ac_sed_cmds= + while $ac_more_lines; do + if test $ac_beg -gt 1; then + sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag + else + sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag + fi + if test ! -s $tmp/subs.frag; then + ac_more_lines=false + else + # The purpose of the label and of the branching condition is to + # speed up the sed processing (if there are no `@' at all, there + # is no need to browse any of the substitutions). + # These are the two extra sed commands mentioned above. + (echo ':t + /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed + if test -z "$ac_sed_cmds"; then + ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed" + else + ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed" + fi + ac_sed_frag=`expr $ac_sed_frag + 1` + ac_beg=$ac_end + ac_end=`expr $ac_end + $ac_max_sed_lines` + fi + done + if test -z "$ac_sed_cmds"; then + ac_sed_cmds=cat + fi +fi # test -n "$CONFIG_FILES" + +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF +for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue + # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". + case $ac_file in + - | *:- | *:-:* ) # input from stdin + cat >$tmp/stdin + ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` + ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; + *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` + ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; + * ) ac_file_in=$ac_file.in ;; + esac + + # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories. + ac_dir=`(dirname "$ac_file") 2>/dev/null || +$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$ac_file" : 'X\(//\)[^/]' \| \ + X"$ac_file" : 'X\(//\)$' \| \ + X"$ac_file" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$ac_file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + { if $as_mkdir_p; then + mkdir -p "$ac_dir" + else + as_dir="$ac_dir" + as_dirs= + while test ! -d "$as_dir"; do + as_dirs="$as_dir $as_dirs" + as_dir=`(dirname "$as_dir") 2>/dev/null || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + done + test ! -n "$as_dirs" || mkdir $as_dirs + fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5 +echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;} + { (exit 1); exit 1; }; }; } + + ac_builddir=. + +if test "$ac_dir" != .; then + ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` + # A "../" for each directory in $ac_dir_suffix. + ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` +else + ac_dir_suffix= ac_top_builddir= +fi + +case $srcdir in + .) # No --srcdir option. We are building in place. + ac_srcdir=. + if test -z "$ac_top_builddir"; then + ac_top_srcdir=. + else + ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` + fi ;; + [\\/]* | ?:[\\/]* ) # Absolute path. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir ;; + *) # Relative path. + ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_builddir$srcdir ;; +esac + +# Do not use `cd foo && pwd` to compute absolute paths, because +# the directories may not exist. +case `pwd` in +.) ac_abs_builddir="$ac_dir";; +*) + case "$ac_dir" in + .) ac_abs_builddir=`pwd`;; + [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";; + *) ac_abs_builddir=`pwd`/"$ac_dir";; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_top_builddir=${ac_top_builddir}.;; +*) + case ${ac_top_builddir}. in + .) ac_abs_top_builddir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;; + *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_srcdir=$ac_srcdir;; +*) + case $ac_srcdir in + .) ac_abs_srcdir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;; + *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_top_srcdir=$ac_top_srcdir;; +*) + case $ac_top_srcdir in + .) ac_abs_top_srcdir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;; + *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;; + esac;; +esac + + + case $INSTALL in + [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; + *) ac_INSTALL=$ac_top_builddir$INSTALL ;; + esac + + if test x"$ac_file" != x-; then + { echo "$as_me:$LINENO: creating $ac_file" >&5 +echo "$as_me: creating $ac_file" >&6;} + rm -f "$ac_file" + fi + # Let's still pretend it is `configure' which instantiates (i.e., don't + # use $as_me), people would be surprised to read: + # /* config.h. Generated by config.status. */ + if test x"$ac_file" = x-; then + configure_input= + else + configure_input="$ac_file. " + fi + configure_input=$configure_input"Generated from `echo $ac_file_in | + sed 's,.*/,,'` by configure." + + # First look for the input files in the build tree, otherwise in the + # src tree. + ac_file_inputs=`IFS=: + for f in $ac_file_in; do + case $f in + -) echo $tmp/stdin ;; + [\\/$]*) + # Absolute (can't be DOS-style, as IFS=:) + test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 +echo "$as_me: error: cannot find input file: $f" >&2;} + { (exit 1); exit 1; }; } + echo "$f";; + *) # Relative + if test -f "$f"; then + # Build tree + echo "$f" + elif test -f "$srcdir/$f"; then + # Source tree + echo "$srcdir/$f" + else + # /dev/null tree + { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 +echo "$as_me: error: cannot find input file: $f" >&2;} + { (exit 1); exit 1; }; } + fi;; + esac + done` || { (exit 1); exit 1; } +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF + sed "$ac_vpsub +$extrasub +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF +:t +/@[a-zA-Z_][a-zA-Z_0-9]*@/!b +s,@configure_input@,$configure_input,;t t +s,@srcdir@,$ac_srcdir,;t t +s,@abs_srcdir@,$ac_abs_srcdir,;t t +s,@top_srcdir@,$ac_top_srcdir,;t t +s,@abs_top_srcdir@,$ac_abs_top_srcdir,;t t +s,@builddir@,$ac_builddir,;t t +s,@abs_builddir@,$ac_abs_builddir,;t t +s,@top_builddir@,$ac_top_builddir,;t t +s,@abs_top_builddir@,$ac_abs_top_builddir,;t t +s,@INSTALL@,$ac_INSTALL,;t t +" $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out + rm -f $tmp/stdin + if test x"$ac_file" != x-; then + mv $tmp/out $ac_file + else + cat $tmp/out + rm -f $tmp/out + fi + +done +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF + +# +# CONFIG_HEADER section. +# + +# These sed commands are passed to sed as "A NAME B NAME C VALUE D", where +# NAME is the cpp macro being defined and VALUE is the value it is being given. +# +# ac_d sets the value in "#define NAME VALUE" lines. +ac_dA='s,^\([ ]*\)#\([ ]*define[ ][ ]*\)' +ac_dB='[ ].*$,\1#\2' +ac_dC=' ' +ac_dD=',;t' +# ac_u turns "#undef NAME" without trailing blanks into "#define NAME VALUE". +ac_uA='s,^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)' +ac_uB='$,\1#\2define\3' +ac_uC=' ' +ac_uD=',;t' + +for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue + # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". + case $ac_file in + - | *:- | *:-:* ) # input from stdin + cat >$tmp/stdin + ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` + ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; + *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` + ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; + * ) ac_file_in=$ac_file.in ;; + esac + + test x"$ac_file" != x- && { echo "$as_me:$LINENO: creating $ac_file" >&5 +echo "$as_me: creating $ac_file" >&6;} + + # First look for the input files in the build tree, otherwise in the + # src tree. + ac_file_inputs=`IFS=: + for f in $ac_file_in; do + case $f in + -) echo $tmp/stdin ;; + [\\/$]*) + # Absolute (can't be DOS-style, as IFS=:) + test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 +echo "$as_me: error: cannot find input file: $f" >&2;} + { (exit 1); exit 1; }; } + # Do quote $f, to prevent DOS paths from being IFS'd. + echo "$f";; + *) # Relative + if test -f "$f"; then + # Build tree + echo "$f" + elif test -f "$srcdir/$f"; then + # Source tree + echo "$srcdir/$f" + else + # /dev/null tree + { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 +echo "$as_me: error: cannot find input file: $f" >&2;} + { (exit 1); exit 1; }; } + fi;; + esac + done` || { (exit 1); exit 1; } + # Remove the trailing spaces. + sed 's/[ ]*$//' $ac_file_inputs >$tmp/in + +_ACEOF + +# Transform confdefs.h into two sed scripts, `conftest.defines' and +# `conftest.undefs', that substitutes the proper values into +# config.h.in to produce config.h. The first handles `#define' +# templates, and the second `#undef' templates. +# And first: Protect against being on the right side of a sed subst in +# config.status. Protect against being in an unquoted here document +# in config.status. +rm -f conftest.defines conftest.undefs +# Using a here document instead of a string reduces the quoting nightmare. +# Putting comments in sed scripts is not portable. +# +# `end' is used to avoid that the second main sed command (meant for +# 0-ary CPP macros) applies to n-ary macro definitions. +# See the Autoconf documentation for `clear'. +cat >confdef2sed.sed <<\_ACEOF +s/[\\&,]/\\&/g +s,[\\$`],\\&,g +t clear +: clear +s,^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*\)\(([^)]*)\)[ ]*\(.*\)$,${ac_dA}\1${ac_dB}\1\2${ac_dC}\3${ac_dD},gp +t end +s,^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)$,${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD},gp +: end +_ACEOF +# If some macros were called several times there might be several times +# the same #defines, which is useless. Nevertheless, we may not want to +# sort them, since we want the *last* AC-DEFINE to be honored. +uniq confdefs.h | sed -n -f confdef2sed.sed >conftest.defines +sed 's/ac_d/ac_u/g' conftest.defines >conftest.undefs +rm -f confdef2sed.sed + +# This sed command replaces #undef with comments. This is necessary, for +# example, in the case of _POSIX_SOURCE, which is predefined and required +# on some systems where configure will not decide to define it. +cat >>conftest.undefs <<\_ACEOF +s,^[ ]*#[ ]*undef[ ][ ]*[a-zA-Z_][a-zA-Z_0-9]*,/* & */, +_ACEOF + +# Break up conftest.defines because some shells have a limit on the size +# of here documents, and old seds have small limits too (100 cmds). +echo ' # Handle all the #define templates only if necessary.' >>$CONFIG_STATUS +echo ' if grep "^[ ]*#[ ]*define" $tmp/in >/dev/null; then' >>$CONFIG_STATUS +echo ' # If there are no defines, we may have an empty if/fi' >>$CONFIG_STATUS +echo ' :' >>$CONFIG_STATUS +rm -f conftest.tail +while grep . conftest.defines >/dev/null +do + # Write a limited-size here document to $tmp/defines.sed. + echo ' cat >$tmp/defines.sed <>$CONFIG_STATUS + # Speed up: don't consider the non `#define' lines. + echo '/^[ ]*#[ ]*define/!b' >>$CONFIG_STATUS + # Work around the forget-to-reset-the-flag bug. + echo 't clr' >>$CONFIG_STATUS + echo ': clr' >>$CONFIG_STATUS + sed ${ac_max_here_lines}q conftest.defines >>$CONFIG_STATUS + echo 'CEOF + sed -f $tmp/defines.sed $tmp/in >$tmp/out + rm -f $tmp/in + mv $tmp/out $tmp/in +' >>$CONFIG_STATUS + sed 1,${ac_max_here_lines}d conftest.defines >conftest.tail + rm -f conftest.defines + mv conftest.tail conftest.defines +done +rm -f conftest.defines +echo ' fi # grep' >>$CONFIG_STATUS +echo >>$CONFIG_STATUS + +# Break up conftest.undefs because some shells have a limit on the size +# of here documents, and old seds have small limits too (100 cmds). +echo ' # Handle all the #undef templates' >>$CONFIG_STATUS +rm -f conftest.tail +while grep . conftest.undefs >/dev/null +do + # Write a limited-size here document to $tmp/undefs.sed. + echo ' cat >$tmp/undefs.sed <>$CONFIG_STATUS + # Speed up: don't consider the non `#undef' + echo '/^[ ]*#[ ]*undef/!b' >>$CONFIG_STATUS + # Work around the forget-to-reset-the-flag bug. + echo 't clr' >>$CONFIG_STATUS + echo ': clr' >>$CONFIG_STATUS + sed ${ac_max_here_lines}q conftest.undefs >>$CONFIG_STATUS + echo 'CEOF + sed -f $tmp/undefs.sed $tmp/in >$tmp/out + rm -f $tmp/in + mv $tmp/out $tmp/in +' >>$CONFIG_STATUS + sed 1,${ac_max_here_lines}d conftest.undefs >conftest.tail + rm -f conftest.undefs + mv conftest.tail conftest.undefs +done +rm -f conftest.undefs + +cat >>$CONFIG_STATUS <<\_ACEOF + # Let's still pretend it is `configure' which instantiates (i.e., don't + # use $as_me), people would be surprised to read: + # /* config.h. Generated by config.status. */ + if test x"$ac_file" = x-; then + echo "/* Generated by configure. */" >$tmp/config.h + else + echo "/* $ac_file. Generated by configure. */" >$tmp/config.h + fi + cat $tmp/in >>$tmp/config.h + rm -f $tmp/in + if test x"$ac_file" != x-; then + if diff $ac_file $tmp/config.h >/dev/null 2>&1; then + { echo "$as_me:$LINENO: $ac_file is unchanged" >&5 +echo "$as_me: $ac_file is unchanged" >&6;} + else + ac_dir=`(dirname "$ac_file") 2>/dev/null || +$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$ac_file" : 'X\(//\)[^/]' \| \ + X"$ac_file" : 'X\(//\)$' \| \ + X"$ac_file" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$ac_file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + { if $as_mkdir_p; then + mkdir -p "$ac_dir" + else + as_dir="$ac_dir" + as_dirs= + while test ! -d "$as_dir"; do + as_dirs="$as_dir $as_dirs" + as_dir=`(dirname "$as_dir") 2>/dev/null || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + done + test ! -n "$as_dirs" || mkdir $as_dirs + fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5 +echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;} + { (exit 1); exit 1; }; }; } + + rm -f $ac_file + mv $tmp/config.h $ac_file + fi + else + cat $tmp/config.h + rm -f $tmp/config.h + fi +# Compute $ac_file's index in $config_headers. +_am_stamp_count=1 +for _am_header in $config_headers :; do + case $_am_header in + $ac_file | $ac_file:* ) + break ;; + * ) + _am_stamp_count=`expr $_am_stamp_count + 1` ;; + esac +done +echo "timestamp for $ac_file" >`(dirname $ac_file) 2>/dev/null || +$as_expr X$ac_file : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X$ac_file : 'X\(//\)[^/]' \| \ + X$ac_file : 'X\(//\)$' \| \ + X$ac_file : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X$ac_file | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'`/stamp-h$_am_stamp_count +done +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF + +# +# CONFIG_COMMANDS section. +# +for ac_file in : $CONFIG_COMMANDS; do test "x$ac_file" = x: && continue + ac_dest=`echo "$ac_file" | sed 's,:.*,,'` + ac_source=`echo "$ac_file" | sed 's,[^:]*:,,'` + ac_dir=`(dirname "$ac_dest") 2>/dev/null || +$as_expr X"$ac_dest" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$ac_dest" : 'X\(//\)[^/]' \| \ + X"$ac_dest" : 'X\(//\)$' \| \ + X"$ac_dest" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$ac_dest" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + { if $as_mkdir_p; then + mkdir -p "$ac_dir" + else + as_dir="$ac_dir" + as_dirs= + while test ! -d "$as_dir"; do + as_dirs="$as_dir $as_dirs" + as_dir=`(dirname "$as_dir") 2>/dev/null || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + done + test ! -n "$as_dirs" || mkdir $as_dirs + fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5 +echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;} + { (exit 1); exit 1; }; }; } + + ac_builddir=. + +if test "$ac_dir" != .; then + ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` + # A "../" for each directory in $ac_dir_suffix. + ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` +else + ac_dir_suffix= ac_top_builddir= +fi + +case $srcdir in + .) # No --srcdir option. We are building in place. + ac_srcdir=. + if test -z "$ac_top_builddir"; then + ac_top_srcdir=. + else + ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` + fi ;; + [\\/]* | ?:[\\/]* ) # Absolute path. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir ;; + *) # Relative path. + ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_builddir$srcdir ;; +esac + +# Do not use `cd foo && pwd` to compute absolute paths, because +# the directories may not exist. +case `pwd` in +.) ac_abs_builddir="$ac_dir";; +*) + case "$ac_dir" in + .) ac_abs_builddir=`pwd`;; + [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";; + *) ac_abs_builddir=`pwd`/"$ac_dir";; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_top_builddir=${ac_top_builddir}.;; +*) + case ${ac_top_builddir}. in + .) ac_abs_top_builddir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;; + *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_srcdir=$ac_srcdir;; +*) + case $ac_srcdir in + .) ac_abs_srcdir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;; + *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_top_srcdir=$ac_top_srcdir;; +*) + case $ac_top_srcdir in + .) ac_abs_top_srcdir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;; + *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;; + esac;; +esac + + + { echo "$as_me:$LINENO: executing $ac_dest commands" >&5 +echo "$as_me: executing $ac_dest commands" >&6;} + case $ac_dest in + depfiles ) test x"$AMDEP_TRUE" != x"" || for mf in $CONFIG_FILES; do + # Strip MF so we end up with the name of the file. + mf=`echo "$mf" | sed -e 's/:.*$//'` + # Check whether this is an Automake generated Makefile or not. + # We used to match only the files named `Makefile.in', but + # some people rename them; so instead we look at the file content. + # Grep'ing the first line is not enough: some people post-process + # each Makefile.in and add a new line on top of each file to say so. + # So let's grep whole file. + if grep '^#.*generated by automake' $mf > /dev/null 2>&1; then + dirpart=`(dirname "$mf") 2>/dev/null || +$as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$mf" : 'X\(//\)[^/]' \| \ + X"$mf" : 'X\(//\)$' \| \ + X"$mf" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$mf" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + else + continue + fi + # Extract the definition of DEPDIR, am__include, and am__quote + # from the Makefile without running `make'. + DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` + test -z "$DEPDIR" && continue + am__include=`sed -n 's/^am__include = //p' < "$mf"` + test -z "am__include" && continue + am__quote=`sed -n 's/^am__quote = //p' < "$mf"` + # When using ansi2knr, U may be empty or an underscore; expand it + U=`sed -n 's/^U = //p' < "$mf"` + # Find all dependency output files, they are included files with + # $(DEPDIR) in their names. We invoke sed twice because it is the + # simplest approach to changing $(DEPDIR) to its actual value in the + # expansion. + for file in `sed -n " + s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ + sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do + # Make sure the directory exists. + test -f "$dirpart/$file" && continue + fdir=`(dirname "$file") 2>/dev/null || +$as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$file" : 'X\(//\)[^/]' \| \ + X"$file" : 'X\(//\)$' \| \ + X"$file" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + { if $as_mkdir_p; then + mkdir -p $dirpart/$fdir + else + as_dir=$dirpart/$fdir + as_dirs= + while test ! -d "$as_dir"; do + as_dirs="$as_dir $as_dirs" + as_dir=`(dirname "$as_dir") 2>/dev/null || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + done + test ! -n "$as_dirs" || mkdir $as_dirs + fi || { { echo "$as_me:$LINENO: error: cannot create directory $dirpart/$fdir" >&5 +echo "$as_me: error: cannot create directory $dirpart/$fdir" >&2;} + { (exit 1); exit 1; }; }; } + + # echo "creating $dirpart/$file" + echo '# dummy' > "$dirpart/$file" + done +done + ;; + esac +done +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF + +{ (exit 0); exit 0; } +_ACEOF +chmod +x $CONFIG_STATUS +ac_clean_files=$ac_clean_files_save + + +# configure is writing to config.log, and then calls config.status. +# config.status does its own redirection, appending to config.log. +# Unfortunately, on DOS this fails, as config.log is still kept open +# by configure, so config.status won't be able to write to it; its +# output is simply discarded. So we exec the FD to /dev/null, +# effectively closing config.log, so it can be properly (re)opened and +# appended to by config.status. When coming back to configure, we +# need to make the FD available again. +if test "$no_create" != yes; then + ac_cs_success=: + ac_config_status_args= + test "$silent" = yes && + ac_config_status_args="$ac_config_status_args --quiet" + exec 5>/dev/null + $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false + exec 5>>config.log + # Use ||, not &&, to avoid exiting from the if with $? = 1, which + # would make configure fail if this is the last instruction. + $ac_cs_success || { (exit 1); exit 1; } +fi + diff --git a/app/fonttosfnt/configure.ac b/app/fonttosfnt/configure.ac new file mode 100644 index 000000000..5e52eb06b --- /dev/null +++ b/app/fonttosfnt/configure.ac @@ -0,0 +1,46 @@ + +dnl Copyright 2005 Red Hat, Inc. +dnl +dnl Permission to use, copy, modify, distribute, and sell this software and its +dnl documentation for any purpose is hereby granted without fee, provided that +dnl the above copyright notice appear in all copies and that both that +dnl copyright notice and this permission notice appear in supporting +dnl documentation, and that the name of Red Hat not be used in +dnl advertising or publicity pertaining to distribution of the software without +dnl specific, written prior permission. Red Hat makes no +dnl representations about the suitability of this software for any purpose. It +dnl is provided "as is" without express or implied warranty. +dnl +dnl RED HAT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, +dnl INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO +dnl EVENT SHALL RED HAT BE LIABLE FOR ANY SPECIAL, INDIRECT OR +dnl CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, +dnl DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER +dnl TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +dnl PERFORMANCE OF THIS SOFTWARE. +dnl +dnl Process this file with autoconf to create configure. + +AC_PREREQ([2.57]) +AC_INIT(fonttosfnt,[1.0.2], [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg],fonttosfnt) +AM_INIT_AUTOMAKE([dist-bzip2]) +AM_MAINTAINER_MODE + +AM_CONFIG_HEADER(config.h) + +AC_PROG_CC +AC_PROG_INSTALL + +AC_CHECK_FUNC(setenv, have_setenv=yes, have_setenv=no) + +AM_CONDITIONAL(NEED_SETENV, [test x$have_setenv = xno]) + +# Checks for pkg-config packages +PKG_CHECK_MODULES(FONTTOSFNT, xproto freetype2 fontenc) +AC_SUBST(FONTTOSFNT_CFLAGS) +AC_SUBST(FONTTOSFNT_LIBS) + +XORG_MANPAGE_SECTIONS +XORG_RELEASE_VERSION + +AC_OUTPUT([Makefile]) diff --git a/app/fonttosfnt/depcomp b/app/fonttosfnt/depcomp new file mode 100644 index 000000000..04701da53 --- /dev/null +++ b/app/fonttosfnt/depcomp @@ -0,0 +1,530 @@ +#! /bin/sh +# depcomp - compile a program generating dependencies as side-effects + +scriptversion=2005-07-09.11 + +# Copyright (C) 1999, 2000, 2003, 2004, 2005 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +# 02110-1301, USA. + +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +# Originally written by Alexandre Oliva . + +case $1 in + '') + echo "$0: No command. Try \`$0 --help' for more information." 1>&2 + exit 1; + ;; + -h | --h*) + cat <<\EOF +Usage: depcomp [--help] [--version] PROGRAM [ARGS] + +Run PROGRAMS ARGS to compile a file, generating dependencies +as side-effects. + +Environment variables: + depmode Dependency tracking mode. + source Source file read by `PROGRAMS ARGS'. + object Object file output by `PROGRAMS ARGS'. + DEPDIR directory where to store dependencies. + depfile Dependency file to output. + tmpdepfile Temporary file to use when outputing dependencies. + libtool Whether libtool is used (yes/no). + +Report bugs to . +EOF + exit $? + ;; + -v | --v*) + echo "depcomp $scriptversion" + exit $? + ;; +esac + +if test -z "$depmode" || test -z "$source" || test -z "$object"; then + echo "depcomp: Variables source, object and depmode must be set" 1>&2 + exit 1 +fi + +# Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po. +depfile=${depfile-`echo "$object" | + sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`} +tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`} + +rm -f "$tmpdepfile" + +# Some modes work just like other modes, but use different flags. We +# parameterize here, but still list the modes in the big case below, +# to make depend.m4 easier to write. Note that we *cannot* use a case +# here, because this file can only contain one case statement. +if test "$depmode" = hp; then + # HP compiler uses -M and no extra arg. + gccflag=-M + depmode=gcc +fi + +if test "$depmode" = dashXmstdout; then + # This is just like dashmstdout with a different argument. + dashmflag=-xM + depmode=dashmstdout +fi + +case "$depmode" in +gcc3) +## gcc 3 implements dependency tracking that does exactly what +## we want. Yay! Note: for some reason libtool 1.4 doesn't like +## it if -MD -MP comes after the -MF stuff. Hmm. + "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" + stat=$? + if test $stat -eq 0; then : + else + rm -f "$tmpdepfile" + exit $stat + fi + mv "$tmpdepfile" "$depfile" + ;; + +gcc) +## There are various ways to get dependency output from gcc. Here's +## why we pick this rather obscure method: +## - Don't want to use -MD because we'd like the dependencies to end +## up in a subdir. Having to rename by hand is ugly. +## (We might end up doing this anyway to support other compilers.) +## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like +## -MM, not -M (despite what the docs say). +## - Using -M directly means running the compiler twice (even worse +## than renaming). + if test -z "$gccflag"; then + gccflag=-MD, + fi + "$@" -Wp,"$gccflag$tmpdepfile" + stat=$? + if test $stat -eq 0; then : + else + rm -f "$tmpdepfile" + exit $stat + fi + rm -f "$depfile" + echo "$object : \\" > "$depfile" + alpha=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz +## The second -e expression handles DOS-style file names with drive letters. + sed -e 's/^[^:]*: / /' \ + -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile" +## This next piece of magic avoids the `deleted header file' problem. +## The problem is that when a header file which appears in a .P file +## is deleted, the dependency causes make to die (because there is +## typically no way to rebuild the header). We avoid this by adding +## dummy dependencies for each header file. Too bad gcc doesn't do +## this for us directly. + tr ' ' ' +' < "$tmpdepfile" | +## Some versions of gcc put a space before the `:'. On the theory +## that the space means something, we add a space to the output as +## well. +## Some versions of the HPUX 10.20 sed can't process this invocation +## correctly. Breaking it into two sed invocations is a workaround. + sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +hp) + # This case exists only to let depend.m4 do its work. It works by + # looking at the text of this script. This case will never be run, + # since it is checked for above. + exit 1 + ;; + +sgi) + if test "$libtool" = yes; then + "$@" "-Wp,-MDupdate,$tmpdepfile" + else + "$@" -MDupdate "$tmpdepfile" + fi + stat=$? + if test $stat -eq 0; then : + else + rm -f "$tmpdepfile" + exit $stat + fi + rm -f "$depfile" + + if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files + echo "$object : \\" > "$depfile" + + # Clip off the initial element (the dependent). Don't try to be + # clever and replace this with sed code, as IRIX sed won't handle + # lines with more than a fixed number of characters (4096 in + # IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines; + # the IRIX cc adds comments like `#:fec' to the end of the + # dependency line. + tr ' ' ' +' < "$tmpdepfile" \ + | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \ + tr ' +' ' ' >> $depfile + echo >> $depfile + + # The second pass generates a dummy entry for each header file. + tr ' ' ' +' < "$tmpdepfile" \ + | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \ + >> $depfile + else + # The sourcefile does not contain any dependencies, so just + # store a dummy comment line, to avoid errors with the Makefile + # "include basename.Plo" scheme. + echo "#dummy" > "$depfile" + fi + rm -f "$tmpdepfile" + ;; + +aix) + # The C for AIX Compiler uses -M and outputs the dependencies + # in a .u file. In older versions, this file always lives in the + # current directory. Also, the AIX compiler puts `$object:' at the + # start of each line; $object doesn't have directory information. + # Version 6 uses the directory in both cases. + stripped=`echo "$object" | sed 's/\(.*\)\..*$/\1/'` + tmpdepfile="$stripped.u" + if test "$libtool" = yes; then + "$@" -Wc,-M + else + "$@" -M + fi + stat=$? + + if test -f "$tmpdepfile"; then : + else + stripped=`echo "$stripped" | sed 's,^.*/,,'` + tmpdepfile="$stripped.u" + fi + + if test $stat -eq 0; then : + else + rm -f "$tmpdepfile" + exit $stat + fi + + if test -f "$tmpdepfile"; then + outname="$stripped.o" + # Each line is of the form `foo.o: dependent.h'. + # Do two passes, one to just change these to + # `$object: dependent.h' and one to simply `dependent.h:'. + sed -e "s,^$outname:,$object :," < "$tmpdepfile" > "$depfile" + sed -e "s,^$outname: \(.*\)$,\1:," < "$tmpdepfile" >> "$depfile" + else + # The sourcefile does not contain any dependencies, so just + # store a dummy comment line, to avoid errors with the Makefile + # "include basename.Plo" scheme. + echo "#dummy" > "$depfile" + fi + rm -f "$tmpdepfile" + ;; + +icc) + # Intel's C compiler understands `-MD -MF file'. However on + # icc -MD -MF foo.d -c -o sub/foo.o sub/foo.c + # ICC 7.0 will fill foo.d with something like + # foo.o: sub/foo.c + # foo.o: sub/foo.h + # which is wrong. We want: + # sub/foo.o: sub/foo.c + # sub/foo.o: sub/foo.h + # sub/foo.c: + # sub/foo.h: + # ICC 7.1 will output + # foo.o: sub/foo.c sub/foo.h + # and will wrap long lines using \ : + # foo.o: sub/foo.c ... \ + # sub/foo.h ... \ + # ... + + "$@" -MD -MF "$tmpdepfile" + stat=$? + if test $stat -eq 0; then : + else + rm -f "$tmpdepfile" + exit $stat + fi + rm -f "$depfile" + # Each line is of the form `foo.o: dependent.h', + # or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'. + # Do two passes, one to just change these to + # `$object: dependent.h' and one to simply `dependent.h:'. + sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile" + # Some versions of the HPUX 10.20 sed can't process this invocation + # correctly. Breaking it into two sed invocations is a workaround. + sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" | + sed -e 's/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +tru64) + # The Tru64 compiler uses -MD to generate dependencies as a side + # effect. `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'. + # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put + # dependencies in `foo.d' instead, so we check for that too. + # Subdirectories are respected. + dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` + test "x$dir" = "x$object" && dir= + base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` + + if test "$libtool" = yes; then + # With Tru64 cc, shared objects can also be used to make a + # static library. This mecanism is used in libtool 1.4 series to + # handle both shared and static libraries in a single compilation. + # With libtool 1.4, dependencies were output in $dir.libs/$base.lo.d. + # + # With libtool 1.5 this exception was removed, and libtool now + # generates 2 separate objects for the 2 libraries. These two + # compilations output dependencies in in $dir.libs/$base.o.d and + # in $dir$base.o.d. We have to check for both files, because + # one of the two compilations can be disabled. We should prefer + # $dir$base.o.d over $dir.libs/$base.o.d because the latter is + # automatically cleaned when .libs/ is deleted, while ignoring + # the former would cause a distcleancheck panic. + tmpdepfile1=$dir.libs/$base.lo.d # libtool 1.4 + tmpdepfile2=$dir$base.o.d # libtool 1.5 + tmpdepfile3=$dir.libs/$base.o.d # libtool 1.5 + tmpdepfile4=$dir.libs/$base.d # Compaq CCC V6.2-504 + "$@" -Wc,-MD + else + tmpdepfile1=$dir$base.o.d + tmpdepfile2=$dir$base.d + tmpdepfile3=$dir$base.d + tmpdepfile4=$dir$base.d + "$@" -MD + fi + + stat=$? + if test $stat -eq 0; then : + else + rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4" + exit $stat + fi + + for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4" + do + test -f "$tmpdepfile" && break + done + if test -f "$tmpdepfile"; then + sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile" + # That's a tab and a space in the []. + sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile" + else + echo "#dummy" > "$depfile" + fi + rm -f "$tmpdepfile" + ;; + +#nosideeffect) + # This comment above is used by automake to tell side-effect + # dependency tracking mechanisms from slower ones. + +dashmstdout) + # Important note: in order to support this mode, a compiler *must* + # always write the preprocessed file to stdout, regardless of -o. + "$@" || exit $? + + # Remove the call to Libtool. + if test "$libtool" = yes; then + while test $1 != '--mode=compile'; do + shift + done + shift + fi + + # Remove `-o $object'. + IFS=" " + for arg + do + case $arg in + -o) + shift + ;; + $object) + shift + ;; + *) + set fnord "$@" "$arg" + shift # fnord + shift # $arg + ;; + esac + done + + test -z "$dashmflag" && dashmflag=-M + # Require at least two characters before searching for `:' + # in the target name. This is to cope with DOS-style filenames: + # a dependency such as `c:/foo/bar' could be seen as target `c' otherwise. + "$@" $dashmflag | + sed 's:^[ ]*[^: ][^:][^:]*\:[ ]*:'"$object"'\: :' > "$tmpdepfile" + rm -f "$depfile" + cat < "$tmpdepfile" > "$depfile" + tr ' ' ' +' < "$tmpdepfile" | \ +## Some versions of the HPUX 10.20 sed can't process this invocation +## correctly. Breaking it into two sed invocations is a workaround. + sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +dashXmstdout) + # This case only exists to satisfy depend.m4. It is never actually + # run, as this mode is specially recognized in the preamble. + exit 1 + ;; + +makedepend) + "$@" || exit $? + # Remove any Libtool call + if test "$libtool" = yes; then + while test $1 != '--mode=compile'; do + shift + done + shift + fi + # X makedepend + shift + cleared=no + for arg in "$@"; do + case $cleared in + no) + set ""; shift + cleared=yes ;; + esac + case "$arg" in + -D*|-I*) + set fnord "$@" "$arg"; shift ;; + # Strip any option that makedepend may not understand. Remove + # the object too, otherwise makedepend will parse it as a source file. + -*|$object) + ;; + *) + set fnord "$@" "$arg"; shift ;; + esac + done + obj_suffix="`echo $object | sed 's/^.*\././'`" + touch "$tmpdepfile" + ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@" + rm -f "$depfile" + cat < "$tmpdepfile" > "$depfile" + sed '1,2d' "$tmpdepfile" | tr ' ' ' +' | \ +## Some versions of the HPUX 10.20 sed can't process this invocation +## correctly. Breaking it into two sed invocations is a workaround. + sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" "$tmpdepfile".bak + ;; + +cpp) + # Important note: in order to support this mode, a compiler *must* + # always write the preprocessed file to stdout. + "$@" || exit $? + + # Remove the call to Libtool. + if test "$libtool" = yes; then + while test $1 != '--mode=compile'; do + shift + done + shift + fi + + # Remove `-o $object'. + IFS=" " + for arg + do + case $arg in + -o) + shift + ;; + $object) + shift + ;; + *) + set fnord "$@" "$arg" + shift # fnord + shift # $arg + ;; + esac + done + + "$@" -E | + sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ + -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' | + sed '$ s: \\$::' > "$tmpdepfile" + rm -f "$depfile" + echo "$object : \\" > "$depfile" + cat < "$tmpdepfile" >> "$depfile" + sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +msvisualcpp) + # Important note: in order to support this mode, a compiler *must* + # always write the preprocessed file to stdout, regardless of -o, + # because we must use -o when running libtool. + "$@" || exit $? + IFS=" " + for arg + do + case "$arg" in + "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI") + set fnord "$@" + shift + shift + ;; + *) + set fnord "$@" "$arg" + shift + shift + ;; + esac + done + "$@" -E | + sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::echo "`cygpath -u \\"\1\\"`":p' | sort | uniq > "$tmpdepfile" + rm -f "$depfile" + echo "$object : \\" > "$depfile" + . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s:: \1 \\:p' >> "$depfile" + echo " " >> "$depfile" + . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s::\1\::p' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +none) + exec "$@" + ;; + +*) + echo "Unknown depmode $depmode" 1>&2 + exit 1 + ;; +esac + +exit 0 + +# Local Variables: +# mode: shell-script +# sh-indentation: 2 +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-end: "$" +# End: diff --git a/app/fonttosfnt/env.c b/app/fonttosfnt/env.c new file mode 100644 index 000000000..a5da90c2e --- /dev/null +++ b/app/fonttosfnt/env.c @@ -0,0 +1,151 @@ +/* + * Provide setenv() and unsetenv() on platforms that don't have them. + * From FreeBSD's libc. + */ + +/* + * Copyright (c) 1987, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +/* $XFree86: xc/programs/xedit/lisp/env.c,v 1.1 2002/03/05 03:52:34 dawes Exp $ */ + + +#include +#include +#include + +extern char **environ; + +extern int setenv(const char *name, const char *value, int overwrite); +extern void unsetenv(const char *name); + +static char * +findenv(const char *name, int *offset) +{ + int len, i; + const char *np; + char **p, *cp; + + if (name == NULL || environ == NULL) + return NULL; + + for (np = name; *np && *np != '='; ++np) + continue; + len = np - name; + for (p = environ; (cp = *p) != NULL; ++p) { + for (np = name, i = len; i && *cp; i--) + if (*cp++ != *np++) + break; + if (i == 0 && *cp++ == '=') { + *offset = p - environ; + return cp; + } + } + return NULL; +} + +/* + * setenv -- + * Set the value of the environmental variable "name" to be + * "value". If overwrite is set, replace any current value. + */ + +int +setenv(const char *name, const char *value, int overwrite) +{ + static char **alloced; /* if allocated space before */ + char *c; + int l_value, offset; + + if (*value == '=') /* no '=' in value */ + ++value; + l_value = strlen(value); + if ((c = findenv(name, &offset))) { /* find if already exists */ + if (!overwrite) + return 0; + if (strlen(c) >= l_value) { /* old larger; copy over */ + while ((*c++ = *value++)) + ; + return 0; + } + } else { /* create new slot */ + int cnt; + char **p; + + for (p = environ, cnt = 0; *p; ++p, ++cnt) + ; + if (alloced == environ) { /* just increase size */ + p = (char **)realloc((char *)environ, + sizeof(char *) * (cnt + 2)); + if (!p) + return -1; + alloced = environ = p; + } else { /* get new space */ + /* copy old entries into it */ + p = malloc(sizeof(char *) * (cnt + 2)); + if (!p) + return -1; + memcpy(p, environ, cnt * sizeof(char *)); + alloced = environ = p; + } + environ[cnt + 1] = NULL; + offset = cnt; + } + for (c = (char *)name; *c && *c != '='; ++c) /* no '=' in name */ + ; + if (!(environ[offset] = /* name + '=' + value */ + malloc((int)(c - name) + l_value + 2))) + return -1; + for (c = environ[offset]; (*c = *name++) && *c != '='; ++c) + ; + for (*c++ = '='; (*c++ = *value++); ) + ; + return 0; +} + +/* + * unsetenv(name) -- + * Delete environmental variable "name". + */ + +void +unsetenv(const char *name) +{ + char **p; + int offset; + + while (findenv(name, &offset)) /* if set multiple times */ + for (p = &environ[offset];; ++p) + if (!(*p = *(p + 1))) + break; +} + diff --git a/app/fonttosfnt/fonttosfnt.c b/app/fonttosfnt/fonttosfnt.c new file mode 100644 index 000000000..e8e41b08d --- /dev/null +++ b/app/fonttosfnt/fonttosfnt.c @@ -0,0 +1,118 @@ +/* +Copyright (c) 2002-2003 by Juliusz Chroboczek + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +*/ +/* $XdotOrg: xc/programs/fonttosfnt/fonttosfnt.c,v 1.4 2003/12/19 02:16:36 dawes Exp $ */ +/* $XFree86: xc/programs/fonttosfnt/fonttosfnt.c,v 1.3 2003/07/08 15:39:49 tsi Exp $ */ + +#include +#include +#include +#include "fonttosfnt.h" + +int verbose_flag = 0; +int reencode_flag = 1; +int glyph_flag = 2; +int metrics_flag = 1; +int crop_flag = 1; +int bit_aligned_flag = 1; + +static void +usage(void) +{ + fprintf(stderr, "Usage:\n"); + fprintf(stderr, + "fonttosfnt [ -v ] [ -c ] [ -b ] [ -r ] [ -g n ] [ -m n ] -o font.ttf " + "[ -- ] font ...\n"); +} + +int +main(int argc, char **argv) +{ + int i; + int rc; + char *output = NULL; + FontPtr font; + + i = 1; + while(i < argc) { + if(argv[i][0] != '-') + break; + + if(argv[i][1] == 'o') { + if(argv[i][2] == '\0') { + output = sprintf_reliable("%s", argv[i + 1]); + i += 2; + } else { + output = sprintf_reliable("%s", argv[i] + 2); + i++; + } + } else if(strcmp(argv[i], "-v") == 0) { + verbose_flag = 1; + i++; + } else if(strcmp(argv[i], "-c") == 0) { + crop_flag = 0; + i++; + } else if(strcmp(argv[i], "-b") == 0) { + bit_aligned_flag = 0; + i++; + } else if(strcmp(argv[i], "-r") == 0) { + reencode_flag = 0; + i++; + } else if(strcmp(argv[i], "-g") == 0) { + if(argc <= i + 1) { + usage(); + exit(1); + } + glyph_flag = atoi(argv[i + 1]); + i += 2; + } else if(strcmp(argv[i], "-m") == 0) { + if(argc <= i + 1) { + usage(); + exit(1); + } + metrics_flag = atoi(argv[i + 1]); + i += 2; + } else if(strcmp(argv[i], "--") == 0) { + i++; + break; + } else { + usage(); + exit(1); + } + } + + if(output == NULL) { + usage(); + exit(1); + } + + font = makeFont(); + + while(i < argc) { + rc = readFile(argv[i], font); + if(rc != 0) + exit(1); + i++; + } + + writeFile(output, font); + return 0; +} diff --git a/app/fonttosfnt/fonttosfnt.h b/app/fonttosfnt/fonttosfnt.h new file mode 100644 index 000000000..b7392a77b --- /dev/null +++ b/app/fonttosfnt/fonttosfnt.h @@ -0,0 +1,178 @@ +/* +Copyright (c) 2002-2003 by Juliusz Chroboczek + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +*/ +/* $XFree86: xc/programs/fonttosfnt/fonttosfnt.h,v 1.4 2003/10/24 20:38:11 tsi Exp $ */ + +#ifndef _FONTTOSFNT_H_ +#define _FONTTOSFNT_H_ 1 + +#include +#include +#include FT_FREETYPE_H + +#define ROUND(x) ((double)(int)((x) + 0.5)) + +extern int verbose_flag; +extern int glyph_flag; +extern int metrics_flag; +extern int crop_flag; +extern int bit_aligned_flag; +extern int reencode_flag; + +#define FONT_SEGMENT_SIZE 128 +#define FONT_CODES 0x10000 + +#define FACE_BOLD 1 +#define FACE_ITALIC 2 +#define FACE_SYMBOL 4 + +#define STRIKE_BITMAP(s, i) \ + ((s)->bitmaps[(i)/FONT_SEGMENT_SIZE] ? \ + (s)->bitmaps[(i)/FONT_SEGMENT_SIZE][(i)%FONT_SEGMENT_SIZE] : \ + NULL) + +#define SAME_METRICS(b1, b2) \ + ((b1)->advanceWidth == (b2)->advanceWidth && \ + (b1)->horiBearingX == (b2)->horiBearingX && \ + (b1)->horiBearingY == (b2)->horiBearingY && \ + (b1)->width == (b2)->width && \ + (b1)->height == (b2)->height) + +/* bit at (x, y) of raster r with stride s */ +#define BITREF(r, s, x, y) \ + (((r)[(y) * (s) + (x) / 8] & (1 << (7 - (x) % 8))) != 0) + +#define ONE_HALF (1 << 15) +#define TWO_SIXTEENTH (1 << 16) + +#define UNITS_PER_EM 2048 + +#define EPSILON 0.000000001 +#define FLOOR(x) ((x) < 0.0 ? -(int)(-(x)) : (x)) +#define CEIL(x) FLOOR((x) + 1.0 - EPSILON) + +/* Convert a fixed-point value into FUnits */ +#define FONT_UNITS(x) \ + FLOOR(((double)(x)) / TWO_SIXTEENTH * UNITS_PER_EM + 0.5) +#define FONT_UNITS_FLOOR(x) \ + FLOOR(((double)(x)) / TWO_SIXTEENTH * UNITS_PER_EM) +#define FONT_UNITS_CEIL(x) \ + CEIL(((double)(x)) / TWO_SIXTEENTH * UNITS_PER_EM) + +typedef struct _FontNameEntry { + int nid; /* name id */ + int size; /* bytes in value */ + char *value; +} FontNameEntryRec, *FontNameEntryPtr; + +typedef struct _Font { + int numNames; + struct _FontNameEntry *names; + int flags; + int weight; /* as in the OS/2 table */ + int width; /* as in the OS/2 table */ + int italicAngle; /* degrees c-clockwise from the vertical */ + int underlinePosition; + int underlineThickness; + unsigned foundry; + struct _Strike *strikes; +} FontRec, *FontPtr; + +typedef struct _Strike { + int sizeX; + int sizeY; + struct _Bitmap ***bitmaps; + struct _Strike *next; + int numSbits; + int bitmapSizeTableLocation; + int indexSubTableLocation; + struct _IndexSubTable *indexSubTables; +} StrikeRec, *StrikePtr; + +typedef struct _Bitmap { + int index; + int advanceWidth; + int horiBearingX; + int horiBearingY; + int width; + int height; + int stride; + char *raster; + int location; +} BitmapRec, *BitmapPtr; + +typedef struct _IndexSubTable { + int location; + int firstGlyphIndex; + int lastGlyphIndex; + int constantMetrics; + int lastLocation; + struct _IndexSubTable *next; +} IndexSubTableRec, *IndexSubTablePtr; + +typedef struct _Cmap { + int startCode; + int endCode; + int index; + struct _Cmap *next; + int maxindex; /* only in the head segment*/ + int *inverse; +} CmapRec, *CmapPtr; + +FontPtr makeFont(void); +StrikePtr makeStrike(FontPtr, int, int); +BitmapPtr makeBitmap(StrikePtr, int, + int, int, int, int, int, int, + unsigned char*, int); +IndexSubTablePtr makeIndexSubTables(StrikePtr, CmapPtr); +int fontIndex(FontPtr, int); +CmapPtr makeCmap(FontPtr); +int findIndex(CmapPtr, int); +int findCode(CmapPtr, int); +BitmapPtr strikeBitmapIndex(StrikePtr, CmapPtr, int); +void strikeMetrics(StrikePtr, int*, int*, int*, int*, int*); +int glyphMetrics(FontPtr, int, int*, int*, int*, int*, int*); +void fontMetrics(FontPtr, int*, int*, int*, int*, int*); +int maxIndex(CmapPtr); + +int readFile(char *filename, FontPtr); +int writeFile(char *filename, FontPtr); + +/* util.c */ + +#define PROP_ATOM 1 +#define PROP_INTEGER 2 +#define PROP_CARDINAL 3 + +char *sprintf_reliable(char *f, ...); +char *vsprintf_reliable(char *f, va_list args); +char *makeUTF16(char *); +unsigned makeName(char*); +int macTime(int *, unsigned *); +unsigned faceFoundry(FT_Face); +char *faceEncoding(FT_Face); +int faceFlags(FT_Face); +int faceWeight(FT_Face); +int faceWidth(FT_Face); +int faceItalicAngle(FT_Face); +int degreesToFraction(int, int*, int*); + +#endif /* _FONTTOSFNT_H_ */ diff --git a/app/fonttosfnt/fonttosfnt.man b/app/fonttosfnt/fonttosfnt.man new file mode 100644 index 000000000..5bc5ef274 --- /dev/null +++ b/app/fonttosfnt/fonttosfnt.man @@ -0,0 +1,78 @@ +.\" $XFree86$ +.TH FONTTOSFNT 1 __vendorversion__ +.SH NAME +fonttosfnt \- Wrap a bitmap font in a sfnt (TrueType) wrapper +.SH SYNOPSIS +.B fonttosfnt +[ +.I options +] +.B \-o +.I file.ttf +[ +.B \-\- +] +.IR font ... +.SH DESCRIPTION +Wrap a bitmap font or a set of bitmap fonts in a sfnt (TrueType or +OpenType) wrapper. +.SH OPTIONS +.TP +.B \-v +Be verbose. +.TP +.B \-c +Do not crop glyphs. This usually increases file size, but may +sometimes yield a modest decrease in file size for small character +cell fonts (terminal fonts). +.TP +.B \-b +Write byte-aligned glyph data. By default, bit-aligned data is +written, which yields a smaller file size. +.TP +.B \-r +Do not reencode fonts. By default, fonts are reencoded to Unicode +whenever possible. +.TP +.BI \-g " n" +Set the type of scalable glyphs that we write. If +.I n +is 0, no scalable glyphs are written; this is legal but confuses +most current software. If +.I n +is 1, a single scalable glyph (the undefined glyph) is written; this +is recommended, but triggers a bug in current versions of +.BR FreeType . +If +.I n +is 2 (the default), a sufficiently high number of blank glyphs are +written, which works with +.B FreeType +but increases file size. +.TP +.BI \-m " n" +Set the type of scalable metrics that we write. If +.I n +is 0, no scalable metrics are written, which may or may not be legal. +If +.I n +is 1, full metrics for a single glyph are written, and only left +sidebearing values are written for the other glyphs. If +.I n +is 2, scalable metrics for all glyphs are written, which increases +file size and is not recommended. The default is 1. +.TP +.B \-\- +End of options. +.SH BUGS +Some of the font-level values, notably sub- and superscript positions, +are dummy values. +.SH SEE ALSO +X(7), Xserver(1), Xft(3x). +.I Fonts in X. +.SH AUTHOR +The version of +.B Fonttosfnt +included in this X.Org Foundation release +was originally written by Juliusz Chroboczek +for the XFree86 project. diff --git a/app/fonttosfnt/install-sh b/app/fonttosfnt/install-sh new file mode 100644 index 000000000..4d4a9519e --- /dev/null +++ b/app/fonttosfnt/install-sh @@ -0,0 +1,323 @@ +#!/bin/sh +# install - install a program, script, or datafile + +scriptversion=2005-05-14.22 + +# This originates from X11R5 (mit/util/scripts/install.sh), which was +# later released in X11R6 (xc/config/util/install.sh) with the +# following copyright and license. +# +# Copyright (C) 1994 X Consortium +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC- +# TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +# +# Except as contained in this notice, the name of the X Consortium shall not +# be used in advertising or otherwise to promote the sale, use or other deal- +# ings in this Software without prior written authorization from the X Consor- +# tium. +# +# +# FSF changes to this file are in the public domain. +# +# Calling this script install-sh is preferred over install.sh, to prevent +# `make' implicit rules from creating a file called install from it +# when there is no Makefile. +# +# This script is compatible with the BSD install script, but was written +# from scratch. It can only install one file at a time, a restriction +# shared with many OS's install programs. + +# set DOITPROG to echo to test this script + +# Don't use :- since 4.3BSD and earlier shells don't like it. +doit="${DOITPROG-}" + +# put in absolute paths if you don't have them in your path; or use env. vars. + +mvprog="${MVPROG-mv}" +cpprog="${CPPROG-cp}" +chmodprog="${CHMODPROG-chmod}" +chownprog="${CHOWNPROG-chown}" +chgrpprog="${CHGRPPROG-chgrp}" +stripprog="${STRIPPROG-strip}" +rmprog="${RMPROG-rm}" +mkdirprog="${MKDIRPROG-mkdir}" + +chmodcmd="$chmodprog 0755" +chowncmd= +chgrpcmd= +stripcmd= +rmcmd="$rmprog -f" +mvcmd="$mvprog" +src= +dst= +dir_arg= +dstarg= +no_target_directory= + +usage="Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE + or: $0 [OPTION]... SRCFILES... DIRECTORY + or: $0 [OPTION]... -t DIRECTORY SRCFILES... + or: $0 [OPTION]... -d DIRECTORIES... + +In the 1st form, copy SRCFILE to DSTFILE. +In the 2nd and 3rd, copy all SRCFILES to DIRECTORY. +In the 4th, create DIRECTORIES. + +Options: +-c (ignored) +-d create directories instead of installing files. +-g GROUP $chgrpprog installed files to GROUP. +-m MODE $chmodprog installed files to MODE. +-o USER $chownprog installed files to USER. +-s $stripprog installed files. +-t DIRECTORY install into DIRECTORY. +-T report an error if DSTFILE is a directory. +--help display this help and exit. +--version display version info and exit. + +Environment variables override the default commands: + CHGRPPROG CHMODPROG CHOWNPROG CPPROG MKDIRPROG MVPROG RMPROG STRIPPROG +" + +while test -n "$1"; do + case $1 in + -c) shift + continue;; + + -d) dir_arg=true + shift + continue;; + + -g) chgrpcmd="$chgrpprog $2" + shift + shift + continue;; + + --help) echo "$usage"; exit $?;; + + -m) chmodcmd="$chmodprog $2" + shift + shift + continue;; + + -o) chowncmd="$chownprog $2" + shift + shift + continue;; + + -s) stripcmd=$stripprog + shift + continue;; + + -t) dstarg=$2 + shift + shift + continue;; + + -T) no_target_directory=true + shift + continue;; + + --version) echo "$0 $scriptversion"; exit $?;; + + *) # When -d is used, all remaining arguments are directories to create. + # When -t is used, the destination is already specified. + test -n "$dir_arg$dstarg" && break + # Otherwise, the last argument is the destination. Remove it from $@. + for arg + do + if test -n "$dstarg"; then + # $@ is not empty: it contains at least $arg. + set fnord "$@" "$dstarg" + shift # fnord + fi + shift # arg + dstarg=$arg + done + break;; + esac +done + +if test -z "$1"; then + if test -z "$dir_arg"; then + echo "$0: no input file specified." >&2 + exit 1 + fi + # It's OK to call `install-sh -d' without argument. + # This can happen when creating conditional directories. + exit 0 +fi + +for src +do + # Protect names starting with `-'. + case $src in + -*) src=./$src ;; + esac + + if test -n "$dir_arg"; then + dst=$src + src= + + if test -d "$dst"; then + mkdircmd=: + chmodcmd= + else + mkdircmd=$mkdirprog + fi + else + # Waiting for this to be detected by the "$cpprog $src $dsttmp" command + # might cause directories to be created, which would be especially bad + # if $src (and thus $dsttmp) contains '*'. + if test ! -f "$src" && test ! -d "$src"; then + echo "$0: $src does not exist." >&2 + exit 1 + fi + + if test -z "$dstarg"; then + echo "$0: no destination specified." >&2 + exit 1 + fi + + dst=$dstarg + # Protect names starting with `-'. + case $dst in + -*) dst=./$dst ;; + esac + + # If destination is a directory, append the input filename; won't work + # if double slashes aren't ignored. + if test -d "$dst"; then + if test -n "$no_target_directory"; then + echo "$0: $dstarg: Is a directory" >&2 + exit 1 + fi + dst=$dst/`basename "$src"` + fi + fi + + # This sed command emulates the dirname command. + dstdir=`echo "$dst" | sed -e 's,/*$,,;s,[^/]*$,,;s,/*$,,;s,^$,.,'` + + # Make sure that the destination directory exists. + + # Skip lots of stat calls in the usual case. + if test ! -d "$dstdir"; then + defaultIFS=' + ' + IFS="${IFS-$defaultIFS}" + + oIFS=$IFS + # Some sh's can't handle IFS=/ for some reason. + IFS='%' + set x `echo "$dstdir" | sed -e 's@/@%@g' -e 's@^%@/@'` + shift + IFS=$oIFS + + pathcomp= + + while test $# -ne 0 ; do + pathcomp=$pathcomp$1 + shift + if test ! -d "$pathcomp"; then + $mkdirprog "$pathcomp" + # mkdir can fail with a `File exist' error in case several + # install-sh are creating the directory concurrently. This + # is OK. + test -d "$pathcomp" || exit + fi + pathcomp=$pathcomp/ + done + fi + + if test -n "$dir_arg"; then + $doit $mkdircmd "$dst" \ + && { test -z "$chowncmd" || $doit $chowncmd "$dst"; } \ + && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } \ + && { test -z "$stripcmd" || $doit $stripcmd "$dst"; } \ + && { test -z "$chmodcmd" || $doit $chmodcmd "$dst"; } + + else + dstfile=`basename "$dst"` + + # Make a couple of temp file names in the proper directory. + dsttmp=$dstdir/_inst.$$_ + rmtmp=$dstdir/_rm.$$_ + + # Trap to clean up those temp files at exit. + trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0 + trap '(exit $?); exit' 1 2 13 15 + + # Copy the file name to the temp name. + $doit $cpprog "$src" "$dsttmp" && + + # and set any options; do chmod last to preserve setuid bits. + # + # If any of these fail, we abort the whole thing. If we want to + # ignore errors from any of these, just make sure not to ignore + # errors from the above "$doit $cpprog $src $dsttmp" command. + # + { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } \ + && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } \ + && { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } \ + && { test -z "$chmodcmd" || $doit $chmodcmd "$dsttmp"; } && + + # Now rename the file to the real destination. + { $doit $mvcmd -f "$dsttmp" "$dstdir/$dstfile" 2>/dev/null \ + || { + # The rename failed, perhaps because mv can't rename something else + # to itself, or perhaps because mv is so ancient that it does not + # support -f. + + # Now remove or move aside any old file at destination location. + # We try this two ways since rm can't unlink itself on some + # systems and the destination file might be busy for other + # reasons. In this case, the final cleanup might fail but the new + # file should still install successfully. + { + if test -f "$dstdir/$dstfile"; then + $doit $rmcmd -f "$dstdir/$dstfile" 2>/dev/null \ + || $doit $mvcmd -f "$dstdir/$dstfile" "$rmtmp" 2>/dev/null \ + || { + echo "$0: cannot unlink or rename $dstdir/$dstfile" >&2 + (exit 1); exit 1 + } + else + : + fi + } && + + # Now rename the file to the real destination. + $doit $mvcmd "$dsttmp" "$dstdir/$dstfile" + } + } + fi || { (exit 1); exit 1; } +done + +# The final little trick to "correctly" pass the exit status to the exit trap. +{ + (exit 0); exit 0 +} + +# Local variables: +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-end: "$" +# End: diff --git a/app/fonttosfnt/missing b/app/fonttosfnt/missing new file mode 100644 index 000000000..894e786e1 --- /dev/null +++ b/app/fonttosfnt/missing @@ -0,0 +1,360 @@ +#! /bin/sh +# Common stub for a few missing GNU programs while installing. + +scriptversion=2005-06-08.21 + +# Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005 +# Free Software Foundation, Inc. +# Originally by Fran,cois Pinard , 1996. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +# 02110-1301, USA. + +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +if test $# -eq 0; then + echo 1>&2 "Try \`$0 --help' for more information" + exit 1 +fi + +run=: + +# In the cases where this matters, `missing' is being run in the +# srcdir already. +if test -f configure.ac; then + configure_ac=configure.ac +else + configure_ac=configure.in +fi + +msg="missing on your system" + +case "$1" in +--run) + # Try to run requested program, and just exit if it succeeds. + run= + shift + "$@" && exit 0 + # Exit code 63 means version mismatch. This often happens + # when the user try to use an ancient version of a tool on + # a file that requires a minimum version. In this case we + # we should proceed has if the program had been absent, or + # if --run hadn't been passed. + if test $? = 63; then + run=: + msg="probably too old" + fi + ;; + + -h|--h|--he|--hel|--help) + echo "\ +$0 [OPTION]... PROGRAM [ARGUMENT]... + +Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an +error status if there is no known handling for PROGRAM. + +Options: + -h, --help display this help and exit + -v, --version output version information and exit + --run try to run the given command, and emulate it if it fails + +Supported PROGRAM values: + aclocal touch file \`aclocal.m4' + autoconf touch file \`configure' + autoheader touch file \`config.h.in' + automake touch all \`Makefile.in' files + bison create \`y.tab.[ch]', if possible, from existing .[ch] + flex create \`lex.yy.c', if possible, from existing .c + help2man touch the output file + lex create \`lex.yy.c', if possible, from existing .c + makeinfo touch the output file + tar try tar, gnutar, gtar, then tar without non-portable flags + yacc create \`y.tab.[ch]', if possible, from existing .[ch] + +Send bug reports to ." + exit $? + ;; + + -v|--v|--ve|--ver|--vers|--versi|--versio|--version) + echo "missing $scriptversion (GNU Automake)" + exit $? + ;; + + -*) + echo 1>&2 "$0: Unknown \`$1' option" + echo 1>&2 "Try \`$0 --help' for more information" + exit 1 + ;; + +esac + +# Now exit if we have it, but it failed. Also exit now if we +# don't have it and --version was passed (most likely to detect +# the program). +case "$1" in + lex|yacc) + # Not GNU programs, they don't have --version. + ;; + + tar) + if test -n "$run"; then + echo 1>&2 "ERROR: \`tar' requires --run" + exit 1 + elif test "x$2" = "x--version" || test "x$2" = "x--help"; then + exit 1 + fi + ;; + + *) + if test -z "$run" && ($1 --version) > /dev/null 2>&1; then + # We have it, but it failed. + exit 1 + elif test "x$2" = "x--version" || test "x$2" = "x--help"; then + # Could not run --version or --help. This is probably someone + # running `$TOOL --version' or `$TOOL --help' to check whether + # $TOOL exists and not knowing $TOOL uses missing. + exit 1 + fi + ;; +esac + +# If it does not exist, or fails to run (possibly an outdated version), +# try to emulate it. +case "$1" in + aclocal*) + echo 1>&2 "\ +WARNING: \`$1' is $msg. You should only need it if + you modified \`acinclude.m4' or \`${configure_ac}'. You might want + to install the \`Automake' and \`Perl' packages. Grab them from + any GNU archive site." + touch aclocal.m4 + ;; + + autoconf) + echo 1>&2 "\ +WARNING: \`$1' is $msg. You should only need it if + you modified \`${configure_ac}'. You might want to install the + \`Autoconf' and \`GNU m4' packages. Grab them from any GNU + archive site." + touch configure + ;; + + autoheader) + echo 1>&2 "\ +WARNING: \`$1' is $msg. You should only need it if + you modified \`acconfig.h' or \`${configure_ac}'. You might want + to install the \`Autoconf' and \`GNU m4' packages. Grab them + from any GNU archive site." + files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}` + test -z "$files" && files="config.h" + touch_files= + for f in $files; do + case "$f" in + *:*) touch_files="$touch_files "`echo "$f" | + sed -e 's/^[^:]*://' -e 's/:.*//'`;; + *) touch_files="$touch_files $f.in";; + esac + done + touch $touch_files + ;; + + automake*) + echo 1>&2 "\ +WARNING: \`$1' is $msg. You should only need it if + you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'. + You might want to install the \`Automake' and \`Perl' packages. + Grab them from any GNU archive site." + find . -type f -name Makefile.am -print | + sed 's/\.am$/.in/' | + while read f; do touch "$f"; done + ;; + + autom4te) + echo 1>&2 "\ +WARNING: \`$1' is needed, but is $msg. + You might have modified some files without having the + proper tools for further handling them. + You can get \`$1' as part of \`Autoconf' from any GNU + archive site." + + file=`echo "$*" | sed -n 's/.*--output[ =]*\([^ ]*\).*/\1/p'` + test -z "$file" && file=`echo "$*" | sed -n 's/.*-o[ ]*\([^ ]*\).*/\1/p'` + if test -f "$file"; then + touch $file + else + test -z "$file" || exec >$file + echo "#! /bin/sh" + echo "# Created by GNU Automake missing as a replacement of" + echo "# $ $@" + echo "exit 0" + chmod +x $file + exit 1 + fi + ;; + + bison|yacc) + echo 1>&2 "\ +WARNING: \`$1' $msg. You should only need it if + you modified a \`.y' file. You may need the \`Bison' package + in order for those modifications to take effect. You can get + \`Bison' from any GNU archive site." + rm -f y.tab.c y.tab.h + if [ $# -ne 1 ]; then + eval LASTARG="\${$#}" + case "$LASTARG" in + *.y) + SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'` + if [ -f "$SRCFILE" ]; then + cp "$SRCFILE" y.tab.c + fi + SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'` + if [ -f "$SRCFILE" ]; then + cp "$SRCFILE" y.tab.h + fi + ;; + esac + fi + if [ ! -f y.tab.h ]; then + echo >y.tab.h + fi + if [ ! -f y.tab.c ]; then + echo 'main() { return 0; }' >y.tab.c + fi + ;; + + lex|flex) + echo 1>&2 "\ +WARNING: \`$1' is $msg. You should only need it if + you modified a \`.l' file. You may need the \`Flex' package + in order for those modifications to take effect. You can get + \`Flex' from any GNU archive site." + rm -f lex.yy.c + if [ $# -ne 1 ]; then + eval LASTARG="\${$#}" + case "$LASTARG" in + *.l) + SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'` + if [ -f "$SRCFILE" ]; then + cp "$SRCFILE" lex.yy.c + fi + ;; + esac + fi + if [ ! -f lex.yy.c ]; then + echo 'main() { return 0; }' >lex.yy.c + fi + ;; + + help2man) + echo 1>&2 "\ +WARNING: \`$1' is $msg. You should only need it if + you modified a dependency of a manual page. You may need the + \`Help2man' package in order for those modifications to take + effect. You can get \`Help2man' from any GNU archive site." + + file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'` + if test -z "$file"; then + file=`echo "$*" | sed -n 's/.*--output=\([^ ]*\).*/\1/p'` + fi + if [ -f "$file" ]; then + touch $file + else + test -z "$file" || exec >$file + echo ".ab help2man is required to generate this page" + exit 1 + fi + ;; + + makeinfo) + echo 1>&2 "\ +WARNING: \`$1' is $msg. You should only need it if + you modified a \`.texi' or \`.texinfo' file, or any other file + indirectly affecting the aspect of the manual. The spurious + call might also be the consequence of using a buggy \`make' (AIX, + DU, IRIX). You might want to install the \`Texinfo' package or + the \`GNU make' package. Grab either from any GNU archive site." + # The file to touch is that specified with -o ... + file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'` + if test -z "$file"; then + # ... or it is the one specified with @setfilename ... + infile=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'` + file=`sed -n '/^@setfilename/ { s/.* \([^ ]*\) *$/\1/; p; q; }' $infile` + # ... or it is derived from the source name (dir/f.texi becomes f.info) + test -z "$file" && file=`echo "$infile" | sed 's,.*/,,;s,.[^.]*$,,'`.info + fi + # If the file does not exist, the user really needs makeinfo; + # let's fail without touching anything. + test -f $file || exit 1 + touch $file + ;; + + tar) + shift + + # We have already tried tar in the generic part. + # Look for gnutar/gtar before invocation to avoid ugly error + # messages. + if (gnutar --version > /dev/null 2>&1); then + gnutar "$@" && exit 0 + fi + if (gtar --version > /dev/null 2>&1); then + gtar "$@" && exit 0 + fi + firstarg="$1" + if shift; then + case "$firstarg" in + *o*) + firstarg=`echo "$firstarg" | sed s/o//` + tar "$firstarg" "$@" && exit 0 + ;; + esac + case "$firstarg" in + *h*) + firstarg=`echo "$firstarg" | sed s/h//` + tar "$firstarg" "$@" && exit 0 + ;; + esac + fi + + echo 1>&2 "\ +WARNING: I can't seem to be able to run \`tar' with the given arguments. + You may want to install GNU tar or Free paxutils, or check the + command line arguments." + exit 1 + ;; + + *) + echo 1>&2 "\ +WARNING: \`$1' is needed, and is $msg. + You might have modified some files without having the + proper tools for further handling them. Check the \`README' file, + it often tells you about the needed prerequisites for installing + this package. You may also peek at any GNU archive site, in case + some other package would contain this missing \`$1' program." + exit 1 + ;; +esac + +exit 0 + +# Local variables: +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-end: "$" +# End: diff --git a/app/fonttosfnt/read.c b/app/fonttosfnt/read.c new file mode 100644 index 000000000..501bc339a --- /dev/null +++ b/app/fonttosfnt/read.c @@ -0,0 +1,318 @@ +/* $XdotOrg: xc/programs/fonttosfnt/read.c,v 1.2 2004/04/23 19:54:32 eich Exp $ */ +/* +Copyright (c) 2002 by Juliusz Chroboczek + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +*/ +/* $XdotOrg: xc/programs/fonttosfnt/read.c,v 1.2 2004/04/23 19:54:32 eich Exp $ */ +/* $XFree86: xc/programs/fonttosfnt/read.c,v 1.5 2003/12/19 02:05:39 dawes Exp $ */ + +#include + +#include +#include FT_FREETYPE_H +#include FT_BDF_H +#include "X11/Xos.h" +#include "fonttosfnt.h" +#include "X11/fonts/fontenc.h" + +#define FLOOR2(x, y) ((x) >= 0 ? (x) / (y) : -(((-(x)) + (y) - 1) / (y))) +#define CEIL2(x, y) (FLOOR2((x) + (y) - 1, (y))) +#define FT_Pos_DOWN(x) (FLOOR2((x),64)) +#define FT_Pos_UP(x) (CEIL2((x), 64)) + +static int ft_inited = 0; +static FT_Library ft_library; + +static int +FT_Ensure_Inited(void) +{ + int rc; + if(ft_inited) + return 0; + + rc = FT_Init_FreeType(&ft_library); + if(rc != 0) + return rc; + + ft_inited = 1; + return 0; +} + +int +readFile(char *filename, FontPtr font) +{ + int i, j, k, index; + int rc; + FT_Face face; + StrikePtr strike; + BitmapPtr bitmap; + int symbol = 0; + char *encoding_name = NULL; + FontMapPtr mapping = NULL; + FontMapReversePtr reverse = NULL; + + + rc = FT_Ensure_Inited(); + if(rc != 0) + return rc; + + rc = FT_New_Face(ft_library, filename, 0, &face); + if(rc != 0) { + fprintf(stderr, "Couldn't open face %s.\n", filename); + return -1; + } + + encoding_name = faceEncoding(face); + if(encoding_name == NULL) { + symbol = 1; + } else if(strcasecmp(encoding_name, "iso10646-1") != 0) { + if(reencode_flag) + mapping = FontEncMapFind(encoding_name, + FONT_ENCODING_UNICODE, 0, 0, NULL); + if(mapping == NULL) { + symbol = 1; + } else { + reverse = FontMapReverse(mapping); + if(reverse == NULL) { + fprintf(stderr, "Couldn't reverse mapping.\n"); + return -1; + } + } + } + + if(verbose_flag) { + fprintf(stderr, "%s %s %s: %d sizes%s\n", + filename, face->family_name, face->style_name, + face->num_fixed_sizes, + symbol ? " (symbol)" : ""); + } + + if(font->numNames == 0 && face->style_name && face->family_name) { + char *full_name, *unique_name; + BDF_PropertyRec prop; + int rc, i; + if(strcmp(face->style_name, "Regular") == 0) + full_name = sprintf_reliable("%s", face->family_name); + else + full_name = sprintf_reliable("%s %s", + face->family_name, face->style_name); + + /* The unique name doesn't actually need to be globally + unique; it only needs to be unique among all installed fonts on a + Windows system. We don't bother getting it quite right. */ + if(face->num_fixed_sizes <= 0) + unique_name = sprintf_reliable("%s "XVENDORNAMESHORT" bitmap" + , full_name); + else if(face->available_sizes[0].width == + face->available_sizes[0].height) + unique_name = sprintf_reliable("%s "XVENDORNAMESHORT + " bitmap size %d", + full_name, + face->available_sizes[0].height); + else + unique_name = sprintf_reliable("%s "XVENDORNAMESHORT + " bitmap size %dx%d", + full_name, + face->available_sizes[0].width, + face->available_sizes[0].height); + + font->names = malloc(10 * sizeof(FontNameEntryRec)); + if(font->names == NULL) { + fprintf(stderr, "Couldn't allocate names.\n"); + return -1; + } + i = 0; + + rc = FT_Get_BDF_Property(face, "COPYRIGHT", &prop); + if(rc == 0 && prop.type == BDF_PROPERTY_TYPE_ATOM) { + font->names[i].nid = 0; + font->names[i].size = 2 * strlen(prop.u.atom); + font->names[i].value = makeUTF16((char*)prop.u.atom); + i++; + } + + font->names[i].nid = 1; + font->names[i].size = 2 * strlen(face->family_name); + font->names[i].value = makeUTF16(face->family_name); + i++; + + font->names[i].nid = 2; + font->names[i].size = 2 * strlen(face->style_name); + font->names[i].value = makeUTF16(face->style_name); + i++; + + font->names[i].nid = 3; + font->names[i].size = 2 * strlen(unique_name); + font->names[i].value = makeUTF16(unique_name); + i++; + + font->names[i].nid = 4; + font->names[i].size = 2 * strlen(full_name); + font->names[i].value = makeUTF16(full_name); + i++; + + font->names[i].nid = 5; + font->names[i].size = 2 * strlen("Version 0.0"); + font->names[i].value = makeUTF16("Version 0.0"); + i++; + + rc = FT_Get_BDF_Property(face, "FOUNDRY", &prop); + if(rc == 0 && prop.type == BDF_PROPERTY_TYPE_ATOM) { + font->names[i].nid = 8; + font->names[i].size = 2 * strlen(prop.u.atom); + font->names[i].value = makeUTF16((char*)prop.u.atom); + i++; + } + + font->names[i].nid = 10; + font->names[i].size = 2 * strlen(XVENDORNAMESHORT + " converted bitmap font"); + font->names[i].value = makeUTF16(XVENDORNAMESHORT + "X converted bitmap font"); + i++; +#ifdef __VENDORWEBSUPPORT__ + font->names[i].nid = 11; + font->names[i].size = 2 * strlen(__VENDORWEBSUPPORT__); + font->names[i].value = makeUTF16(__VENDORWEBSUPPORT__); + i++; +#endif + font->numNames = i; + + font->flags = faceFlags(face) | (symbol ? FACE_SYMBOL : 0); + font->weight = faceWeight(face); + font->width = faceWidth(face); + font->foundry = faceFoundry(face); + font->italicAngle = faceItalicAngle(face); + + rc = FT_Get_BDF_Property(face, "UNDERLINE_POSITION", &prop); + if(rc == 0 && prop.type == BDF_PROPERTY_TYPE_INTEGER) + font->underlinePosition = + (double)prop.u.integer / face->available_sizes[0].height * + TWO_SIXTEENTH; + else + font->underlinePosition = + - 1.5 / face->available_sizes[0].height * TWO_SIXTEENTH; + + rc = FT_Get_BDF_Property(face, "UNDERLINE_THICKNESS", &prop); + if(rc == 0 && prop.type == BDF_PROPERTY_TYPE_INTEGER) + font->underlineThickness = + (double)prop.u.integer / face->available_sizes[0].height * + TWO_SIXTEENTH; + else + font->underlineThickness = + 1.0 / face->available_sizes[0].height * TWO_SIXTEENTH; + } + + if(face->num_fixed_sizes == 0) { + fprintf(stderr, "No bitmaps in face.\n"); + return -1; + } + + if(!symbol && !mapping) + rc = FT_Select_Charmap(face, ft_encoding_unicode); + else + rc = FT_Select_Charmap(face, ft_encoding_none); + if(rc != 0) { + fprintf(stderr, "Couldn't select character map: %x.\n", rc); + return -1; + } + + for(i = 0; i < face->num_fixed_sizes; i++) { + if(verbose_flag) + fprintf(stderr, "size %d: %dx%d\n", + i, + face->available_sizes[i].width, + face->available_sizes[i].height); + + rc = FT_Set_Pixel_Sizes(face, + face->available_sizes[i].width, + face->available_sizes[i].height); + if(rc != 0) { + fprintf(stderr, "Couldn't set size.\n"); + return -1; + } + + strike = makeStrike(font, + face->available_sizes[i].width, + face->available_sizes[i].height); + if(strike == NULL) { + fprintf(stderr, "Couldn't allocate strike.\n"); + return -1; + } + + for(j = 0; j < FONT_CODES; j++) { + if(mapping) + k = reverse->reverse(j, reverse->data); + else + k = j; + if(k <= 0 && j != 0) + continue; + index = FT_Get_Char_Index(face, k); + if(j != 0 && index == 0) + continue; + rc = FT_Load_Glyph(face, index, + FT_LOAD_RENDER | FT_LOAD_MONOCHROME); + if(rc != 0) { + fprintf(stderr, "Couldn't load glyph for U+%04X (%d)\n", + j, index); + continue; + } + bitmap = makeBitmap(strike, j, + FT_Pos_UP(face->glyph->metrics.horiAdvance), + FT_Pos_DOWN(face->glyph->metrics.horiBearingX), + FT_Pos_DOWN(face->glyph->metrics.horiBearingY), + face->glyph->bitmap.width, + face->glyph->bitmap.rows, + face->glyph->bitmap.pitch, + face->glyph->bitmap.buffer, + crop_flag); + + if(bitmap == NULL) { + fprintf(stderr, "Couldn't create bitmap.\n"); + return -1; + } + } + } + + FT_Done_Face(face); + + j = 0; + for(i = 0; i < FONT_CODES; i++) { + int found = 0; + strike = font->strikes; + while(strike) { + bitmap = STRIKE_BITMAP(strike, i); + if(bitmap) { + bitmap->index = j; + found = 1; + } else { + if(i == 0) { + fprintf(stderr, + "Warning: no bitmap for the undefined glyph.\n"); + found = 1; + } + } + strike = strike->next; + } + if(found) + j++; + } + return 0; +} diff --git a/app/fonttosfnt/struct.c b/app/fonttosfnt/struct.c new file mode 100644 index 000000000..2d346e605 --- /dev/null +++ b/app/fonttosfnt/struct.c @@ -0,0 +1,514 @@ +/* +Copyright (c) 2002-2003 by Juliusz Chroboczek + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +*/ +/* $XFree86: xc/programs/fonttosfnt/struct.c,v 1.3 2003/10/24 20:38:11 tsi Exp $ */ + +#include +#include +#include +#include FT_FREETYPE_H +#include "fonttosfnt.h" + +FontPtr +makeFont() +{ + FontPtr font; + + font = malloc(sizeof(FontRec)); + if(font == NULL) + return NULL; + + font->numNames = 0; + font->names = NULL; + font->flags = 0; + font->weight = 500; + font->width = 5; + font->italicAngle = 0; + font->underlinePosition = - TWO_SIXTEENTH; + font->underlineThickness = TWO_SIXTEENTH; + font->foundry = makeName("UNKN"); + font->strikes = NULL; + return font; +} + +StrikePtr +makeStrike(FontPtr font, int sizeX, int sizeY) +{ + StrikePtr strike, last_strike; + + strike = font->strikes; + last_strike = NULL; + while(strike) { + if(strike->sizeX == sizeX && strike->sizeY == sizeY) + return strike; + last_strike = strike; + strike = strike->next; + } + + strike = malloc(sizeof(StrikeRec)); + if(strike == NULL) + return NULL; + strike->sizeX = sizeX; + strike->sizeY = sizeY; + strike->bitmaps = + calloc(FONT_CODES / FONT_SEGMENT_SIZE, sizeof(BitmapPtr*)); + if(strike->bitmaps == NULL) { + free(strike); + return NULL; + } + strike->numSbits = 0; + strike->next = NULL; + strike->bitmapSizeTableLocation = 0xDEADFACE; + strike->indexSubTables = NULL; + if(last_strike) + last_strike->next = strike; + else + font->strikes = strike; + return strike; +} + +BitmapPtr +makeBitmap(StrikePtr strike, int code, + int advanceWidth, int horiBearingX, int horiBearingY, + int width, int height, int stride, unsigned char *raster, int crop) +{ + BitmapPtr bitmap; + int i, j, x, y; + int dx, dy, new_width, new_height; + + bitmap = malloc(sizeof(BitmapRec)); + if(bitmap == NULL) + return NULL; + + bitmap->index = -1; + bitmap->width = 0; + bitmap->height = 0; + bitmap->stride = 0; + bitmap->raster = NULL; + bitmap->location = 0xDEADFACE; + + i = code / FONT_SEGMENT_SIZE; + j = code % FONT_SEGMENT_SIZE; + + if(strike->bitmaps[i] == NULL) { + strike->bitmaps[i] = calloc(FONT_SEGMENT_SIZE, sizeof(BitmapPtr)); + } + if(strike->bitmaps[i] == NULL) { + free(bitmap); + return NULL; + } + if(strike->bitmaps[i][j] != NULL) { + if(verbose_flag) + fprintf(stderr, "Duplicate bitmap %d.\n", code); + free(bitmap); + return strike->bitmaps[i][j]; + } + + dx = 0; + dy = 0; + new_width = width; + new_height = height; + + if(crop) { + int empty; + while(new_width > 0) { + empty = 1; + x = new_width - 1; + for(y = 0; y < new_height; y++) { + if(BITREF(raster, stride, x + dx, y + dy)) { + empty = 0; + break; + } + } + if(empty) + new_width--; + else + break; + } + while(new_height > 0) { + empty = 1; + y = new_height - 1; + for(x = 0; x < new_width; x++) { + if(BITREF(raster, stride, x + dx, y + dy)) { + empty = 0; + break; + } + } + if(empty) + new_height--; + else + break; + } + while(new_width > 0) { + empty = 1; + x = 0; + for(y = 0; y < new_height; y++) { + if(BITREF(raster, stride, x + dx, y + dy)) { + empty = 0; + break; + } + } + if(empty) { + dx++; + new_width--; + } else + break; + } + while(new_height > 0) { + empty = 1; + y = 0; + for(x = 0; x < new_width; x++) { + if(BITREF(raster, stride, x + dx, y + dy)) { + empty = 0; + break; + } + } + if(empty) { + dy++; + new_height--; + } else + break; + } + } + + + bitmap->advanceWidth = advanceWidth; + bitmap->horiBearingX = horiBearingX + dx; + bitmap->horiBearingY = horiBearingY - dy; + bitmap->width = new_width; + bitmap->height = new_height; + bitmap->stride = (new_width + 7) / 8; + + bitmap->raster = malloc(bitmap->height * bitmap->stride); + if(bitmap->raster == NULL) { + free(bitmap); + return NULL; + } + memset(bitmap->raster, 0, bitmap->height * bitmap->stride); + for(y = 0; y < new_height; y++) { + for(x = 0; x < new_width; x++) { + if(BITREF(raster, stride, x + dx, y + dy)) + bitmap->raster[y * bitmap->stride + x / 8] |= + 1 << (7 - (x % 8)); + } + } + strike->bitmaps[i][j] = bitmap; + strike->numSbits++; + + return bitmap; +} + +IndexSubTablePtr +makeIndexSubTables(StrikePtr strike, CmapPtr cmap) +{ + IndexSubTablePtr table, first, last; + BitmapPtr bitmap0, bitmap; + int index, n; + + first = NULL; + last = NULL; + + /* Assuming that we're writing bit-aligned data, small metrics + and short offsets, a constant metrics segment saves 5 bytes + per glyph in the EBDT table, and 2 bytes per glyph in the EBLC + table. On the other hand, the overhead for a supplementary + type 2 indexSubTable is 8 bytes for the indexSubTableArray + entry and 20 bytes for the subtable itself. It's worth + splitting at 5 glyphs. There's no analogue of a type 2 + indexSubTable with byte-aligned data, so we don't bother + splitting when byte-aligning. */ + index = 0; + while(index < 0xFFFF) { + int constantMetrics = 1; + bitmap0 = strikeBitmapIndex(strike, cmap, index); + if(bitmap0 == NULL) { + index++; + continue; + } + n = 1; + while((bitmap = strikeBitmapIndex(strike, cmap, index + n)) != NULL) { + if(constantMetrics) { + if(!SAME_METRICS(bitmap0, bitmap)) { + if(bit_aligned_flag && n >= 4) + break; + else + constantMetrics = 0; + } + } else if(bit_aligned_flag) { + BitmapPtr b1 = strikeBitmapIndex(strike, cmap, index + n + 1); + BitmapPtr b2 = strikeBitmapIndex(strike, cmap, index + n + 2); + BitmapPtr b3 = strikeBitmapIndex(strike, cmap, index + n + 3); + BitmapPtr b4 = strikeBitmapIndex(strike, cmap, index + n + 4); + if(b1 && b2 && b3 && b4 && + SAME_METRICS(bitmap, b1) && + SAME_METRICS(bitmap, b2) && + SAME_METRICS(bitmap, b3) && + SAME_METRICS(bitmap, b4)) { + break; + } + } + n++; + } + if(n <= 1) + constantMetrics = 0; + + table = malloc(sizeof(IndexSubTableRec)); + table->firstGlyphIndex = index; + table->lastGlyphIndex = index + n - 1; + table->constantMetrics = constantMetrics; + table->location = 0xDEADFACE; + table->lastLocation = 0xDEADFACE; + table->next = NULL; + + if(first == NULL) { + first = table; + last = table; + } else { + last->next = table; + last = table; + } + index += n; + } + return first; +} + +int +fontIndex(FontPtr font, int code) +{ + StrikePtr strike; + BitmapPtr bitmap; + + if(code == 0) + return 0; + strike = font->strikes; + while(strike) { + bitmap = STRIKE_BITMAP(strike, code); + if(bitmap) + return bitmap->index; + strike = strike->next; + } + return -1; +} + +CmapPtr +makeCmap(FontPtr font) +{ + CmapPtr cmap_head = NULL; + CmapPtr cmap_last = NULL; + CmapPtr cmap; + int code, i, index, maxindex = 0; + + code = 0; + while(code < FONT_CODES) { + index = fontIndex(font, code); + if(index < 0) { + code++; + continue; + } + i = 1; + while(code + i < FONT_CODES && + fontIndex(font, code + i) == index + i) { + i++; + } + cmap = malloc(sizeof(CmapRec)); + if(cmap == NULL) + return NULL; + cmap->startCode = code; + cmap->endCode = code + i - 1; + cmap->index = index; + cmap->next = NULL; + cmap->maxindex = 0; + if(maxindex < index + i - 1) + maxindex = index + i - 1; + if(cmap_head == NULL) + cmap_head = cmap; + else + cmap_last->next = cmap; + cmap_last = cmap; + + code += i; + } + cmap_head->maxindex = maxindex; + cmap_head->inverse = calloc(maxindex + 1, sizeof(int)); + cmap = cmap_head; + while(cmap) { + for(i = cmap->index; + i <= cmap->endCode - cmap->startCode + cmap->index; i++) { + cmap_head->inverse[i] = + i - cmap->index + cmap->startCode; + } + cmap = cmap->next; + } + + return cmap_head; +} + +int +findIndex(CmapPtr cmap_head, int code) +{ + CmapPtr cmap; + cmap = cmap_head; + while(cmap) { + if(cmap->endCode > code) + return -1; + if(cmap->startCode <= code) + return cmap->index + code - cmap->startCode; + cmap = cmap->next; + } + return -1; +} + +int +findCode(CmapPtr cmap_head, int index) +{ + if(index < 0 || index > cmap_head->maxindex) + return -1; + return cmap_head->inverse[index]; + +} + +int +maxIndex(CmapPtr cmap_head) +{ + return cmap_head->maxindex; +} + +BitmapPtr +strikeBitmapIndex(StrikePtr strike, CmapPtr cmap, int index) +{ + int code = findCode(cmap, index); + if(code < 0) + return NULL; + + return STRIKE_BITMAP(strike, code); +} + +void +strikeMetrics(StrikePtr strike, + int *width_max_return, + int *x_min_return, int *y_min_return, + int *x_max_return, int *y_max_return) +{ + BitmapPtr bitmap; + int i; + int width_max = 0; + int x_min = 10000; + int y_min = 10000; + int x_max = -10000; + int y_max = -10000; + + for(i = 0; i < FONT_CODES; i++) { + bitmap = STRIKE_BITMAP(strike, i); + if(!bitmap) + continue; + if(bitmap->advanceWidth > width_max) + width_max = bitmap->advanceWidth; + if(bitmap->horiBearingX < x_min) + x_min = bitmap->horiBearingX; + if(bitmap->horiBearingY > y_max) + y_max = bitmap->horiBearingY; + if(bitmap->horiBearingX + bitmap->width > x_max) + x_max = bitmap->horiBearingX + bitmap->width; + if(bitmap->horiBearingY - bitmap->height < y_min) + y_min = bitmap->horiBearingY - bitmap->height; + } + + if(width_max_return) *width_max_return = width_max; + if(x_min_return) *x_min_return = x_min; + if(y_min_return) *y_min_return = y_min; + if(x_max_return) *x_max_return = x_max; + if(y_max_return) *y_max_return = y_max; +} + +int +glyphMetrics(FontPtr font, int code, + int *width_return, + int *x_min_return, int *y_min_return, + int *x_max_return, int *y_max_return) +{ + StrikePtr strike; + BitmapPtr bitmap; + + strike = font->strikes; + while(strike) { + bitmap = STRIKE_BITMAP(strike, code); + if(bitmap) { + if(width_return) + *width_return = + (((float)bitmap->advanceWidth + 0.5) / strike->sizeX) * + TWO_SIXTEENTH; + if(x_min_return) + *x_min_return = + ((float)bitmap->horiBearingX / strike->sizeX) * + TWO_SIXTEENTH; + if(y_min_return) + *y_min_return = + (((float)bitmap->horiBearingY - bitmap->height) + / strike->sizeY) * TWO_SIXTEENTH; + /* For the following two, 0.9 instead of 0.5 might make + more sense. However, using different rounding rules + for x_max and awidth causes problems for detecting + charcell fonts. */ + if(x_max_return) + *x_max_return = + (((float)bitmap->horiBearingX + bitmap->width + 0.5) + / strike->sizeX) * TWO_SIXTEENTH; + if(y_max_return) + *y_max_return = + (((float)bitmap->horiBearingY + 0.5) / strike->sizeY) * + TWO_SIXTEENTH; + return 1; + } + strike = strike->next; + } + + return -1; +} + +void +fontMetrics(FontPtr font, + int *max_awidth_return, + int *min_x_return, int *min_y_return, + int *max_x_return, int *max_y_return) +{ + int i, rc; + int max_awidth = 0; + int min_x = 10000 << 16, min_y = 10000 << 16; + int max_x = -10000 << 16, max_y = -10000 << 16; + for(i = 0; i < FONT_CODES; i++) { + int awidth, x0, y0, x1, y1; + rc = glyphMetrics(font, i, &awidth, &x0, &y0, &x1, &y1); + if(rc < 0) + continue; + if(awidth > max_awidth) + max_awidth = awidth; + if(x0 < min_x) min_x = x0; + if(y0 < min_y) min_y = y0; + if(x1 > max_x) max_x = x1; + if(y1 > max_y) max_y = y1; + } + if(max_awidth_return) *max_awidth_return = max_awidth; + if(min_x_return) *min_x_return = min_x; + if(min_y_return) *min_y_return = min_y; + if(max_x_return) *max_x_return = max_x; + if(max_y_return) *max_y_return = max_y; +} + diff --git a/app/fonttosfnt/util.c b/app/fonttosfnt/util.c new file mode 100644 index 000000000..2d0d1c0ae --- /dev/null +++ b/app/fonttosfnt/util.c @@ -0,0 +1,416 @@ +/* +Copyright (c) 2002-2003 by Juliusz Chroboczek + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +*/ +/* $XdotOrg: xc/programs/fonttosfnt/util.c,v 1.11 2003/12/19 02:16:36 dawes Exp $ */ +/* $XFree86: xc/programs/fonttosfnt/util.c,v 1.10 2003/12/19 02:05:39 dawes Exp $ */ + +#include +#include +#include +#include +#ifndef __UNIXOS2__ +# include +#else +# include +#endif +#include + +#include +#include FT_FREETYPE_H +#include FT_BDF_H +#include "X11/Xos.h" +#include "fonttosfnt.h" + +#ifdef NEED_SNPRINTF +#undef SCOPE +#define SCOPE static +#include "snprintf.c" +#endif + +#ifdef __GLIBC__ +#define HAVE_TIMEGM +#define HAVE_TM_GMTOFF +#endif + +#ifdef BSD +#define HAVE_TM_GMTOFF +#define GMTOFFMEMBER tm_gmtoff +#endif + +#ifdef __SCO__ +#define HAVE_TM_GMTOFF +#define GMTOFFMEMBER tm_tzadj +#endif + +/* That's in POSIX */ +#define HAVE_TZSET + +#ifdef NEED_SETENV +extern int setenv(const char *name, const char *value, int overwrite); +extern void unsetenv(const char *name); +#endif + +char* +sprintf_reliable(char *f, ...) +{ + char *s; + va_list args; + va_start(args, f); + s = vsprintf_reliable(f, args); + va_end(args); + return s; +} + +char* +vsprintf_reliable(char *f, va_list args) +{ + int n, size = 12; + char *string; + while(1) { + if(size > 4096) + return NULL; + string = malloc(size); + if(!string) + return NULL; + n = vsnprintf(string, size, f, args); + if(n >= 0 && n < size) + return string; + else if(n >= size) + size = n + 1; + else + size = size * 3 / 2 + 1; + free(string); + } + /* NOTREACHED */ +} + +/* Build a UTF-16 string from a Latin-1 string. + Result is not NUL-terminated. */ +char * +makeUTF16(char *string) +{ + int i; + int n = strlen(string); + char *value = malloc(2 * n); + if(!value) + return NULL; + for(i = 0; i < n; i++) { + value[2 * i] = '\0'; + value[2 * i + 1] = string[i]; + } + return value; +} + +unsigned +makeName(char *s) +{ + return s[0] << 24 | s[1] << 16 | s[2] << 8 | s[3]; +} + +/* Like mktime(3), but UTC rather than local time */ +#if defined(HAVE_TIMEGM) +static time_t +mktime_gmt(struct tm *tm) +{ + return timegm(tm); +} +#elif defined(HAVE_TM_GMTOFF) +static time_t +mktime_gmt(struct tm *tm) +{ + time_t t; + struct tm *ltm; + + t = mktime(tm); + if(t < 0) + return -1; + ltm = localtime(&t); + if(ltm == NULL) + return -1; + return t + ltm->GMTOFFMEMBER; +} +#elif defined(HAVE_TZSET) +/* Taken from the Linux timegm(3) man page */ +static time_t +mktime_gmt(struct tm *tm) +{ + time_t t; + char *tz; + + tz = getenv("TZ"); + setenv("TZ", "", 1); + tzset(); + t = mktime(tm); + if(tz) + setenv("TZ", tz, 1); + else + unsetenv("TZ"); + tzset(); + return t; +} +#else +#error no mktime_gmt implementation on this platform +#endif + +/* Return the current time as a signed 64-bit number of seconds since + midnight, 1 January 1904. This is apparently when the Macintosh + was designed. */ +int +macTime(int *hi, unsigned *lo) +{ + unsigned long diff; /* Not time_t */ + time_t macEpoch, current; + struct tm tm; + tm.tm_sec = 0; + tm.tm_min = 0; + tm.tm_hour = 0; + tm.tm_mday = 1; + tm.tm_mon = 1; + tm.tm_year = 4; + tm.tm_isdst = -1; + + macEpoch = mktime_gmt(&tm); + if(macEpoch < 0) return -1; + + current = time(NULL); + if(current < 0) + return -1; + + if(current < macEpoch) { + errno = EINVAL; + return -1; + } + + diff = current - macEpoch; +#if INT_MAX == LONG_MAX + *hi = 0; +#else + *hi = diff >> 32; +#endif + *lo = diff & 0xFFFFFFFF; + return 0; +} + +unsigned +faceFoundry(FT_Face face) +{ + int rc; + BDF_PropertyRec prop; + + rc = FT_Get_BDF_Property(face, "FOUNDRY", &prop); + if(rc == 0 && prop.type == BDF_PROPERTY_TYPE_ATOM) { + if(strcasecmp(prop.u.atom, "adobe") == 0) + return makeName("ADBE"); + else if(strcasecmp(prop.u.atom, "agfa") == 0) + return makeName("AGFA"); + else if(strcasecmp(prop.u.atom, "altsys") == 0) + return makeName("ALTS"); + else if(strcasecmp(prop.u.atom, "apple") == 0) + return makeName("APPL"); + else if(strcasecmp(prop.u.atom, "arphic") == 0) + return makeName("ARPH"); + else if(strcasecmp(prop.u.atom, "alltype") == 0) + return makeName("ATEC"); + else if(strcasecmp(prop.u.atom, "b&h") == 0) + return makeName("B&H "); + else if(strcasecmp(prop.u.atom, "bitstream") == 0) + return makeName("BITS"); + else if(strcasecmp(prop.u.atom, "dynalab") == 0) + return makeName("DYNA"); + else if(strcasecmp(prop.u.atom, "ibm") == 0) + return makeName("IBM "); + else if(strcasecmp(prop.u.atom, "itc") == 0) + return makeName("ITC "); + else if(strcasecmp(prop.u.atom, "interleaf") == 0) + return makeName("LEAF"); + else if(strcasecmp(prop.u.atom, "impress") == 0) + return makeName("IMPR"); + else if(strcasecmp(prop.u.atom, "larabiefonts") == 0) + return makeName("LARA"); + else if(strcasecmp(prop.u.atom, "linotype") == 0) + return makeName("LINO"); + else if(strcasecmp(prop.u.atom, "monotype") == 0) + return makeName("MT "); + else if(strcasecmp(prop.u.atom, "microsoft") == 0) + return makeName("MS "); + else if(strcasecmp(prop.u.atom, "urw") == 0) + return makeName("URW "); + else if(strcasecmp(prop.u.atom, "y&y") == 0) + return makeName("Y&Y "); + else + return makeName("UNKN"); + } + /* For now */ + return makeName("UNKN"); +} + + +int +faceWeight(FT_Face face) +{ + int rc; + BDF_PropertyRec prop; + rc = FT_Get_BDF_Property(face, "WEIGHT_NAME", &prop); + if(rc == 0 && prop.type == BDF_PROPERTY_TYPE_ATOM) { + if(strcasecmp(prop.u.atom, "thin") == 0) + return 100; + else if(strcasecmp(prop.u.atom, "extralight") == 0) + return 200; + else if(strcasecmp(prop.u.atom, "light") == 0) + return 300; + else if(strcasecmp(prop.u.atom, "medium") == 0) + return 500; + else if(strcasecmp(prop.u.atom, "semibold") == 0) + return 600; + else if(strcasecmp(prop.u.atom, "bold") == 0) + return 700; + else if(strcasecmp(prop.u.atom, "extrabold") == 0) + return 800; + else if(strcasecmp(prop.u.atom, "black") == 0) + return 900; + else + return 500; + } else + return 500; /* for now */ +} + +int +faceWidth(FT_Face face) +{ + int rc; + BDF_PropertyRec prop; + rc = FT_Get_BDF_Property(face, "SETWIDTH_NAME", &prop); + if(rc == 0 && prop.type == BDF_PROPERTY_TYPE_ATOM) { + if(strcasecmp(prop.u.atom, "ultracondensed") == 0) + return 1; + else if(strcasecmp(prop.u.atom, "extracondensed") == 0) + return 2; + else if(strcasecmp(prop.u.atom, "condensed") == 0) + return 3; + else if(strcasecmp(prop.u.atom, "semicondensed") == 0) + return 4; + else if(strcasecmp(prop.u.atom, "normal") == 0) + return 5; + else if(strcasecmp(prop.u.atom, "semiexpanded") == 0) + return 6; + else if(strcasecmp(prop.u.atom, "expanded") == 0) + return 7; + else if(strcasecmp(prop.u.atom, "extraexpanded") == 0) + return 8; + else if(strcasecmp(prop.u.atom, "ultraexpanded") == 0) + return 9; + else + return 5; + } else + return 5; /* for now */ +} + +int +faceItalicAngle(FT_Face face) +{ + int rc; + BDF_PropertyRec prop; + + rc = FT_Get_BDF_Property(face, "ITALIC_ANGLE", &prop); + if(rc == 0 && prop.type == BDF_PROPERTY_TYPE_INTEGER) { + return (prop.u.integer - 64 * 90) * (TWO_SIXTEENTH / 64); + } + + rc = FT_Get_BDF_Property(face, "SLANT", &prop); + if(rc == 0 && prop.type == BDF_PROPERTY_TYPE_ATOM) { + if(strcasecmp(prop.u.atom, "i") == 0 || + strcasecmp(prop.u.atom, "s") == 0) + return -30 * TWO_SIXTEENTH; + else + return 0; + } else + return 0; /* for now */ +} + +int +faceFlags(FT_Face face) +{ + int flags = 0; + BDF_PropertyRec prop; + int rc; + + if(faceWeight(face) >= 650) + flags |= FACE_BOLD; + rc = FT_Get_BDF_Property(face, "SLANT", &prop); + if(rc == 0 && prop.type == BDF_PROPERTY_TYPE_ATOM) { + if(strcasecmp(prop.u.atom, "i") == 0 || + strcasecmp(prop.u.atom, "s") == 0) + flags |= FACE_ITALIC; + } + return flags; +} + +char * +faceEncoding(FT_Face face) +{ + BDF_PropertyRec p1, p2; + int rc; + + rc = FT_Get_BDF_Property(face, "CHARSET_REGISTRY", &p1); + if(rc != 0 || p1.type != BDF_PROPERTY_TYPE_ATOM) + return NULL; + rc = FT_Get_BDF_Property(face, "CHARSET_ENCODING", &p2); + if(rc != 0 || p2.type != BDF_PROPERTY_TYPE_ATOM) + return NULL; + + return sprintf_reliable("%s-%s", p1.u.atom, p2.u.atom); +} + +int +degreesToFraction(int deg, int *num, int *den) +{ + double n, d; + double rad, val; + int i; + + if(deg <= -(60 * TWO_SIXTEENTH) || deg >= (60 * TWO_SIXTEENTH)) + goto fail; + + rad = (((double)deg) / TWO_SIXTEENTH) / 180.0 * M_PI; + + n = sin(-rad); + d = cos(rad); + + if(d < 0.001) + goto fail; + + val = atan2(n, d); + /* There must be a cleaner way */ + for(i = 1; i < 10000; i++) { + if((int)(d * i) != 0.0 && + fabs(atan2(ROUND(n * i), ROUND(d * i)) - val) < 0.05) { + *num = (int)ROUND(n * i); + *den = (int)ROUND(d * i); + return 0; + } + } + + fail: + *den = 1; + *num = 0; + return -1; +} + diff --git a/app/fonttosfnt/write.c b/app/fonttosfnt/write.c new file mode 100644 index 000000000..42ccec36f --- /dev/null +++ b/app/fonttosfnt/write.c @@ -0,0 +1,1078 @@ +/* +Copyright (c) 2002-2003 by Juliusz Chroboczek + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +*/ +/* $XFree86: xc/programs/fonttosfnt/write.c,v 1.4tsi Exp $ */ + +#if defined(linux) && !defined(_GNU_SOURCE) +/* for fwrite_unlocked and fread_unlocked */ +#define _GNU_SOURCE 1 +#endif + +#include +#include +#include +#include +#include "X11/Xos.h" + +#include "fonttosfnt.h" + +#if !defined(I_LOVE_POSIX) && \ + defined(__GLIBC__) && __GLIBC__ >= 2 && __GLIBC_MINOR__ >= 1 +#define DO_FWRITE fwrite_unlocked +#define DO_FREAD fread_unlocked +#else +#define DO_FWRITE fwrite +#define DO_FREAD fread +#endif + +static int writeDir(FILE*, FontPtr, int, unsigned*); +static int fixupDir(FILE*, FontPtr, int, int*, int*); +static int fixupChecksum(FILE*, int, int); + +static int writeEBDT(FILE*, FontPtr); +static int writeEBLC(FILE*, FontPtr); +static int writeOS2(FILE*, FontPtr); +static int writePCLT(FILE*, FontPtr); +static int writecmap(FILE*, FontPtr); +static int writeglyf(FILE*, FontPtr); +static int writehead(FILE*, FontPtr); +static int writehhea(FILE*, FontPtr); +static int writehmtx(FILE*, FontPtr); +static int writeloca(FILE*, FontPtr); +static int writemaxp(FILE*, FontPtr); +static int writename(FILE*, FontPtr); +static int writepost(FILE*, FontPtr); + +int max_awidth, min_x, min_y, max_x, max_y; +static CmapPtr current_cmap = NULL; +static int numglyphs, nummetrics; +static int write_error_occurred, read_error_occurred; + +/* floor(log2(x)) */ +static int +log2_floor(int x) +{ + int i, j; + + if(x <= 0) + abort(); + + i = 0; + j = 1; + while(2 * j < x) { + i++; + j *= 2; + } + return i; +} + +/* 2 ** floor(log2(x)) */ +static int +two_log2_floor(int x) +{ + int j; + + if(x <= 0) + abort(); + + j = 1; + while(2 * j < x) { + j *= 2; + } + return j; +} + +static void +write_error(int rc) +{ + /* Real Men program in C and don't use exceptions. */ + if(write_error_occurred) + return; + write_error_occurred = 1; + if(rc < 0) + perror("Couldn't write"); + else + fprintf(stderr, "Short write.\n"); +} + +static void +read_error(int rc) +{ + if(read_error_occurred) + return; + read_error_occurred = 1; + if(rc < 0) + perror("Couldn't read"); + else + fprintf(stderr, "Short read.\n"); +} + +static void +writeBYTE(FILE *out, unsigned char val) +{ + int rc; + rc = DO_FWRITE(&val, 1, 1, out); + if(rc != 1) write_error(rc); +} + +static void +writeBYTEs(FILE *out, unsigned char *chars, int n) +{ + int rc; + rc = DO_FWRITE(chars, 1, n, out); + if(rc != n) write_error(rc); +} + +static void +writeCHAR(FILE *out, char val) +{ + int rc; + rc = DO_FWRITE(&val, 1, 1, out); + if(rc != 1) write_error(rc); +} + +static void +writeCHARs(FILE *out, char *chars, int n) +{ + int rc; + rc = DO_FWRITE(chars, 1, n, out); + if(rc != n) write_error(rc); +} + +static void +writeUSHORT(FILE *out, unsigned short val) +{ + int rc; + val = htons(val); + rc = DO_FWRITE(&val, 2, 1, out); + if(rc != 1) write_error(rc); +} + +static void +writeSHORT(FILE *out, short val) +{ + int rc; + val = htons(val); + rc = DO_FWRITE(&val, 2, 1, out); + if(rc != 1) write_error(rc); +} + +static void +writeULONG(FILE *out, unsigned int val) +{ + int rc; + val = htonl(val); + rc = DO_FWRITE(&val, 4, 1, out); + if(rc != 1) write_error(rc); +} + +static void +writeLONG(FILE *out, int val) +{ + int rc; + val = htonl(val); + rc = DO_FWRITE(&val, 4, 1, out); + if(rc != 1) write_error(rc); +} + +static unsigned +readULONG(FILE *out) +{ + int rc; + unsigned val; + rc = DO_FREAD(&val, 4, 1, out); + if(rc != 1) { + read_error(rc); + return 0xDEADBEEF; + } + return ntohl(val); +} + +int +writeFile(char *filename, FontPtr font) +{ + int rc; + FILE *out; + unsigned tables[15]; + int head_position = 0; + int full_length; + int (*(table_writers[15]))(FILE*, FontPtr); + int i, j; + int offset[15], length[15]; + StrikePtr strike; + + fontMetrics(font, &max_awidth, &min_x, &min_y, &max_x, &max_y); + + out = fopen(filename, "wb+"); + if(out == NULL) + return -1; + + current_cmap = makeCmap(font); + if(current_cmap == NULL) { + fprintf(stderr, "Couldn't build cmap.\n"); + return -1; + } + + write_error_occurred = 0; + read_error_occurred = 0; + + if(glyph_flag >= 2) { + numglyphs = maxIndex(current_cmap) + 1; + if(metrics_flag >= 2) + nummetrics = numglyphs - 1; + else if(metrics_flag >= 1) + nummetrics = 1; + else + nummetrics = 0; + } else if(glyph_flag == 1) { + numglyphs = 1; + nummetrics = (metrics_flag >= 1) ? 1 : 0; + } else { + numglyphs = 0; + nummetrics = 0; + } + + strike = font->strikes; + while(strike) { + strike->indexSubTables = makeIndexSubTables(strike, current_cmap); + if(!strike->indexSubTables) { + fprintf(stderr, "Couldn't build indexSubTable.\n"); + return -1; + } + strike = strike->next; + } + + /* These must be sorted lexicographically */ + i = 0; + tables[i] = makeName("EBDT"); table_writers[i] = writeEBDT; i++; + tables[i] = makeName("EBLC"); table_writers[i] = writeEBLC; i++; + tables[i] = makeName("OS/2"); table_writers[i] = writeOS2; i++; + tables[i] = makeName("PCLT"); table_writers[i] = writePCLT; i++; + tables[i] = makeName("cmap"); table_writers[i] = writecmap; i++; + if(numglyphs >= 1) { + tables[i] = makeName("glyf"); + table_writers[i] = writeglyf; i++; + } + tables[i] = makeName("head"); table_writers[i] = writehead; i++; + tables[i] = makeName("hhea"); table_writers[i] = writehhea; i++; + if(nummetrics >= 1) { + tables[i] = makeName("hmtx"); + table_writers[i] = writehmtx; i++; + } + if(numglyphs >= 1) { + tables[i] = makeName("loca"); + table_writers[i] = writeloca; i++; + } + tables[i] = makeName("maxp"); table_writers[i] = writemaxp; i++; + tables[i] = makeName("name"); table_writers[i] = writename; i++; + tables[i] = makeName("post"); table_writers[i] = writepost; i++; + + rc = writeDir(out, font, i, tables); + if(rc < 0) + goto fail; + + for(j = 0; j < i; j++) { + offset[j] = ftell(out); + if(offset[j] < 0) { + perror("Couldn't compute table offset"); + goto fail; + } + if(tables[j] == makeName("head")) + head_position = offset[j]; + rc = table_writers[j](out, font); + if(rc < 0 || write_error_occurred || read_error_occurred) + goto fail; + length[j] = ftell(out) - offset[j]; + if(length[j] < 0) { + perror("Couldn't compute table size"); + goto fail; + } + if(length[j] % 4 != 0) { + /* Pad -- recommended by the spec, and assumed by + computeChecksum. */ + int k; + for(k = 0; k < (4 - length[j] % 4); k++) { + /* This must be 0 -- see computeChecksum. */ + writeBYTE(out, 0); + } + if(write_error_occurred || read_error_occurred) + goto fail; + } + } + + rc = fixupDir(out, font, i, offset, length); + if(rc < 0) + goto fail; + + full_length = ftell(out); + if(full_length < 0) { + perror("Couldn't compute file size"); + goto fail; + } + while(full_length % 4 != 0) { + /* pad for computeChecksum */ + writeBYTE(out, 0); + full_length++; + } + if(write_error_occurred || read_error_occurred) + goto fail; + rc = fixupChecksum(out, full_length, head_position); + if(rc < 0) + goto fail; + fclose(out); + return 0; + + fail: + unlink(filename); + return -1; +} + +static int +writeDir(FILE *out, FontPtr font, int numTables, unsigned *tables) +{ + int i, ti; + i = 0; ti = 1; + while(2 * ti < numTables) { + i++; + ti = 2 * ti; + } + + writeULONG(out, 0x10000); /* version */ + writeUSHORT(out, numTables); /* numTables */ + writeUSHORT(out, 16 * ti); /* searchRange */ + writeUSHORT(out, i - 1); /* entrySelector */ + writeUSHORT(out, 16 * (numTables - ti)); /* rangeShift */ + + /* see fixupDir */ + for(i = 0; i < numTables; i++) { + writeULONG(out, tables[i]); + writeULONG(out, 0xDEADFACE); /* checkSum */ + writeULONG(out, 0xDEADFACE); /* offset */ + writeULONG(out, 0xDEADFACE); /* length */ + } + return 0; +} + +static unsigned +computeChecksum(FILE *out, int offset, int length) +{ + int rc; + int i; + unsigned sum = 0; + + if(offset % 4 != 0) { + fprintf(stderr, "Offset %d is not a multiple of 4\n", offset); + return ~0; + } + + rc = fseek(out, offset, SEEK_SET); + if(rc < 0) { + perror("Couldn't seek"); + return ~0; + } + + /* This relies on the fact that we always pad tables with zeroes. */ + for(i = 0; i < length; i += 4) { + sum += readULONG(out); + } + return sum; +} + +static int +fixupDir(FILE *out, FontPtr font, int numTables, int *offset, int *length) +{ + int rc, i; + unsigned sum; + + for(i = 0; i < numTables; i++) { + sum = computeChecksum(out, offset[i], length[i]); + rc = fseek(out, 12 + 16 * i + 4, SEEK_SET); + if(rc != 0) { + perror("Couldn't seek"); + return -1; + } + writeULONG(out, sum); + writeULONG(out, offset[i]); + writeULONG(out, length[i]); + } + return 0; +} + +static int +fixupChecksum(FILE *out, int full_length, int head_position) +{ + int rc, checksum; + checksum = computeChecksum(out, 0, full_length); + rc = fseek(out, head_position + 8, SEEK_SET); + if(rc != 0) { + perror("Couldn't seek"); + return -1; + } + writeULONG(out, 0xB1B0AFBA - checksum); /* checkSumAdjustment */ + return 0; +} + + +static int +writehead(FILE* out, FontPtr font) +{ + int time_hi; + unsigned time_lo; + + macTime(&time_hi, &time_lo); + + writeULONG(out, 0x00010000); + writeULONG(out, 0x00010000); /* fontRevision */ + writeULONG(out, 0); /* checkSumAdjustment -- filled in later */ + writeULONG(out,0x5F0F3CF5); /* magicNumber */ + writeUSHORT(out, 1); /* flags */ + writeUSHORT(out, UNITS_PER_EM); /* unitsPerEm */ + + writeLONG(out, time_hi); /* created */ + writeULONG(out, time_lo); + writeLONG(out, time_hi); /* modified */ + writeULONG(out, time_lo); + + writeUSHORT(out, FONT_UNITS_FLOOR(min_x)); + writeUSHORT(out, FONT_UNITS_FLOOR(min_y)); + writeUSHORT(out, FONT_UNITS_CEIL(max_x)); + writeUSHORT(out, FONT_UNITS_CEIL(max_y)); + writeUSHORT(out, font->flags); /* macStyle */ + writeUSHORT(out, 1); /* lowestRecPPEM */ + writeSHORT(out, 0); /* fontDirectionHint */ + writeSHORT(out, 0); /* indexToLocFormat */ + writeSHORT(out, 0); /* glyphDataFormat */ + return 0; +} + +static int +outputRaster(FILE *out, char *raster, int width, int height, int stride, + int bit_aligned) +{ + int i, j; + int len = 0; + + if(!bit_aligned || width % 8 == 0) { + for(i = 0; i < height; i++) { + writeCHARs(out, raster + i * stride, (width + 7) / 8); + len += (width + 7) / 8; + } + } else { + int bit = 0; + unsigned char v = 0; + for(i = 0; i < height; i++) { + for(j = 0; j < width; j++) { + if(BITREF(raster, stride, j, i)) + v |= 1 << (7 - bit); + bit++; + if(bit >= 8) { + writeBYTE(out, v); + len++; + bit = 0; + v = 0; + } + } + } + if(bit > 0) { + writeBYTE(out, v); + len++; + } + } + return len; +} + +static int +writeEBDT(FILE* out, FontPtr font) +{ + StrikePtr strike; + BitmapPtr bitmap; + IndexSubTablePtr table; + int i; + int offset; + int ebdt_start; + + ebdt_start = ftell(out); + + writeULONG(out, 0x00020000); /* version */ + offset = 4; + + strike = font->strikes; + while(strike) { + table = strike->indexSubTables; + while(table) { + for(i = table->firstGlyphIndex; i <= table->lastGlyphIndex; i++) { + bitmap = strikeBitmapIndex(strike, current_cmap, i); + bitmap->location = offset; + if(bit_aligned_flag && table->constantMetrics) { + /* image format 5 */ + ; + } else { + /* image format 1 or 2 */ + writeBYTE(out, bitmap->height); + writeBYTE(out, bitmap->width); + writeCHAR(out, bitmap->horiBearingX); + writeCHAR(out, bitmap->horiBearingY); + writeBYTE(out, bitmap->advanceWidth); + offset += 5; + } + offset += outputRaster(out, + bitmap->raster, + bitmap->width, bitmap->height, + bitmap->stride, + bit_aligned_flag); + } + table->lastLocation = offset; + table = table->next; + } + strike = strike->next; + } + if(ftell(out) != ebdt_start + offset) + abort(); + return 0; +} + +static int +writeSbitLineMetrics(FILE *out, StrikePtr strike, int num, int den) +{ + int width_max, x_min, y_min, x_max, y_max; + strikeMetrics(strike, &width_max, &x_min, &y_min, &x_max, &y_max); + + writeCHAR(out, y_max); /* ascender */ + writeCHAR(out, y_min); /* descender */ + writeBYTE(out, width_max); /* widthMax */ + writeCHAR(out, num); /* caretSlopeNumerator */ + writeCHAR(out, den); /* caretSlopeDenominator */ + writeCHAR(out, 0); /* caretOffset */ + writeCHAR(out, 0); /* minOriginSB */ + writeCHAR(out, 0); /* minAdvanceSB */ + writeCHAR(out, 0); /* maxBeforeBL */ + writeCHAR(out, 0); /* minAfterBL */ + writeCHAR(out, 0); /* pad1 */ + writeCHAR(out, 0); /* pad2 */ + return 0; +} + +static int +writeEBLC(FILE* out, FontPtr font) +{ + int i, rc, numstrikes, eblc_start, num, den; + StrikePtr strike; + IndexSubTablePtr table; + + degreesToFraction(font->italicAngle, &num, &den); + + numstrikes = 0; + strike = font->strikes; + while(strike) { + numstrikes++; + strike = strike->next; + } + + eblc_start = ftell(out); + + writeULONG(out, 0x00020000); /* version */ + writeULONG(out, numstrikes); /* numSizes */ + + /* bitmapSizeTable */ + strike = font->strikes; + while(strike) { + strike->bitmapSizeTableLocation = ftell(out); + writeULONG(out, 0xDEADFACE); /* indexSubTableArrayOffset */ + writeULONG(out, 0xDEADFACE); /* indexTablesSize */ + writeULONG(out, 0xDEADFACE); /* numberOfIndexSubTables */ + writeULONG(out, 0); /* colorRef */ + writeSbitLineMetrics(out, strike, num, den); + writeSbitLineMetrics(out, strike, num, den); + writeUSHORT(out, 0); /* startGlyphIndex */ + writeUSHORT(out, 0xFFFD); /* endGlyphIndex */ + writeBYTE(out, strike->sizeX); /* ppemX */ + writeBYTE(out, strike->sizeY); /* ppemY */ + writeBYTE(out, 1); /* bitDepth */ + writeCHAR(out, 1); /* flags */ + strike = strike->next; + } + + /* indexSubTableArray, one per strike */ + strike = font->strikes; + while(strike) { + int endoffset; + int numtables = 0; + + strike->indexSubTableLocation = ftell(out); + table = strike->indexSubTables; + while(table) { + table->location = ftell(out); + writeUSHORT(out, table->firstGlyphIndex); + writeUSHORT(out, table->lastGlyphIndex); + writeULONG(out, 0xDEADFACE); /* additionalOffsetToIndexSubtable */ + numtables++; + table = table->next; + } + endoffset = ftell(out); + rc = fseek(out, strike->bitmapSizeTableLocation, SEEK_SET); + if(rc != 0) { + perror("Couldn't seek"); + return -1; + } + writeULONG(out, strike->indexSubTableLocation - eblc_start); + /* indexSubTableArrayOffset */ + writeULONG(out, endoffset - strike->indexSubTableLocation); + /* indexTablesSize */ + writeULONG(out, numtables); /* numberOfIndexSubTables */ + rc = fseek(out, endoffset, SEEK_SET); + if(rc != 0) { + perror("Couldn't seek"); + return -1; + } + strike = strike->next; + } + + /* actual indexSubTables */ + strike = font->strikes; + while(strike) { + int vertAdvance, y_min, y_max; + strikeMetrics(strike, NULL, NULL, &y_min, NULL, &y_max); + vertAdvance = y_max - y_min; + table = strike->indexSubTables; + while(table) { + int location; + int data_location; + int short_offsets; + int offset; + + location = ftell(out); + rc = fseek(out, table->location + 4, SEEK_SET); + if(rc != 0) { + perror("Couldn't seek"); + return -1; + } + /* additionalOffsetToIndexSubtable */ + writeULONG(out, location - strike->indexSubTableLocation); + rc = fseek(out, location, SEEK_SET); + if(rc != 0) { + perror("Couldn't seek"); + return -1; + } + data_location = + strikeBitmapIndex(strike, current_cmap, + table->firstGlyphIndex)->location; + short_offsets = 1; + for(i = table->firstGlyphIndex; i <= table->lastGlyphIndex; i++) { + if(strikeBitmapIndex(strike, current_cmap, i)->location - + data_location > 0xFFFF) { + short_offsets = 0; + break; + } + } + /* indexFormat */ + if(table->constantMetrics) + writeUSHORT(out, 2); + else if(short_offsets) + writeUSHORT(out, 3); + else + writeUSHORT(out, 1); + /* imageFormat */ + if(bit_aligned_flag) { + if(table->constantMetrics) + writeUSHORT(out, 5); + else + writeUSHORT(out, 2); + } else { + writeUSHORT(out, 1); + } + writeULONG(out, data_location); + if(table->constantMetrics) { + int size; + BitmapPtr bitmap = + strikeBitmapIndex(strike, current_cmap, + table->firstGlyphIndex); + + size = + strikeBitmapIndex(strike, current_cmap, + table->firstGlyphIndex + 1)->location - + bitmap->location; + writeULONG(out, size); /* imageSize */ + /* bigMetrics */ + writeBYTE(out, bitmap->height); + writeBYTE(out, bitmap->width); + writeCHAR(out, bitmap->horiBearingX); + writeCHAR(out, bitmap->horiBearingY); + writeBYTE(out, bitmap->advanceWidth); + writeCHAR(out, bitmap->horiBearingX); /* vertBearingX */ + writeCHAR(out, bitmap->horiBearingY); /* vertBearingY */ + writeBYTE(out, vertAdvance); /* vertAdvance */ + } else { + for(i = table->firstGlyphIndex; + i <= table->lastGlyphIndex; i++) { + offset = + strikeBitmapIndex(strike, current_cmap, i)->location - + data_location; + if(short_offsets) + writeUSHORT(out, offset); + else + writeULONG(out, offset); + } + /* Dummy glyph of size 0 to mark the end of the table */ + if(short_offsets) { + writeUSHORT(out, table->lastLocation - data_location); + writeUSHORT(out, table->lastLocation - data_location); + } else { + writeULONG(out, table->lastLocation - data_location); + writeULONG(out, table->lastLocation - data_location); + } + } + location = ftell(out); + while(location % 4 != 0) { + writeCHAR(out, 0); + location--; + } + table = table->next; + } + strike = strike->next; + } + return 0; +} + +static int +writecmap(FILE* out, FontPtr font) +{ + int rc, cmap_start, cmap_end; + CmapPtr cmap; + int segcount; + + segcount = 0; + cmap = current_cmap; + while(cmap) { + segcount++; + cmap = cmap->next; + } + + segcount++; /* dummy segment to end table */ + + cmap_start = ftell(out); + + writeUSHORT(out, 0); /* version */ + writeUSHORT(out, 1); /* number of encoding tables */ + writeUSHORT(out, 3); /* platform ID */ + writeUSHORT(out, (font->flags & FACE_SYMBOL) ? 0 : 1); + /* encoding ID */ + writeULONG(out, 12); /* offset to beginning of subtable */ + + /* subtable */ + writeUSHORT(out, 4); /* format */ + writeUSHORT(out, 0xDEAD); /* length */ + writeUSHORT(out, 0); /* language */ + /* How baroque can you get? */ + writeUSHORT(out, segcount * 2); /* segCountX2 */ + writeUSHORT(out, 2 * two_log2_floor(segcount)); /* searchRange */ + writeUSHORT(out, 1 + log2_floor(segcount)); /* entrySelector */ + writeUSHORT(out, 2 * (segcount - two_log2_floor(segcount))); + /* rangeShift */ + + cmap = current_cmap; + while(cmap) { + writeUSHORT(out, cmap->endCode); + cmap = cmap->next; + } + writeUSHORT(out, 0xFFFF); + + writeUSHORT(out, 0); /* reservedPad */ + + cmap = current_cmap; + while(cmap) { + writeUSHORT(out, cmap->startCode); + cmap = cmap->next; + } + writeUSHORT(out, 0xFFFF); + + /* idDelta */ + cmap = current_cmap; + while(cmap) { + writeUSHORT(out, (cmap->index - cmap->startCode) & 0xFFFF); + cmap = cmap->next; + } + writeUSHORT(out, 1); + + /* idRangeOffset */ + cmap = current_cmap; + while(cmap) { + writeUSHORT(out, 0); + cmap = cmap->next; + } + writeUSHORT(out, 0); + + /* glyphIDArray is empty */ + + cmap_end = ftell(out); + rc = fseek(out, cmap_start + 12 + 2, SEEK_SET); + if(rc != 0) { + perror("Couldn't seek"); + return -1; + } + writeUSHORT(out, cmap_end - cmap_start - 12); /* length */ + rc = fseek(out, cmap_end, SEEK_SET); + if(rc != 0) { + perror("Couldn't seek"); + return -1; + } + return 0; +} + +static int +writeglyf(FILE* out, FontPtr font) +{ + return 0; +} + +int +writehhea(FILE* out, FontPtr font) +{ + int num, den; + degreesToFraction(font->italicAngle, &num, &den); + + writeULONG(out, 0x00010000); /* version */ + writeSHORT(out, FONT_UNITS_CEIL(max_y)); /* ascender */ + writeSHORT(out, FONT_UNITS_FLOOR(min_y)); /* descender */ + writeSHORT(out, FONT_UNITS(TWO_SIXTEENTH / 20)); /* lineGap */ + writeUSHORT(out, FONT_UNITS(max_awidth)); /* advanceWidthMax */ + writeSHORT(out, FONT_UNITS_FLOOR(min_x)); /* minLeftSideBearing */ + writeSHORT(out, FONT_UNITS_FLOOR(min_x)); /* minRightSideBearing */ + writeSHORT(out, FONT_UNITS_CEIL(max_x)); /* xMaxExtent */ + writeSHORT(out, den); /* caretSlopeRise */ + writeSHORT(out, num); /* caretSlopeRun */ + writeSHORT(out, 0); /* reserved */ + writeSHORT(out, 0); /* reserved */ + writeSHORT(out, 0); /* reserved */ + writeSHORT(out, 0); /* reserved */ + writeSHORT(out, 0); /* reserved */ + writeSHORT(out, 0); /* metricDataFormat */ + writeSHORT(out, nummetrics); /* numberOfHMetrics */ + return 0; +} + +static int +writehmtx(FILE* out, FontPtr font) +{ + int rc, i; + + for(i = 0; i <= numglyphs; i++) { + int code, width, lsb; + code = findCode(current_cmap, i); + if(code < 0) + rc = -1; + else + rc = glyphMetrics(font, code, &width, &lsb, NULL, NULL, NULL); + if(rc < 0) { + width = UNITS_PER_EM / 3; + lsb = 0; + } + if(i < nummetrics) { + writeSHORT(out, FONT_UNITS(width)); + writeSHORT(out, FONT_UNITS(lsb)); + } else { + writeSHORT(out, FONT_UNITS(lsb)); + } + } + return 0; +} + +static int +writeloca(FILE* out, FontPtr font) +{ + int i; + + /* All glyphs undefined -- loca table is empty, so offset 0 */ + for(i = 0; i < numglyphs; i++) { + writeSHORT(out, 0); + } + writeSHORT(out, 0); + return 0; +} + +static int +writemaxp(FILE* out, FontPtr font) +{ + writeLONG(out, 0x00010000); /* version */ + writeUSHORT(out, numglyphs); /* numGlyphs */ + writeUSHORT(out, 0); /* maxPoints */ + writeUSHORT(out, 0); /* maxContours */ + writeUSHORT(out, 0); /* maxCompositePoints */ + writeUSHORT(out, 0); /* maxCompositeContours */ + writeUSHORT(out, 1); /* maxZones */ + writeUSHORT(out, 0); /* maxTwilightPoints */ + writeUSHORT(out, 0); /* maxStorage */ + writeUSHORT(out, 0); /* maxFunctionDefs */ + writeUSHORT(out, 0); /* maxInstructionDefs */ + writeUSHORT(out, 0); /* maxStackElements */ + writeUSHORT(out, 0); /* maxSizeOfInstructions */ + writeUSHORT(out, 0); /* maxComponentElements */ + writeUSHORT(out, 0); /* maxComponentDepth */ + return 0; +} + +static int +writename(FILE* out, FontPtr font) +{ + int i; + int offset; + + writeUSHORT(out, 0); /* format selector */ + writeUSHORT(out, font->numNames); + writeUSHORT(out, 6 + font->numNames * 12); /* offset to string storage */ + offset = 0; + for(i = 0; i < font->numNames; i++) { + writeUSHORT(out, 3); /* platform id -- Microsoft */ + writeUSHORT(out, 1); /* encoding -- Unicode */ + writeUSHORT(out, 0x409); /* language id -- American English */ + writeUSHORT(out, font->names[i].nid); /* name id */ + writeUSHORT(out, font->names[i].size); /* string length */ + writeUSHORT(out, offset); /* string offset */ + offset += font->names[i].size; + } + for(i = 0; i < font->numNames; i++) + writeCHARs(out, font->names[i].value, font->names[i].size); + return 0; +} + +static int +writepost(FILE* out, FontPtr font) +{ + int i, rc, previous_width, width, fixed_pitch; + + fixed_pitch = 1; + previous_width = -1; + for(i = 0; i < FONT_CODES; i++) { + rc = glyphMetrics(font, i, &width, NULL, NULL, NULL, NULL); + if(rc < 0) + continue; + if(previous_width >= 0) { + if(width != previous_width) { + fixed_pitch = 0; + break; + } + } + previous_width = width; + } + + writeULONG(out, 0x00030000); /* FormatType */ + writeULONG(out, font->italicAngle); /* italicAngle */ + writeSHORT(out, FONT_UNITS(font->underlinePosition)); + writeSHORT(out, FONT_UNITS(font->underlineThickness)); + writeULONG(out, fixed_pitch); /* isFixedPitch */ + writeULONG(out, 0); /* minMemType42 */ + writeULONG(out, 0); /* maxMemType42 */ + writeULONG(out, 0); /* minMemType1 */ + writeULONG(out, 0); /* maxMemType1 */ + return 0; +} + +static int +writeOS2(FILE* out, FontPtr font) +{ + int i; + + writeUSHORT(out, 0x0001); + writeSHORT(out, FONT_UNITS(max_awidth / 2)); /* xAvgCharWidth; */ + writeUSHORT(out, font->weight); /* usWeightClass; */ + writeUSHORT(out, font->width); /* usWidthClass; */ + writeSHORT(out, 0); /* fsType; */ + writeSHORT(out, UNITS_PER_EM / 5); /* ySubscriptXSize; */ + writeSHORT(out, UNITS_PER_EM / 5); /* ySubscriptYSize; */ + writeSHORT(out, 0); /* ySubscriptXOffset; */ + writeSHORT(out, UNITS_PER_EM / 5); /* ySubscriptYOffset; */ + writeSHORT(out, UNITS_PER_EM / 5); /* ySuperscriptXSize; */ + writeSHORT(out, UNITS_PER_EM / 5); /* ySuperscriptYSize; */ + writeSHORT(out, 0); /* ySuperscriptXOffset; */ + writeSHORT(out, UNITS_PER_EM / 5); /* ySuperscriptYOffset; */ + writeSHORT(out, FONT_UNITS(font->underlineThickness)); + /* yStrikeoutSize; */ + writeSHORT(out, UNITS_PER_EM / 4); /* yStrikeoutPosition; */ + writeSHORT(out, 0); /* sFamilyClass; */ + for(i = 0; i < 10; i++) + writeBYTE(out, 0); /* panose; */ + writeULONG(out, 0xFFFF); /* ulUnicodeRange1; */ + writeULONG(out, 0xFFFF); /* ulUnicodeRange2; */ + writeULONG(out, 0x03FF); /* ulUnicodeRange3; */ + writeULONG(out, 0U); /* ulUnicodeRange4; */ + writeULONG(out, font->foundry); /* achVendID[4]; */ + writeUSHORT(out, 0x0040); /* fsSelection; */ + writeUSHORT(out, 0x20); /* usFirstCharIndex; */ + writeUSHORT(out, 0xFFFD); /* usLastCharIndex; */ + writeUSHORT(out, FONT_UNITS_CEIL(max_y)); /* sTypoAscender; */ + writeUSHORT(out, -FONT_UNITS_FLOOR(min_y)); /* sTypoDescender; */ + writeUSHORT(out, FONT_UNITS(max_y - min_y)); + /* sTypoLineGap; */ + writeUSHORT(out, FONT_UNITS_CEIL(max_y)); /* usWinAscent; */ + writeUSHORT(out, -FONT_UNITS_FLOOR(min_y)); /* usWinDescent; */ + writeULONG(out, 3); /* ulCodePageRange1; */ + writeULONG(out, 0); /* ulCodePageRange2; */ + return 0; +} + +static int +writePCLT(FILE* out, FontPtr font) +{ + char name[16] = XVENDORNAME" font "; + char filename[6] = "X11R00"; + unsigned char charComplement[8] = + {0xFF, 0xFF, 0xFF, 0xFF, 0x0B, 0xFF, 0xFF, 0xFE}; + int style, w, strokeWeight, widthType; + + style = 0; + if(font->flags & FACE_ITALIC) + style = 1; + + w = (font->weight + 50) / 100; + if(w < 5) + strokeWeight = w - 6; + else if(w == 5) + strokeWeight = 0; + else + strokeWeight = w - 4; + + if(font->width <= 2) + widthType = -3; + else if(font->width <= 4) + widthType = -2; + else if(font->width <= 6) + widthType = 0; + else if(font->width <= 7) + widthType = 2; + else + widthType = 3; + + writeULONG(out, 0x00010000); /* version */ + writeULONG(out, 0); /* FontNumber */ + writeUSHORT(out, FONT_UNITS(max_awidth)); /* pitch */ + writeUSHORT(out, FONT_UNITS(max_y)); /* xHeight */ + writeUSHORT(out, style); /* style */ + writeUSHORT(out, 6 << 12); /* TypeFamily */ + writeUSHORT(out, FONT_UNITS(max_y)); /* CapHeight */ + writeUSHORT(out, 0); /* SymbolSet */ + writeCHARs(out, name, 16); /* TypeFace */ + writeBYTEs(out, charComplement, 8); /* CharacterComplement */ + writeCHARs(out, filename, 6); /* FileName */ + writeCHAR(out, strokeWeight); /* StrokeWeight */ + writeCHAR(out, widthType); /* WidthType */ + writeCHAR(out, 1 << 6); /* SerifStyle */ + writeCHAR(out, 0); /* Reserved */ + return 0; +} diff --git a/app/lbxproxy/AUTHORS b/app/lbxproxy/AUTHORS new file mode 100644 index 000000000..e69de29bb diff --git a/app/lbxproxy/COPYING b/app/lbxproxy/COPYING new file mode 100644 index 000000000..7f33cbfd2 --- /dev/null +++ b/app/lbxproxy/COPYING @@ -0,0 +1,12 @@ +This is a stub file. This package has not yet had its complete licensing +information compiled. Please see the individual source files for details on +your rights to use and modify this software. + +Please submit updated COPYING files to the Xorg bugzilla: + +https://bugs.freedesktop.org/enter_bug.cgi?product=xorg + +All licensing questions regarding this software should be directed at the +Xorg mailing list: + +http://lists.freedesktop.org/mailman/listinfo/xorg diff --git a/app/lbxproxy/ChangeLog b/app/lbxproxy/ChangeLog new file mode 100644 index 000000000..f83291aa4 --- /dev/null +++ b/app/lbxproxy/ChangeLog @@ -0,0 +1,44 @@ +2005-12-20 Kevin E. Martin + + * configure.ac: + Update package version for X11R7 release. + +2005-12-14 Kevin E. Martin + + * configure.ac: + Update package version number for final X11R7 release candidate. + +2005-12-06 Kevin E. Martin + + * Makefile.am: + Change *man_SOURCES ==> *man_PRE to fix autotools warnings. + +2005-12-03 Kevin E. Martin + + * configure.ac: + Update package version number for X11R7 RC3 release. + +2005-11-09 Kevin E. Martin + + * configure.ac: + Update package version number for X11R7 RC2 release. + +2005-11-01 Kevin E. Martin + + * configure.ac: + Update pkgcheck depedencies to work with separate build roots. + +2005-10-18 Kevin E. Martin + + * configure.ac: + Update package version number for RC1 release. + +2005-10-05 Kevin E. Martin + + * Makefile.am: Install AtomControl config file + +2005-09-28 Kristian Høgsberg + + * Makefile.am (EXTRA_DIST): add design and lbxproxy.def. + + * README: Copy first two paragraphs from man page. diff --git a/app/lbxproxy/INSTALL b/app/lbxproxy/INSTALL new file mode 100644 index 000000000..e69de29bb diff --git a/app/lbxproxy/Makefile.am b/app/lbxproxy/Makefile.am new file mode 100644 index 000000000..336222030 --- /dev/null +++ b/app/lbxproxy/Makefile.am @@ -0,0 +1,120 @@ +# +# Copyright 2005 Red Hat, Inc. +# +# Permission to use, copy, modify, distribute, and sell this software and its +# documentation for any purpose is hereby granted without fee, provided that +# the above copyright notice appear in all copies and that both that +# copyright notice and this permission notice appear in supporting +# documentation, and that the name of Red Hat not be used in +# advertising or publicity pertaining to distribution of the software without +# specific, written prior permission. Red Hat makes no +# representations about the suitability of this software for any purpose. It +# is provided "as is" without express or implied warranty. +# +# RED HAT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, +# INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO +# EVENT SHALL RED HAT BE LIABLE FOR ANY SPECIAL, INDIRECT OR +# CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, +# DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER +# TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +# PERFORMANCE OF THIS SOFTWARE. + +bin_PROGRAMS = lbxproxy + +lbxproxy_CFLAGS = $(LBXPROXY_CFLAGS) -I$(top_srcdir)/include \ + -DDEF_ATOMS_FILE=\"$(libdir)/X11/lbxproxy/AtomControl\" \ + -D_BSD_SOURCE -DLBXPROXY_t -DTRANS_SERVER + +lbxproxy_LDADD = $(LBXPROXY_LIBS) + +lbxproxy_SOURCES = \ + di/atomcache.c \ + di/cache.c \ + di/cmap.c \ + di/cmaputil.c \ + di/dispatch.c \ + di/extensions.c \ + di/gfx.c \ + di/globals.c \ + di/init.c \ + di/lbxfuncs.c \ + di/lbxutil.c \ + di/main.c \ + di/options.c \ + di/pm.c \ + di/props.c \ + di/reqtype.c \ + di/resource.c \ + di/swaprep.c \ + di/swapreq.c \ + di/tables.c \ + di/tags.c \ + di/unsquish.c \ + di/utils.c \ + di/wire.c \ + di/zeropad.c \ + os/connection.c \ + os/osdep.h \ + os/io.c \ + os/osinit.c \ + os/WaitFor.c \ + os/lbxproxytrans.c \ + include/assert.h \ + include/atomcache.h \ + include/cache.h \ + include/colormap.h \ + include/init.h \ + include/lbxext.h \ + include/lbx.h \ + include/misc.h \ + include/os.h \ + include/pm.h \ + include/pmP.h \ + include/proxyopts.h \ + include/reqtype.h \ + include/resource.h \ + include/swap.h \ + include/tags.h \ + include/util.h \ + include/wire.h + +appman_PRE = \ + lbxproxy.man + +configdir = $(libdir)/X11/lbxproxy +dist_config_DATA = config/AtomControl + +EXTRA_DIST = \ + design \ + lbxproxy.def + +appmandir = $(APP_MAN_DIR) + +appman_DATA = $(appman_PRE:man=@APP_MAN_SUFFIX@) + +EXTRA_DIST += $(appman_PRE) +CLEANFILES = $(appman_DATA) + +SED = sed + +# Strings to replace in man pages +XORGRELSTRING = @PACKAGE_STRING@ + XORGMANNAME = X Version 11 + +MAN_SUBSTS = \ + -e 's|__vendorversion__|"$(XORGRELSTRING)" "$(XORGMANNAME)"|' \ + -e 's|__xorgversion__|"$(XORGRELSTRING)" "$(XORGMANNAME)"|' \ + -e 's|__xservername__|Xorg|g' \ + -e 's|__xconfigfile__|xorg.conf|g' \ + -e 's|__projectroot__|$(prefix)|g' \ + -e 's|__apploaddir__|$(appdefaultdir)|' \ + -e 's|__appmansuffix__|$(APP_MAN_SUFFIX)|g' \ + -e 's|__libmansuffix__|$(LIB_MAN_SUFFIX)|g' \ + -e 's|__adminmansuffix__|$(ADMIN_MAN_SUFFIX)|g' \ + -e 's|__miscmansuffix__|$(MISC_MAN_SUFFIX)|g' \ + -e 's|__filemansuffix__|$(FILE_MAN_SUFFIX)|g' + +SUFFIXES = .$(APP_MAN_SUFFIX) .man + +.man.$(APP_MAN_SUFFIX): + sed $(MAN_SUBSTS) < $< > $@ diff --git a/app/lbxproxy/Makefile.in b/app/lbxproxy/Makefile.in new file mode 100644 index 000000000..7ba4d8254 --- /dev/null +++ b/app/lbxproxy/Makefile.in @@ -0,0 +1,1423 @@ +# Makefile.in generated by automake 1.7.9 from Makefile.am. +# @configure_input@ + +# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 +# Free Software Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +# +# Copyright 2005 Red Hat, Inc. +# +# Permission to use, copy, modify, distribute, and sell this software and its +# documentation for any purpose is hereby granted without fee, provided that +# the above copyright notice appear in all copies and that both that +# copyright notice and this permission notice appear in supporting +# documentation, and that the name of Red Hat not be used in +# advertising or publicity pertaining to distribution of the software without +# specific, written prior permission. Red Hat makes no +# representations about the suitability of this software for any purpose. It +# is provided "as is" without express or implied warranty. +# +# RED HAT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, +# INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO +# EVENT SHALL RED HAT BE LIABLE FOR ANY SPECIAL, INDIRECT OR +# CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, +# DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER +# TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +# PERFORMANCE OF THIS SOFTWARE. + +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +top_builddir = . + +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +INSTALL = @INSTALL@ +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +host_triplet = @host@ +ACLOCAL = @ACLOCAL@ +ADMIN_MAN_DIR = @ADMIN_MAN_DIR@ +ADMIN_MAN_SUFFIX = @ADMIN_MAN_SUFFIX@ +AMDEP_FALSE = @AMDEP_FALSE@ +AMDEP_TRUE = @AMDEP_TRUE@ +AMTAR = @AMTAR@ +APP_MAN_DIR = @APP_MAN_DIR@ +APP_MAN_SUFFIX = @APP_MAN_SUFFIX@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPPFLAGS = @CPPFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DRIVER_MAN_DIR = @DRIVER_MAN_DIR@ +DRIVER_MAN_SUFFIX = @DRIVER_MAN_SUFFIX@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EXEEXT = @EXEEXT@ +FILE_MAN_DIR = @FILE_MAN_DIR@ +FILE_MAN_SUFFIX = @FILE_MAN_SUFFIX@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LBXPROXY_CFLAGS = @LBXPROXY_CFLAGS@ +LBXPROXY_LIBS = @LBXPROXY_LIBS@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIB_MAN_DIR = @LIB_MAN_DIR@ +LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@ +LTLIBOBJS = @LTLIBOBJS@ +MAINT = @MAINT@ +MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@ +MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@ +MAKEINFO = @MAKEINFO@ +MISC_MAN_DIR = @MISC_MAN_DIR@ +MISC_MAN_SUFFIX = @MISC_MAN_SUFFIX@ +OBJEXT = @OBJEXT@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PKG_CONFIG = @PKG_CONFIG@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +VERSION = @VERSION@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_STRIP = @ac_ct_STRIP@ +ac_pt_PKG_CONFIG = @ac_pt_PKG_CONFIG@ +am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ +am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +datadir = @datadir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +oldincludedir = @oldincludedir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ + +bin_PROGRAMS = lbxproxy + +lbxproxy_CFLAGS = $(LBXPROXY_CFLAGS) -I$(top_srcdir)/include \ + -DDEF_ATOMS_FILE=\"$(libdir)/X11/lbxproxy/AtomControl\" \ + -D_BSD_SOURCE -DLBXPROXY_t -DTRANS_SERVER + + +lbxproxy_LDADD = $(LBXPROXY_LIBS) + +lbxproxy_SOURCES = \ + di/atomcache.c \ + di/cache.c \ + di/cmap.c \ + di/cmaputil.c \ + di/dispatch.c \ + di/extensions.c \ + di/gfx.c \ + di/globals.c \ + di/init.c \ + di/lbxfuncs.c \ + di/lbxutil.c \ + di/main.c \ + di/options.c \ + di/pm.c \ + di/props.c \ + di/reqtype.c \ + di/resource.c \ + di/swaprep.c \ + di/swapreq.c \ + di/tables.c \ + di/tags.c \ + di/unsquish.c \ + di/utils.c \ + di/wire.c \ + di/zeropad.c \ + os/connection.c \ + os/osdep.h \ + os/io.c \ + os/osinit.c \ + os/WaitFor.c \ + os/lbxproxytrans.c \ + include/assert.h \ + include/atomcache.h \ + include/cache.h \ + include/colormap.h \ + include/init.h \ + include/lbxext.h \ + include/lbx.h \ + include/misc.h \ + include/os.h \ + include/pm.h \ + include/pmP.h \ + include/proxyopts.h \ + include/reqtype.h \ + include/resource.h \ + include/swap.h \ + include/tags.h \ + include/util.h \ + include/wire.h + + +appman_PRE = \ + lbxproxy.man + + +configdir = $(libdir)/X11/lbxproxy +dist_config_DATA = config/AtomControl + +EXTRA_DIST = \ + design \ + lbxproxy.def\ +$(appman_PRE) + +appmandir = $(APP_MAN_DIR) + +appman_DATA = $(appman_PRE:man=@APP_MAN_SUFFIX@) +CLEANFILES = $(appman_DATA) + +SED = sed + +# Strings to replace in man pages +XORGRELSTRING = @PACKAGE_STRING@ +XORGMANNAME = X Version 11 + +MAN_SUBSTS = \ + -e 's|__vendorversion__|"$(XORGRELSTRING)" "$(XORGMANNAME)"|' \ + -e 's|__xorgversion__|"$(XORGRELSTRING)" "$(XORGMANNAME)"|' \ + -e 's|__xservername__|Xorg|g' \ + -e 's|__xconfigfile__|xorg.conf|g' \ + -e 's|__projectroot__|$(prefix)|g' \ + -e 's|__apploaddir__|$(appdefaultdir)|' \ + -e 's|__appmansuffix__|$(APP_MAN_SUFFIX)|g' \ + -e 's|__libmansuffix__|$(LIB_MAN_SUFFIX)|g' \ + -e 's|__adminmansuffix__|$(ADMIN_MAN_SUFFIX)|g' \ + -e 's|__miscmansuffix__|$(MISC_MAN_SUFFIX)|g' \ + -e 's|__filemansuffix__|$(FILE_MAN_SUFFIX)|g' + + +SUFFIXES = .$(APP_MAN_SUFFIX) .man +subdir = . +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +CONFIG_HEADER = config.h +CONFIG_CLEAN_FILES = +bin_PROGRAMS = lbxproxy$(EXEEXT) +PROGRAMS = $(bin_PROGRAMS) + +am_lbxproxy_OBJECTS = lbxproxy-atomcache.$(OBJEXT) \ + lbxproxy-cache.$(OBJEXT) lbxproxy-cmap.$(OBJEXT) \ + lbxproxy-cmaputil.$(OBJEXT) lbxproxy-dispatch.$(OBJEXT) \ + lbxproxy-extensions.$(OBJEXT) lbxproxy-gfx.$(OBJEXT) \ + lbxproxy-globals.$(OBJEXT) lbxproxy-init.$(OBJEXT) \ + lbxproxy-lbxfuncs.$(OBJEXT) lbxproxy-lbxutil.$(OBJEXT) \ + lbxproxy-main.$(OBJEXT) lbxproxy-options.$(OBJEXT) \ + lbxproxy-pm.$(OBJEXT) lbxproxy-props.$(OBJEXT) \ + lbxproxy-reqtype.$(OBJEXT) lbxproxy-resource.$(OBJEXT) \ + lbxproxy-swaprep.$(OBJEXT) lbxproxy-swapreq.$(OBJEXT) \ + lbxproxy-tables.$(OBJEXT) lbxproxy-tags.$(OBJEXT) \ + lbxproxy-unsquish.$(OBJEXT) lbxproxy-utils.$(OBJEXT) \ + lbxproxy-wire.$(OBJEXT) lbxproxy-zeropad.$(OBJEXT) \ + lbxproxy-connection.$(OBJEXT) lbxproxy-io.$(OBJEXT) \ + lbxproxy-osinit.$(OBJEXT) lbxproxy-WaitFor.$(OBJEXT) \ + lbxproxy-lbxproxytrans.$(OBJEXT) +lbxproxy_OBJECTS = $(am_lbxproxy_OBJECTS) +lbxproxy_DEPENDENCIES = +lbxproxy_LDFLAGS = + +DEFAULT_INCLUDES = -I. -I$(srcdir) -I. +depcomp = $(SHELL) $(top_srcdir)/depcomp +am__depfiles_maybe = depfiles +@AMDEP_TRUE@DEP_FILES = ./$(DEPDIR)/lbxproxy-WaitFor.Po \ +@AMDEP_TRUE@ ./$(DEPDIR)/lbxproxy-atomcache.Po \ +@AMDEP_TRUE@ ./$(DEPDIR)/lbxproxy-cache.Po \ +@AMDEP_TRUE@ ./$(DEPDIR)/lbxproxy-cmap.Po \ +@AMDEP_TRUE@ ./$(DEPDIR)/lbxproxy-cmaputil.Po \ +@AMDEP_TRUE@ ./$(DEPDIR)/lbxproxy-connection.Po \ +@AMDEP_TRUE@ ./$(DEPDIR)/lbxproxy-dispatch.Po \ +@AMDEP_TRUE@ ./$(DEPDIR)/lbxproxy-extensions.Po \ +@AMDEP_TRUE@ ./$(DEPDIR)/lbxproxy-gfx.Po \ +@AMDEP_TRUE@ ./$(DEPDIR)/lbxproxy-globals.Po \ +@AMDEP_TRUE@ ./$(DEPDIR)/lbxproxy-init.Po \ +@AMDEP_TRUE@ ./$(DEPDIR)/lbxproxy-io.Po \ +@AMDEP_TRUE@ ./$(DEPDIR)/lbxproxy-lbxfuncs.Po \ +@AMDEP_TRUE@ ./$(DEPDIR)/lbxproxy-lbxproxytrans.Po \ +@AMDEP_TRUE@ ./$(DEPDIR)/lbxproxy-lbxutil.Po \ +@AMDEP_TRUE@ ./$(DEPDIR)/lbxproxy-main.Po \ +@AMDEP_TRUE@ ./$(DEPDIR)/lbxproxy-options.Po \ +@AMDEP_TRUE@ ./$(DEPDIR)/lbxproxy-osinit.Po \ +@AMDEP_TRUE@ ./$(DEPDIR)/lbxproxy-pm.Po \ +@AMDEP_TRUE@ ./$(DEPDIR)/lbxproxy-props.Po \ +@AMDEP_TRUE@ ./$(DEPDIR)/lbxproxy-reqtype.Po \ +@AMDEP_TRUE@ ./$(DEPDIR)/lbxproxy-resource.Po \ +@AMDEP_TRUE@ ./$(DEPDIR)/lbxproxy-swaprep.Po \ +@AMDEP_TRUE@ ./$(DEPDIR)/lbxproxy-swapreq.Po \ +@AMDEP_TRUE@ ./$(DEPDIR)/lbxproxy-tables.Po \ +@AMDEP_TRUE@ ./$(DEPDIR)/lbxproxy-tags.Po \ +@AMDEP_TRUE@ ./$(DEPDIR)/lbxproxy-unsquish.Po \ +@AMDEP_TRUE@ ./$(DEPDIR)/lbxproxy-utils.Po \ +@AMDEP_TRUE@ ./$(DEPDIR)/lbxproxy-wire.Po \ +@AMDEP_TRUE@ ./$(DEPDIR)/lbxproxy-zeropad.Po +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +CCLD = $(CC) +LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ +DIST_SOURCES = $(lbxproxy_SOURCES) +DATA = $(appman_DATA) $(dist_config_DATA) + +DIST_COMMON = README $(dist_config_DATA) $(srcdir)/Makefile.in \ + $(srcdir)/configure AUTHORS COPYING ChangeLog INSTALL \ + Makefile.am NEWS aclocal.m4 compile config.guess config.h.in \ + config.sub configure configure.ac depcomp install-sh missing \ + mkinstalldirs +SOURCES = $(lbxproxy_SOURCES) + +all: config.h + $(MAKE) $(AM_MAKEFLAGS) all-am + +.SUFFIXES: +.SUFFIXES: .$(APP_MAN_SUFFIX) .man .c .o .obj + +am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ + configure.lineno +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.ac $(ACLOCAL_M4) + cd $(top_srcdir) && \ + $(AUTOMAKE) --gnu Makefile +Makefile: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.in $(top_builddir)/config.status + cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe) + +$(top_builddir)/config.status: $(srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + $(SHELL) ./config.status --recheck +$(srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(srcdir)/configure.ac $(ACLOCAL_M4) $(CONFIGURE_DEPENDENCIES) + cd $(srcdir) && $(AUTOCONF) + +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ configure.ac + cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) + +config.h: stamp-h1 + @if test ! -f $@; then \ + rm -f stamp-h1; \ + $(MAKE) stamp-h1; \ + else :; fi + +stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status + @rm -f stamp-h1 + cd $(top_builddir) && $(SHELL) ./config.status config.h + +$(srcdir)/config.h.in: @MAINTAINER_MODE_TRUE@ $(top_srcdir)/configure.ac $(ACLOCAL_M4) + cd $(top_srcdir) && $(AUTOHEADER) + touch $(srcdir)/config.h.in + +distclean-hdr: + -rm -f config.h stamp-h1 +binPROGRAMS_INSTALL = $(INSTALL_PROGRAM) +install-binPROGRAMS: $(bin_PROGRAMS) + @$(NORMAL_INSTALL) + $(mkinstalldirs) $(DESTDIR)$(bindir) + @list='$(bin_PROGRAMS)'; for p in $$list; do \ + p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ + if test -f $$p \ + ; then \ + f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \ + echo " $(INSTALL_PROGRAM_ENV) $(binPROGRAMS_INSTALL) $$p $(DESTDIR)$(bindir)/$$f"; \ + $(INSTALL_PROGRAM_ENV) $(binPROGRAMS_INSTALL) $$p $(DESTDIR)$(bindir)/$$f || exit 1; \ + else :; fi; \ + done + +uninstall-binPROGRAMS: + @$(NORMAL_UNINSTALL) + @list='$(bin_PROGRAMS)'; for p in $$list; do \ + f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \ + echo " rm -f $(DESTDIR)$(bindir)/$$f"; \ + rm -f $(DESTDIR)$(bindir)/$$f; \ + done + +clean-binPROGRAMS: + -test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS) +lbxproxy$(EXEEXT): $(lbxproxy_OBJECTS) $(lbxproxy_DEPENDENCIES) + @rm -f lbxproxy$(EXEEXT) + $(LINK) $(lbxproxy_LDFLAGS) $(lbxproxy_OBJECTS) $(lbxproxy_LDADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) core *.core + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lbxproxy-WaitFor.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lbxproxy-atomcache.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lbxproxy-cache.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lbxproxy-cmap.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lbxproxy-cmaputil.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lbxproxy-connection.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lbxproxy-dispatch.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lbxproxy-extensions.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lbxproxy-gfx.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lbxproxy-globals.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lbxproxy-init.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lbxproxy-io.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lbxproxy-lbxfuncs.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lbxproxy-lbxproxytrans.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lbxproxy-lbxutil.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lbxproxy-main.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lbxproxy-options.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lbxproxy-osinit.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lbxproxy-pm.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lbxproxy-props.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lbxproxy-reqtype.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lbxproxy-resource.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lbxproxy-swaprep.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lbxproxy-swapreq.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lbxproxy-tables.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lbxproxy-tags.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lbxproxy-unsquish.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lbxproxy-utils.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lbxproxy-wire.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lbxproxy-zeropad.Po@am__quote@ + +.c.o: +@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" \ +@am__fastdepCC_TRUE@ -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$<; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; \ +@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; \ +@am__fastdepCC_TRUE@ fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c `test -f '$<' || echo '$(srcdir)/'`$< + +.c.obj: +@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" \ +@am__fastdepCC_TRUE@ -c -o $@ `if test -f '$<'; then $(CYGPATH_W) '$<'; else $(CYGPATH_W) '$(srcdir)/$<'; fi`; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; \ +@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; \ +@am__fastdepCC_TRUE@ fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c `if test -f '$<'; then $(CYGPATH_W) '$<'; else $(CYGPATH_W) '$(srcdir)/$<'; fi` + +lbxproxy-atomcache.o: di/atomcache.c +@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lbxproxy_CFLAGS) $(CFLAGS) -MT lbxproxy-atomcache.o -MD -MP -MF "$(DEPDIR)/lbxproxy-atomcache.Tpo" \ +@am__fastdepCC_TRUE@ -c -o lbxproxy-atomcache.o `test -f 'di/atomcache.c' || echo '$(srcdir)/'`di/atomcache.c; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/lbxproxy-atomcache.Tpo" "$(DEPDIR)/lbxproxy-atomcache.Po"; \ +@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/lbxproxy-atomcache.Tpo"; exit 1; \ +@am__fastdepCC_TRUE@ fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='di/atomcache.c' object='lbxproxy-atomcache.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/lbxproxy-atomcache.Po' tmpdepfile='$(DEPDIR)/lbxproxy-atomcache.TPo' @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lbxproxy_CFLAGS) $(CFLAGS) -c -o lbxproxy-atomcache.o `test -f 'di/atomcache.c' || echo '$(srcdir)/'`di/atomcache.c + +lbxproxy-atomcache.obj: di/atomcache.c +@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lbxproxy_CFLAGS) $(CFLAGS) -MT lbxproxy-atomcache.obj -MD -MP -MF "$(DEPDIR)/lbxproxy-atomcache.Tpo" \ +@am__fastdepCC_TRUE@ -c -o lbxproxy-atomcache.obj `if test -f 'di/atomcache.c'; then $(CYGPATH_W) 'di/atomcache.c'; else $(CYGPATH_W) '$(srcdir)/di/atomcache.c'; fi`; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/lbxproxy-atomcache.Tpo" "$(DEPDIR)/lbxproxy-atomcache.Po"; \ +@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/lbxproxy-atomcache.Tpo"; exit 1; \ +@am__fastdepCC_TRUE@ fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='di/atomcache.c' object='lbxproxy-atomcache.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/lbxproxy-atomcache.Po' tmpdepfile='$(DEPDIR)/lbxproxy-atomcache.TPo' @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lbxproxy_CFLAGS) $(CFLAGS) -c -o lbxproxy-atomcache.obj `if test -f 'di/atomcache.c'; then $(CYGPATH_W) 'di/atomcache.c'; else $(CYGPATH_W) '$(srcdir)/di/atomcache.c'; fi` + +lbxproxy-cache.o: di/cache.c +@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lbxproxy_CFLAGS) $(CFLAGS) -MT lbxproxy-cache.o -MD -MP -MF "$(DEPDIR)/lbxproxy-cache.Tpo" \ +@am__fastdepCC_TRUE@ -c -o lbxproxy-cache.o `test -f 'di/cache.c' || echo '$(srcdir)/'`di/cache.c; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/lbxproxy-cache.Tpo" "$(DEPDIR)/lbxproxy-cache.Po"; \ +@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/lbxproxy-cache.Tpo"; exit 1; \ +@am__fastdepCC_TRUE@ fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='di/cache.c' object='lbxproxy-cache.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/lbxproxy-cache.Po' tmpdepfile='$(DEPDIR)/lbxproxy-cache.TPo' @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lbxproxy_CFLAGS) $(CFLAGS) -c -o lbxproxy-cache.o `test -f 'di/cache.c' || echo '$(srcdir)/'`di/cache.c + +lbxproxy-cache.obj: di/cache.c +@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lbxproxy_CFLAGS) $(CFLAGS) -MT lbxproxy-cache.obj -MD -MP -MF "$(DEPDIR)/lbxproxy-cache.Tpo" \ +@am__fastdepCC_TRUE@ -c -o lbxproxy-cache.obj `if test -f 'di/cache.c'; then $(CYGPATH_W) 'di/cache.c'; else $(CYGPATH_W) '$(srcdir)/di/cache.c'; fi`; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/lbxproxy-cache.Tpo" "$(DEPDIR)/lbxproxy-cache.Po"; \ +@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/lbxproxy-cache.Tpo"; exit 1; \ +@am__fastdepCC_TRUE@ fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='di/cache.c' object='lbxproxy-cache.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/lbxproxy-cache.Po' tmpdepfile='$(DEPDIR)/lbxproxy-cache.TPo' @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lbxproxy_CFLAGS) $(CFLAGS) -c -o lbxproxy-cache.obj `if test -f 'di/cache.c'; then $(CYGPATH_W) 'di/cache.c'; else $(CYGPATH_W) '$(srcdir)/di/cache.c'; fi` + +lbxproxy-cmap.o: di/cmap.c +@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lbxproxy_CFLAGS) $(CFLAGS) -MT lbxproxy-cmap.o -MD -MP -MF "$(DEPDIR)/lbxproxy-cmap.Tpo" \ +@am__fastdepCC_TRUE@ -c -o lbxproxy-cmap.o `test -f 'di/cmap.c' || echo '$(srcdir)/'`di/cmap.c; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/lbxproxy-cmap.Tpo" "$(DEPDIR)/lbxproxy-cmap.Po"; \ +@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/lbxproxy-cmap.Tpo"; exit 1; \ +@am__fastdepCC_TRUE@ fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='di/cmap.c' object='lbxproxy-cmap.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/lbxproxy-cmap.Po' tmpdepfile='$(DEPDIR)/lbxproxy-cmap.TPo' @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lbxproxy_CFLAGS) $(CFLAGS) -c -o lbxproxy-cmap.o `test -f 'di/cmap.c' || echo '$(srcdir)/'`di/cmap.c + +lbxproxy-cmap.obj: di/cmap.c +@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lbxproxy_CFLAGS) $(CFLAGS) -MT lbxproxy-cmap.obj -MD -MP -MF "$(DEPDIR)/lbxproxy-cmap.Tpo" \ +@am__fastdepCC_TRUE@ -c -o lbxproxy-cmap.obj `if test -f 'di/cmap.c'; then $(CYGPATH_W) 'di/cmap.c'; else $(CYGPATH_W) '$(srcdir)/di/cmap.c'; fi`; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/lbxproxy-cmap.Tpo" "$(DEPDIR)/lbxproxy-cmap.Po"; \ +@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/lbxproxy-cmap.Tpo"; exit 1; \ +@am__fastdepCC_TRUE@ fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='di/cmap.c' object='lbxproxy-cmap.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/lbxproxy-cmap.Po' tmpdepfile='$(DEPDIR)/lbxproxy-cmap.TPo' @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lbxproxy_CFLAGS) $(CFLAGS) -c -o lbxproxy-cmap.obj `if test -f 'di/cmap.c'; then $(CYGPATH_W) 'di/cmap.c'; else $(CYGPATH_W) '$(srcdir)/di/cmap.c'; fi` + +lbxproxy-cmaputil.o: di/cmaputil.c +@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lbxproxy_CFLAGS) $(CFLAGS) -MT lbxproxy-cmaputil.o -MD -MP -MF "$(DEPDIR)/lbxproxy-cmaputil.Tpo" \ +@am__fastdepCC_TRUE@ -c -o lbxproxy-cmaputil.o `test -f 'di/cmaputil.c' || echo '$(srcdir)/'`di/cmaputil.c; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/lbxproxy-cmaputil.Tpo" "$(DEPDIR)/lbxproxy-cmaputil.Po"; \ +@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/lbxproxy-cmaputil.Tpo"; exit 1; \ +@am__fastdepCC_TRUE@ fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='di/cmaputil.c' object='lbxproxy-cmaputil.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/lbxproxy-cmaputil.Po' tmpdepfile='$(DEPDIR)/lbxproxy-cmaputil.TPo' @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lbxproxy_CFLAGS) $(CFLAGS) -c -o lbxproxy-cmaputil.o `test -f 'di/cmaputil.c' || echo '$(srcdir)/'`di/cmaputil.c + +lbxproxy-cmaputil.obj: di/cmaputil.c +@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lbxproxy_CFLAGS) $(CFLAGS) -MT lbxproxy-cmaputil.obj -MD -MP -MF "$(DEPDIR)/lbxproxy-cmaputil.Tpo" \ +@am__fastdepCC_TRUE@ -c -o lbxproxy-cmaputil.obj `if test -f 'di/cmaputil.c'; then $(CYGPATH_W) 'di/cmaputil.c'; else $(CYGPATH_W) '$(srcdir)/di/cmaputil.c'; fi`; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/lbxproxy-cmaputil.Tpo" "$(DEPDIR)/lbxproxy-cmaputil.Po"; \ +@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/lbxproxy-cmaputil.Tpo"; exit 1; \ +@am__fastdepCC_TRUE@ fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='di/cmaputil.c' object='lbxproxy-cmaputil.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/lbxproxy-cmaputil.Po' tmpdepfile='$(DEPDIR)/lbxproxy-cmaputil.TPo' @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lbxproxy_CFLAGS) $(CFLAGS) -c -o lbxproxy-cmaputil.obj `if test -f 'di/cmaputil.c'; then $(CYGPATH_W) 'di/cmaputil.c'; else $(CYGPATH_W) '$(srcdir)/di/cmaputil.c'; fi` + +lbxproxy-dispatch.o: di/dispatch.c +@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lbxproxy_CFLAGS) $(CFLAGS) -MT lbxproxy-dispatch.o -MD -MP -MF "$(DEPDIR)/lbxproxy-dispatch.Tpo" \ +@am__fastdepCC_TRUE@ -c -o lbxproxy-dispatch.o `test -f 'di/dispatch.c' || echo '$(srcdir)/'`di/dispatch.c; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/lbxproxy-dispatch.Tpo" "$(DEPDIR)/lbxproxy-dispatch.Po"; \ +@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/lbxproxy-dispatch.Tpo"; exit 1; \ +@am__fastdepCC_TRUE@ fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='di/dispatch.c' object='lbxproxy-dispatch.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/lbxproxy-dispatch.Po' tmpdepfile='$(DEPDIR)/lbxproxy-dispatch.TPo' @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lbxproxy_CFLAGS) $(CFLAGS) -c -o lbxproxy-dispatch.o `test -f 'di/dispatch.c' || echo '$(srcdir)/'`di/dispatch.c + +lbxproxy-dispatch.obj: di/dispatch.c +@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lbxproxy_CFLAGS) $(CFLAGS) -MT lbxproxy-dispatch.obj -MD -MP -MF "$(DEPDIR)/lbxproxy-dispatch.Tpo" \ +@am__fastdepCC_TRUE@ -c -o lbxproxy-dispatch.obj `if test -f 'di/dispatch.c'; then $(CYGPATH_W) 'di/dispatch.c'; else $(CYGPATH_W) '$(srcdir)/di/dispatch.c'; fi`; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/lbxproxy-dispatch.Tpo" "$(DEPDIR)/lbxproxy-dispatch.Po"; \ +@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/lbxproxy-dispatch.Tpo"; exit 1; \ +@am__fastdepCC_TRUE@ fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='di/dispatch.c' object='lbxproxy-dispatch.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/lbxproxy-dispatch.Po' tmpdepfile='$(DEPDIR)/lbxproxy-dispatch.TPo' @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lbxproxy_CFLAGS) $(CFLAGS) -c -o lbxproxy-dispatch.obj `if test -f 'di/dispatch.c'; then $(CYGPATH_W) 'di/dispatch.c'; else $(CYGPATH_W) '$(srcdir)/di/dispatch.c'; fi` + +lbxproxy-extensions.o: di/extensions.c +@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lbxproxy_CFLAGS) $(CFLAGS) -MT lbxproxy-extensions.o -MD -MP -MF "$(DEPDIR)/lbxproxy-extensions.Tpo" \ +@am__fastdepCC_TRUE@ -c -o lbxproxy-extensions.o `test -f 'di/extensions.c' || echo '$(srcdir)/'`di/extensions.c; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/lbxproxy-extensions.Tpo" "$(DEPDIR)/lbxproxy-extensions.Po"; \ +@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/lbxproxy-extensions.Tpo"; exit 1; \ +@am__fastdepCC_TRUE@ fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='di/extensions.c' object='lbxproxy-extensions.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/lbxproxy-extensions.Po' tmpdepfile='$(DEPDIR)/lbxproxy-extensions.TPo' @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lbxproxy_CFLAGS) $(CFLAGS) -c -o lbxproxy-extensions.o `test -f 'di/extensions.c' || echo '$(srcdir)/'`di/extensions.c + +lbxproxy-extensions.obj: di/extensions.c +@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lbxproxy_CFLAGS) $(CFLAGS) -MT lbxproxy-extensions.obj -MD -MP -MF "$(DEPDIR)/lbxproxy-extensions.Tpo" \ +@am__fastdepCC_TRUE@ -c -o lbxproxy-extensions.obj `if test -f 'di/extensions.c'; then $(CYGPATH_W) 'di/extensions.c'; else $(CYGPATH_W) '$(srcdir)/di/extensions.c'; fi`; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/lbxproxy-extensions.Tpo" "$(DEPDIR)/lbxproxy-extensions.Po"; \ +@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/lbxproxy-extensions.Tpo"; exit 1; \ +@am__fastdepCC_TRUE@ fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='di/extensions.c' object='lbxproxy-extensions.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/lbxproxy-extensions.Po' tmpdepfile='$(DEPDIR)/lbxproxy-extensions.TPo' @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lbxproxy_CFLAGS) $(CFLAGS) -c -o lbxproxy-extensions.obj `if test -f 'di/extensions.c'; then $(CYGPATH_W) 'di/extensions.c'; else $(CYGPATH_W) '$(srcdir)/di/extensions.c'; fi` + +lbxproxy-gfx.o: di/gfx.c +@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lbxproxy_CFLAGS) $(CFLAGS) -MT lbxproxy-gfx.o -MD -MP -MF "$(DEPDIR)/lbxproxy-gfx.Tpo" \ +@am__fastdepCC_TRUE@ -c -o lbxproxy-gfx.o `test -f 'di/gfx.c' || echo '$(srcdir)/'`di/gfx.c; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/lbxproxy-gfx.Tpo" "$(DEPDIR)/lbxproxy-gfx.Po"; \ +@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/lbxproxy-gfx.Tpo"; exit 1; \ +@am__fastdepCC_TRUE@ fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='di/gfx.c' object='lbxproxy-gfx.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/lbxproxy-gfx.Po' tmpdepfile='$(DEPDIR)/lbxproxy-gfx.TPo' @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lbxproxy_CFLAGS) $(CFLAGS) -c -o lbxproxy-gfx.o `test -f 'di/gfx.c' || echo '$(srcdir)/'`di/gfx.c + +lbxproxy-gfx.obj: di/gfx.c +@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lbxproxy_CFLAGS) $(CFLAGS) -MT lbxproxy-gfx.obj -MD -MP -MF "$(DEPDIR)/lbxproxy-gfx.Tpo" \ +@am__fastdepCC_TRUE@ -c -o lbxproxy-gfx.obj `if test -f 'di/gfx.c'; then $(CYGPATH_W) 'di/gfx.c'; else $(CYGPATH_W) '$(srcdir)/di/gfx.c'; fi`; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/lbxproxy-gfx.Tpo" "$(DEPDIR)/lbxproxy-gfx.Po"; \ +@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/lbxproxy-gfx.Tpo"; exit 1; \ +@am__fastdepCC_TRUE@ fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='di/gfx.c' object='lbxproxy-gfx.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/lbxproxy-gfx.Po' tmpdepfile='$(DEPDIR)/lbxproxy-gfx.TPo' @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lbxproxy_CFLAGS) $(CFLAGS) -c -o lbxproxy-gfx.obj `if test -f 'di/gfx.c'; then $(CYGPATH_W) 'di/gfx.c'; else $(CYGPATH_W) '$(srcdir)/di/gfx.c'; fi` + +lbxproxy-globals.o: di/globals.c +@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lbxproxy_CFLAGS) $(CFLAGS) -MT lbxproxy-globals.o -MD -MP -MF "$(DEPDIR)/lbxproxy-globals.Tpo" \ +@am__fastdepCC_TRUE@ -c -o lbxproxy-globals.o `test -f 'di/globals.c' || echo '$(srcdir)/'`di/globals.c; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/lbxproxy-globals.Tpo" "$(DEPDIR)/lbxproxy-globals.Po"; \ +@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/lbxproxy-globals.Tpo"; exit 1; \ +@am__fastdepCC_TRUE@ fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='di/globals.c' object='lbxproxy-globals.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/lbxproxy-globals.Po' tmpdepfile='$(DEPDIR)/lbxproxy-globals.TPo' @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lbxproxy_CFLAGS) $(CFLAGS) -c -o lbxproxy-globals.o `test -f 'di/globals.c' || echo '$(srcdir)/'`di/globals.c + +lbxproxy-globals.obj: di/globals.c +@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lbxproxy_CFLAGS) $(CFLAGS) -MT lbxproxy-globals.obj -MD -MP -MF "$(DEPDIR)/lbxproxy-globals.Tpo" \ +@am__fastdepCC_TRUE@ -c -o lbxproxy-globals.obj `if test -f 'di/globals.c'; then $(CYGPATH_W) 'di/globals.c'; else $(CYGPATH_W) '$(srcdir)/di/globals.c'; fi`; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/lbxproxy-globals.Tpo" "$(DEPDIR)/lbxproxy-globals.Po"; \ +@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/lbxproxy-globals.Tpo"; exit 1; \ +@am__fastdepCC_TRUE@ fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='di/globals.c' object='lbxproxy-globals.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/lbxproxy-globals.Po' tmpdepfile='$(DEPDIR)/lbxproxy-globals.TPo' @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lbxproxy_CFLAGS) $(CFLAGS) -c -o lbxproxy-globals.obj `if test -f 'di/globals.c'; then $(CYGPATH_W) 'di/globals.c'; else $(CYGPATH_W) '$(srcdir)/di/globals.c'; fi` + +lbxproxy-init.o: di/init.c +@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lbxproxy_CFLAGS) $(CFLAGS) -MT lbxproxy-init.o -MD -MP -MF "$(DEPDIR)/lbxproxy-init.Tpo" \ +@am__fastdepCC_TRUE@ -c -o lbxproxy-init.o `test -f 'di/init.c' || echo '$(srcdir)/'`di/init.c; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/lbxproxy-init.Tpo" "$(DEPDIR)/lbxproxy-init.Po"; \ +@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/lbxproxy-init.Tpo"; exit 1; \ +@am__fastdepCC_TRUE@ fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='di/init.c' object='lbxproxy-init.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/lbxproxy-init.Po' tmpdepfile='$(DEPDIR)/lbxproxy-init.TPo' @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lbxproxy_CFLAGS) $(CFLAGS) -c -o lbxproxy-init.o `test -f 'di/init.c' || echo '$(srcdir)/'`di/init.c + +lbxproxy-init.obj: di/init.c +@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lbxproxy_CFLAGS) $(CFLAGS) -MT lbxproxy-init.obj -MD -MP -MF "$(DEPDIR)/lbxproxy-init.Tpo" \ +@am__fastdepCC_TRUE@ -c -o lbxproxy-init.obj `if test -f 'di/init.c'; then $(CYGPATH_W) 'di/init.c'; else $(CYGPATH_W) '$(srcdir)/di/init.c'; fi`; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/lbxproxy-init.Tpo" "$(DEPDIR)/lbxproxy-init.Po"; \ +@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/lbxproxy-init.Tpo"; exit 1; \ +@am__fastdepCC_TRUE@ fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='di/init.c' object='lbxproxy-init.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/lbxproxy-init.Po' tmpdepfile='$(DEPDIR)/lbxproxy-init.TPo' @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lbxproxy_CFLAGS) $(CFLAGS) -c -o lbxproxy-init.obj `if test -f 'di/init.c'; then $(CYGPATH_W) 'di/init.c'; else $(CYGPATH_W) '$(srcdir)/di/init.c'; fi` + +lbxproxy-lbxfuncs.o: di/lbxfuncs.c +@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lbxproxy_CFLAGS) $(CFLAGS) -MT lbxproxy-lbxfuncs.o -MD -MP -MF "$(DEPDIR)/lbxproxy-lbxfuncs.Tpo" \ +@am__fastdepCC_TRUE@ -c -o lbxproxy-lbxfuncs.o `test -f 'di/lbxfuncs.c' || echo '$(srcdir)/'`di/lbxfuncs.c; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/lbxproxy-lbxfuncs.Tpo" "$(DEPDIR)/lbxproxy-lbxfuncs.Po"; \ +@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/lbxproxy-lbxfuncs.Tpo"; exit 1; \ +@am__fastdepCC_TRUE@ fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='di/lbxfuncs.c' object='lbxproxy-lbxfuncs.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/lbxproxy-lbxfuncs.Po' tmpdepfile='$(DEPDIR)/lbxproxy-lbxfuncs.TPo' @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lbxproxy_CFLAGS) $(CFLAGS) -c -o lbxproxy-lbxfuncs.o `test -f 'di/lbxfuncs.c' || echo '$(srcdir)/'`di/lbxfuncs.c + +lbxproxy-lbxfuncs.obj: di/lbxfuncs.c +@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lbxproxy_CFLAGS) $(CFLAGS) -MT lbxproxy-lbxfuncs.obj -MD -MP -MF "$(DEPDIR)/lbxproxy-lbxfuncs.Tpo" \ +@am__fastdepCC_TRUE@ -c -o lbxproxy-lbxfuncs.obj `if test -f 'di/lbxfuncs.c'; then $(CYGPATH_W) 'di/lbxfuncs.c'; else $(CYGPATH_W) '$(srcdir)/di/lbxfuncs.c'; fi`; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/lbxproxy-lbxfuncs.Tpo" "$(DEPDIR)/lbxproxy-lbxfuncs.Po"; \ +@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/lbxproxy-lbxfuncs.Tpo"; exit 1; \ +@am__fastdepCC_TRUE@ fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='di/lbxfuncs.c' object='lbxproxy-lbxfuncs.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/lbxproxy-lbxfuncs.Po' tmpdepfile='$(DEPDIR)/lbxproxy-lbxfuncs.TPo' @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lbxproxy_CFLAGS) $(CFLAGS) -c -o lbxproxy-lbxfuncs.obj `if test -f 'di/lbxfuncs.c'; then $(CYGPATH_W) 'di/lbxfuncs.c'; else $(CYGPATH_W) '$(srcdir)/di/lbxfuncs.c'; fi` + +lbxproxy-lbxutil.o: di/lbxutil.c +@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lbxproxy_CFLAGS) $(CFLAGS) -MT lbxproxy-lbxutil.o -MD -MP -MF "$(DEPDIR)/lbxproxy-lbxutil.Tpo" \ +@am__fastdepCC_TRUE@ -c -o lbxproxy-lbxutil.o `test -f 'di/lbxutil.c' || echo '$(srcdir)/'`di/lbxutil.c; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/lbxproxy-lbxutil.Tpo" "$(DEPDIR)/lbxproxy-lbxutil.Po"; \ +@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/lbxproxy-lbxutil.Tpo"; exit 1; \ +@am__fastdepCC_TRUE@ fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='di/lbxutil.c' object='lbxproxy-lbxutil.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/lbxproxy-lbxutil.Po' tmpdepfile='$(DEPDIR)/lbxproxy-lbxutil.TPo' @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lbxproxy_CFLAGS) $(CFLAGS) -c -o lbxproxy-lbxutil.o `test -f 'di/lbxutil.c' || echo '$(srcdir)/'`di/lbxutil.c + +lbxproxy-lbxutil.obj: di/lbxutil.c +@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lbxproxy_CFLAGS) $(CFLAGS) -MT lbxproxy-lbxutil.obj -MD -MP -MF "$(DEPDIR)/lbxproxy-lbxutil.Tpo" \ +@am__fastdepCC_TRUE@ -c -o lbxproxy-lbxutil.obj `if test -f 'di/lbxutil.c'; then $(CYGPATH_W) 'di/lbxutil.c'; else $(CYGPATH_W) '$(srcdir)/di/lbxutil.c'; fi`; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/lbxproxy-lbxutil.Tpo" "$(DEPDIR)/lbxproxy-lbxutil.Po"; \ +@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/lbxproxy-lbxutil.Tpo"; exit 1; \ +@am__fastdepCC_TRUE@ fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='di/lbxutil.c' object='lbxproxy-lbxutil.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/lbxproxy-lbxutil.Po' tmpdepfile='$(DEPDIR)/lbxproxy-lbxutil.TPo' @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lbxproxy_CFLAGS) $(CFLAGS) -c -o lbxproxy-lbxutil.obj `if test -f 'di/lbxutil.c'; then $(CYGPATH_W) 'di/lbxutil.c'; else $(CYGPATH_W) '$(srcdir)/di/lbxutil.c'; fi` + +lbxproxy-main.o: di/main.c +@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lbxproxy_CFLAGS) $(CFLAGS) -MT lbxproxy-main.o -MD -MP -MF "$(DEPDIR)/lbxproxy-main.Tpo" \ +@am__fastdepCC_TRUE@ -c -o lbxproxy-main.o `test -f 'di/main.c' || echo '$(srcdir)/'`di/main.c; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/lbxproxy-main.Tpo" "$(DEPDIR)/lbxproxy-main.Po"; \ +@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/lbxproxy-main.Tpo"; exit 1; \ +@am__fastdepCC_TRUE@ fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='di/main.c' object='lbxproxy-main.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/lbxproxy-main.Po' tmpdepfile='$(DEPDIR)/lbxproxy-main.TPo' @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lbxproxy_CFLAGS) $(CFLAGS) -c -o lbxproxy-main.o `test -f 'di/main.c' || echo '$(srcdir)/'`di/main.c + +lbxproxy-main.obj: di/main.c +@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lbxproxy_CFLAGS) $(CFLAGS) -MT lbxproxy-main.obj -MD -MP -MF "$(DEPDIR)/lbxproxy-main.Tpo" \ +@am__fastdepCC_TRUE@ -c -o lbxproxy-main.obj `if test -f 'di/main.c'; then $(CYGPATH_W) 'di/main.c'; else $(CYGPATH_W) '$(srcdir)/di/main.c'; fi`; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/lbxproxy-main.Tpo" "$(DEPDIR)/lbxproxy-main.Po"; \ +@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/lbxproxy-main.Tpo"; exit 1; \ +@am__fastdepCC_TRUE@ fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='di/main.c' object='lbxproxy-main.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/lbxproxy-main.Po' tmpdepfile='$(DEPDIR)/lbxproxy-main.TPo' @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lbxproxy_CFLAGS) $(CFLAGS) -c -o lbxproxy-main.obj `if test -f 'di/main.c'; then $(CYGPATH_W) 'di/main.c'; else $(CYGPATH_W) '$(srcdir)/di/main.c'; fi` + +lbxproxy-options.o: di/options.c +@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lbxproxy_CFLAGS) $(CFLAGS) -MT lbxproxy-options.o -MD -MP -MF "$(DEPDIR)/lbxproxy-options.Tpo" \ +@am__fastdepCC_TRUE@ -c -o lbxproxy-options.o `test -f 'di/options.c' || echo '$(srcdir)/'`di/options.c; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/lbxproxy-options.Tpo" "$(DEPDIR)/lbxproxy-options.Po"; \ +@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/lbxproxy-options.Tpo"; exit 1; \ +@am__fastdepCC_TRUE@ fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='di/options.c' object='lbxproxy-options.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/lbxproxy-options.Po' tmpdepfile='$(DEPDIR)/lbxproxy-options.TPo' @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lbxproxy_CFLAGS) $(CFLAGS) -c -o lbxproxy-options.o `test -f 'di/options.c' || echo '$(srcdir)/'`di/options.c + +lbxproxy-options.obj: di/options.c +@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lbxproxy_CFLAGS) $(CFLAGS) -MT lbxproxy-options.obj -MD -MP -MF "$(DEPDIR)/lbxproxy-options.Tpo" \ +@am__fastdepCC_TRUE@ -c -o lbxproxy-options.obj `if test -f 'di/options.c'; then $(CYGPATH_W) 'di/options.c'; else $(CYGPATH_W) '$(srcdir)/di/options.c'; fi`; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/lbxproxy-options.Tpo" "$(DEPDIR)/lbxproxy-options.Po"; \ +@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/lbxproxy-options.Tpo"; exit 1; \ +@am__fastdepCC_TRUE@ fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='di/options.c' object='lbxproxy-options.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/lbxproxy-options.Po' tmpdepfile='$(DEPDIR)/lbxproxy-options.TPo' @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lbxproxy_CFLAGS) $(CFLAGS) -c -o lbxproxy-options.obj `if test -f 'di/options.c'; then $(CYGPATH_W) 'di/options.c'; else $(CYGPATH_W) '$(srcdir)/di/options.c'; fi` + +lbxproxy-pm.o: di/pm.c +@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lbxproxy_CFLAGS) $(CFLAGS) -MT lbxproxy-pm.o -MD -MP -MF "$(DEPDIR)/lbxproxy-pm.Tpo" \ +@am__fastdepCC_TRUE@ -c -o lbxproxy-pm.o `test -f 'di/pm.c' || echo '$(srcdir)/'`di/pm.c; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/lbxproxy-pm.Tpo" "$(DEPDIR)/lbxproxy-pm.Po"; \ +@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/lbxproxy-pm.Tpo"; exit 1; \ +@am__fastdepCC_TRUE@ fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='di/pm.c' object='lbxproxy-pm.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/lbxproxy-pm.Po' tmpdepfile='$(DEPDIR)/lbxproxy-pm.TPo' @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lbxproxy_CFLAGS) $(CFLAGS) -c -o lbxproxy-pm.o `test -f 'di/pm.c' || echo '$(srcdir)/'`di/pm.c + +lbxproxy-pm.obj: di/pm.c +@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lbxproxy_CFLAGS) $(CFLAGS) -MT lbxproxy-pm.obj -MD -MP -MF "$(DEPDIR)/lbxproxy-pm.Tpo" \ +@am__fastdepCC_TRUE@ -c -o lbxproxy-pm.obj `if test -f 'di/pm.c'; then $(CYGPATH_W) 'di/pm.c'; else $(CYGPATH_W) '$(srcdir)/di/pm.c'; fi`; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/lbxproxy-pm.Tpo" "$(DEPDIR)/lbxproxy-pm.Po"; \ +@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/lbxproxy-pm.Tpo"; exit 1; \ +@am__fastdepCC_TRUE@ fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='di/pm.c' object='lbxproxy-pm.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/lbxproxy-pm.Po' tmpdepfile='$(DEPDIR)/lbxproxy-pm.TPo' @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lbxproxy_CFLAGS) $(CFLAGS) -c -o lbxproxy-pm.obj `if test -f 'di/pm.c'; then $(CYGPATH_W) 'di/pm.c'; else $(CYGPATH_W) '$(srcdir)/di/pm.c'; fi` + +lbxproxy-props.o: di/props.c +@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lbxproxy_CFLAGS) $(CFLAGS) -MT lbxproxy-props.o -MD -MP -MF "$(DEPDIR)/lbxproxy-props.Tpo" \ +@am__fastdepCC_TRUE@ -c -o lbxproxy-props.o `test -f 'di/props.c' || echo '$(srcdir)/'`di/props.c; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/lbxproxy-props.Tpo" "$(DEPDIR)/lbxproxy-props.Po"; \ +@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/lbxproxy-props.Tpo"; exit 1; \ +@am__fastdepCC_TRUE@ fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='di/props.c' object='lbxproxy-props.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/lbxproxy-props.Po' tmpdepfile='$(DEPDIR)/lbxproxy-props.TPo' @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lbxproxy_CFLAGS) $(CFLAGS) -c -o lbxproxy-props.o `test -f 'di/props.c' || echo '$(srcdir)/'`di/props.c + +lbxproxy-props.obj: di/props.c +@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lbxproxy_CFLAGS) $(CFLAGS) -MT lbxproxy-props.obj -MD -MP -MF "$(DEPDIR)/lbxproxy-props.Tpo" \ +@am__fastdepCC_TRUE@ -c -o lbxproxy-props.obj `if test -f 'di/props.c'; then $(CYGPATH_W) 'di/props.c'; else $(CYGPATH_W) '$(srcdir)/di/props.c'; fi`; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/lbxproxy-props.Tpo" "$(DEPDIR)/lbxproxy-props.Po"; \ +@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/lbxproxy-props.Tpo"; exit 1; \ +@am__fastdepCC_TRUE@ fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='di/props.c' object='lbxproxy-props.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/lbxproxy-props.Po' tmpdepfile='$(DEPDIR)/lbxproxy-props.TPo' @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lbxproxy_CFLAGS) $(CFLAGS) -c -o lbxproxy-props.obj `if test -f 'di/props.c'; then $(CYGPATH_W) 'di/props.c'; else $(CYGPATH_W) '$(srcdir)/di/props.c'; fi` + +lbxproxy-reqtype.o: di/reqtype.c +@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lbxproxy_CFLAGS) $(CFLAGS) -MT lbxproxy-reqtype.o -MD -MP -MF "$(DEPDIR)/lbxproxy-reqtype.Tpo" \ +@am__fastdepCC_TRUE@ -c -o lbxproxy-reqtype.o `test -f 'di/reqtype.c' || echo '$(srcdir)/'`di/reqtype.c; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/lbxproxy-reqtype.Tpo" "$(DEPDIR)/lbxproxy-reqtype.Po"; \ +@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/lbxproxy-reqtype.Tpo"; exit 1; \ +@am__fastdepCC_TRUE@ fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='di/reqtype.c' object='lbxproxy-reqtype.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/lbxproxy-reqtype.Po' tmpdepfile='$(DEPDIR)/lbxproxy-reqtype.TPo' @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lbxproxy_CFLAGS) $(CFLAGS) -c -o lbxproxy-reqtype.o `test -f 'di/reqtype.c' || echo '$(srcdir)/'`di/reqtype.c + +lbxproxy-reqtype.obj: di/reqtype.c +@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lbxproxy_CFLAGS) $(CFLAGS) -MT lbxproxy-reqtype.obj -MD -MP -MF "$(DEPDIR)/lbxproxy-reqtype.Tpo" \ +@am__fastdepCC_TRUE@ -c -o lbxproxy-reqtype.obj `if test -f 'di/reqtype.c'; then $(CYGPATH_W) 'di/reqtype.c'; else $(CYGPATH_W) '$(srcdir)/di/reqtype.c'; fi`; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/lbxproxy-reqtype.Tpo" "$(DEPDIR)/lbxproxy-reqtype.Po"; \ +@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/lbxproxy-reqtype.Tpo"; exit 1; \ +@am__fastdepCC_TRUE@ fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='di/reqtype.c' object='lbxproxy-reqtype.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/lbxproxy-reqtype.Po' tmpdepfile='$(DEPDIR)/lbxproxy-reqtype.TPo' @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lbxproxy_CFLAGS) $(CFLAGS) -c -o lbxproxy-reqtype.obj `if test -f 'di/reqtype.c'; then $(CYGPATH_W) 'di/reqtype.c'; else $(CYGPATH_W) '$(srcdir)/di/reqtype.c'; fi` + +lbxproxy-resource.o: di/resource.c +@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lbxproxy_CFLAGS) $(CFLAGS) -MT lbxproxy-resource.o -MD -MP -MF "$(DEPDIR)/lbxproxy-resource.Tpo" \ +@am__fastdepCC_TRUE@ -c -o lbxproxy-resource.o `test -f 'di/resource.c' || echo '$(srcdir)/'`di/resource.c; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/lbxproxy-resource.Tpo" "$(DEPDIR)/lbxproxy-resource.Po"; \ +@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/lbxproxy-resource.Tpo"; exit 1; \ +@am__fastdepCC_TRUE@ fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='di/resource.c' object='lbxproxy-resource.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/lbxproxy-resource.Po' tmpdepfile='$(DEPDIR)/lbxproxy-resource.TPo' @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lbxproxy_CFLAGS) $(CFLAGS) -c -o lbxproxy-resource.o `test -f 'di/resource.c' || echo '$(srcdir)/'`di/resource.c + +lbxproxy-resource.obj: di/resource.c +@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lbxproxy_CFLAGS) $(CFLAGS) -MT lbxproxy-resource.obj -MD -MP -MF "$(DEPDIR)/lbxproxy-resource.Tpo" \ +@am__fastdepCC_TRUE@ -c -o lbxproxy-resource.obj `if test -f 'di/resource.c'; then $(CYGPATH_W) 'di/resource.c'; else $(CYGPATH_W) '$(srcdir)/di/resource.c'; fi`; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/lbxproxy-resource.Tpo" "$(DEPDIR)/lbxproxy-resource.Po"; \ +@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/lbxproxy-resource.Tpo"; exit 1; \ +@am__fastdepCC_TRUE@ fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='di/resource.c' object='lbxproxy-resource.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/lbxproxy-resource.Po' tmpdepfile='$(DEPDIR)/lbxproxy-resource.TPo' @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lbxproxy_CFLAGS) $(CFLAGS) -c -o lbxproxy-resource.obj `if test -f 'di/resource.c'; then $(CYGPATH_W) 'di/resource.c'; else $(CYGPATH_W) '$(srcdir)/di/resource.c'; fi` + +lbxproxy-swaprep.o: di/swaprep.c +@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lbxproxy_CFLAGS) $(CFLAGS) -MT lbxproxy-swaprep.o -MD -MP -MF "$(DEPDIR)/lbxproxy-swaprep.Tpo" \ +@am__fastdepCC_TRUE@ -c -o lbxproxy-swaprep.o `test -f 'di/swaprep.c' || echo '$(srcdir)/'`di/swaprep.c; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/lbxproxy-swaprep.Tpo" "$(DEPDIR)/lbxproxy-swaprep.Po"; \ +@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/lbxproxy-swaprep.Tpo"; exit 1; \ +@am__fastdepCC_TRUE@ fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='di/swaprep.c' object='lbxproxy-swaprep.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/lbxproxy-swaprep.Po' tmpdepfile='$(DEPDIR)/lbxproxy-swaprep.TPo' @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lbxproxy_CFLAGS) $(CFLAGS) -c -o lbxproxy-swaprep.o `test -f 'di/swaprep.c' || echo '$(srcdir)/'`di/swaprep.c + +lbxproxy-swaprep.obj: di/swaprep.c +@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lbxproxy_CFLAGS) $(CFLAGS) -MT lbxproxy-swaprep.obj -MD -MP -MF "$(DEPDIR)/lbxproxy-swaprep.Tpo" \ +@am__fastdepCC_TRUE@ -c -o lbxproxy-swaprep.obj `if test -f 'di/swaprep.c'; then $(CYGPATH_W) 'di/swaprep.c'; else $(CYGPATH_W) '$(srcdir)/di/swaprep.c'; fi`; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/lbxproxy-swaprep.Tpo" "$(DEPDIR)/lbxproxy-swaprep.Po"; \ +@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/lbxproxy-swaprep.Tpo"; exit 1; \ +@am__fastdepCC_TRUE@ fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='di/swaprep.c' object='lbxproxy-swaprep.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/lbxproxy-swaprep.Po' tmpdepfile='$(DEPDIR)/lbxproxy-swaprep.TPo' @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lbxproxy_CFLAGS) $(CFLAGS) -c -o lbxproxy-swaprep.obj `if test -f 'di/swaprep.c'; then $(CYGPATH_W) 'di/swaprep.c'; else $(CYGPATH_W) '$(srcdir)/di/swaprep.c'; fi` + +lbxproxy-swapreq.o: di/swapreq.c +@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lbxproxy_CFLAGS) $(CFLAGS) -MT lbxproxy-swapreq.o -MD -MP -MF "$(DEPDIR)/lbxproxy-swapreq.Tpo" \ +@am__fastdepCC_TRUE@ -c -o lbxproxy-swapreq.o `test -f 'di/swapreq.c' || echo '$(srcdir)/'`di/swapreq.c; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/lbxproxy-swapreq.Tpo" "$(DEPDIR)/lbxproxy-swapreq.Po"; \ +@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/lbxproxy-swapreq.Tpo"; exit 1; \ +@am__fastdepCC_TRUE@ fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='di/swapreq.c' object='lbxproxy-swapreq.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/lbxproxy-swapreq.Po' tmpdepfile='$(DEPDIR)/lbxproxy-swapreq.TPo' @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lbxproxy_CFLAGS) $(CFLAGS) -c -o lbxproxy-swapreq.o `test -f 'di/swapreq.c' || echo '$(srcdir)/'`di/swapreq.c + +lbxproxy-swapreq.obj: di/swapreq.c +@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lbxproxy_CFLAGS) $(CFLAGS) -MT lbxproxy-swapreq.obj -MD -MP -MF "$(DEPDIR)/lbxproxy-swapreq.Tpo" \ +@am__fastdepCC_TRUE@ -c -o lbxproxy-swapreq.obj `if test -f 'di/swapreq.c'; then $(CYGPATH_W) 'di/swapreq.c'; else $(CYGPATH_W) '$(srcdir)/di/swapreq.c'; fi`; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/lbxproxy-swapreq.Tpo" "$(DEPDIR)/lbxproxy-swapreq.Po"; \ +@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/lbxproxy-swapreq.Tpo"; exit 1; \ +@am__fastdepCC_TRUE@ fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='di/swapreq.c' object='lbxproxy-swapreq.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/lbxproxy-swapreq.Po' tmpdepfile='$(DEPDIR)/lbxproxy-swapreq.TPo' @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lbxproxy_CFLAGS) $(CFLAGS) -c -o lbxproxy-swapreq.obj `if test -f 'di/swapreq.c'; then $(CYGPATH_W) 'di/swapreq.c'; else $(CYGPATH_W) '$(srcdir)/di/swapreq.c'; fi` + +lbxproxy-tables.o: di/tables.c +@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lbxproxy_CFLAGS) $(CFLAGS) -MT lbxproxy-tables.o -MD -MP -MF "$(DEPDIR)/lbxproxy-tables.Tpo" \ +@am__fastdepCC_TRUE@ -c -o lbxproxy-tables.o `test -f 'di/tables.c' || echo '$(srcdir)/'`di/tables.c; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/lbxproxy-tables.Tpo" "$(DEPDIR)/lbxproxy-tables.Po"; \ +@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/lbxproxy-tables.Tpo"; exit 1; \ +@am__fastdepCC_TRUE@ fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='di/tables.c' object='lbxproxy-tables.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/lbxproxy-tables.Po' tmpdepfile='$(DEPDIR)/lbxproxy-tables.TPo' @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lbxproxy_CFLAGS) $(CFLAGS) -c -o lbxproxy-tables.o `test -f 'di/tables.c' || echo '$(srcdir)/'`di/tables.c + +lbxproxy-tables.obj: di/tables.c +@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lbxproxy_CFLAGS) $(CFLAGS) -MT lbxproxy-tables.obj -MD -MP -MF "$(DEPDIR)/lbxproxy-tables.Tpo" \ +@am__fastdepCC_TRUE@ -c -o lbxproxy-tables.obj `if test -f 'di/tables.c'; then $(CYGPATH_W) 'di/tables.c'; else $(CYGPATH_W) '$(srcdir)/di/tables.c'; fi`; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/lbxproxy-tables.Tpo" "$(DEPDIR)/lbxproxy-tables.Po"; \ +@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/lbxproxy-tables.Tpo"; exit 1; \ +@am__fastdepCC_TRUE@ fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='di/tables.c' object='lbxproxy-tables.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/lbxproxy-tables.Po' tmpdepfile='$(DEPDIR)/lbxproxy-tables.TPo' @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lbxproxy_CFLAGS) $(CFLAGS) -c -o lbxproxy-tables.obj `if test -f 'di/tables.c'; then $(CYGPATH_W) 'di/tables.c'; else $(CYGPATH_W) '$(srcdir)/di/tables.c'; fi` + +lbxproxy-tags.o: di/tags.c +@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lbxproxy_CFLAGS) $(CFLAGS) -MT lbxproxy-tags.o -MD -MP -MF "$(DEPDIR)/lbxproxy-tags.Tpo" \ +@am__fastdepCC_TRUE@ -c -o lbxproxy-tags.o `test -f 'di/tags.c' || echo '$(srcdir)/'`di/tags.c; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/lbxproxy-tags.Tpo" "$(DEPDIR)/lbxproxy-tags.Po"; \ +@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/lbxproxy-tags.Tpo"; exit 1; \ +@am__fastdepCC_TRUE@ fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='di/tags.c' object='lbxproxy-tags.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/lbxproxy-tags.Po' tmpdepfile='$(DEPDIR)/lbxproxy-tags.TPo' @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lbxproxy_CFLAGS) $(CFLAGS) -c -o lbxproxy-tags.o `test -f 'di/tags.c' || echo '$(srcdir)/'`di/tags.c + +lbxproxy-tags.obj: di/tags.c +@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lbxproxy_CFLAGS) $(CFLAGS) -MT lbxproxy-tags.obj -MD -MP -MF "$(DEPDIR)/lbxproxy-tags.Tpo" \ +@am__fastdepCC_TRUE@ -c -o lbxproxy-tags.obj `if test -f 'di/tags.c'; then $(CYGPATH_W) 'di/tags.c'; else $(CYGPATH_W) '$(srcdir)/di/tags.c'; fi`; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/lbxproxy-tags.Tpo" "$(DEPDIR)/lbxproxy-tags.Po"; \ +@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/lbxproxy-tags.Tpo"; exit 1; \ +@am__fastdepCC_TRUE@ fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='di/tags.c' object='lbxproxy-tags.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/lbxproxy-tags.Po' tmpdepfile='$(DEPDIR)/lbxproxy-tags.TPo' @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lbxproxy_CFLAGS) $(CFLAGS) -c -o lbxproxy-tags.obj `if test -f 'di/tags.c'; then $(CYGPATH_W) 'di/tags.c'; else $(CYGPATH_W) '$(srcdir)/di/tags.c'; fi` + +lbxproxy-unsquish.o: di/unsquish.c +@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lbxproxy_CFLAGS) $(CFLAGS) -MT lbxproxy-unsquish.o -MD -MP -MF "$(DEPDIR)/lbxproxy-unsquish.Tpo" \ +@am__fastdepCC_TRUE@ -c -o lbxproxy-unsquish.o `test -f 'di/unsquish.c' || echo '$(srcdir)/'`di/unsquish.c; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/lbxproxy-unsquish.Tpo" "$(DEPDIR)/lbxproxy-unsquish.Po"; \ +@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/lbxproxy-unsquish.Tpo"; exit 1; \ +@am__fastdepCC_TRUE@ fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='di/unsquish.c' object='lbxproxy-unsquish.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/lbxproxy-unsquish.Po' tmpdepfile='$(DEPDIR)/lbxproxy-unsquish.TPo' @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lbxproxy_CFLAGS) $(CFLAGS) -c -o lbxproxy-unsquish.o `test -f 'di/unsquish.c' || echo '$(srcdir)/'`di/unsquish.c + +lbxproxy-unsquish.obj: di/unsquish.c +@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lbxproxy_CFLAGS) $(CFLAGS) -MT lbxproxy-unsquish.obj -MD -MP -MF "$(DEPDIR)/lbxproxy-unsquish.Tpo" \ +@am__fastdepCC_TRUE@ -c -o lbxproxy-unsquish.obj `if test -f 'di/unsquish.c'; then $(CYGPATH_W) 'di/unsquish.c'; else $(CYGPATH_W) '$(srcdir)/di/unsquish.c'; fi`; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/lbxproxy-unsquish.Tpo" "$(DEPDIR)/lbxproxy-unsquish.Po"; \ +@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/lbxproxy-unsquish.Tpo"; exit 1; \ +@am__fastdepCC_TRUE@ fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='di/unsquish.c' object='lbxproxy-unsquish.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/lbxproxy-unsquish.Po' tmpdepfile='$(DEPDIR)/lbxproxy-unsquish.TPo' @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lbxproxy_CFLAGS) $(CFLAGS) -c -o lbxproxy-unsquish.obj `if test -f 'di/unsquish.c'; then $(CYGPATH_W) 'di/unsquish.c'; else $(CYGPATH_W) '$(srcdir)/di/unsquish.c'; fi` + +lbxproxy-utils.o: di/utils.c +@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lbxproxy_CFLAGS) $(CFLAGS) -MT lbxproxy-utils.o -MD -MP -MF "$(DEPDIR)/lbxproxy-utils.Tpo" \ +@am__fastdepCC_TRUE@ -c -o lbxproxy-utils.o `test -f 'di/utils.c' || echo '$(srcdir)/'`di/utils.c; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/lbxproxy-utils.Tpo" "$(DEPDIR)/lbxproxy-utils.Po"; \ +@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/lbxproxy-utils.Tpo"; exit 1; \ +@am__fastdepCC_TRUE@ fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='di/utils.c' object='lbxproxy-utils.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/lbxproxy-utils.Po' tmpdepfile='$(DEPDIR)/lbxproxy-utils.TPo' @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lbxproxy_CFLAGS) $(CFLAGS) -c -o lbxproxy-utils.o `test -f 'di/utils.c' || echo '$(srcdir)/'`di/utils.c + +lbxproxy-utils.obj: di/utils.c +@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lbxproxy_CFLAGS) $(CFLAGS) -MT lbxproxy-utils.obj -MD -MP -MF "$(DEPDIR)/lbxproxy-utils.Tpo" \ +@am__fastdepCC_TRUE@ -c -o lbxproxy-utils.obj `if test -f 'di/utils.c'; then $(CYGPATH_W) 'di/utils.c'; else $(CYGPATH_W) '$(srcdir)/di/utils.c'; fi`; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/lbxproxy-utils.Tpo" "$(DEPDIR)/lbxproxy-utils.Po"; \ +@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/lbxproxy-utils.Tpo"; exit 1; \ +@am__fastdepCC_TRUE@ fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='di/utils.c' object='lbxproxy-utils.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/lbxproxy-utils.Po' tmpdepfile='$(DEPDIR)/lbxproxy-utils.TPo' @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lbxproxy_CFLAGS) $(CFLAGS) -c -o lbxproxy-utils.obj `if test -f 'di/utils.c'; then $(CYGPATH_W) 'di/utils.c'; else $(CYGPATH_W) '$(srcdir)/di/utils.c'; fi` + +lbxproxy-wire.o: di/wire.c +@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lbxproxy_CFLAGS) $(CFLAGS) -MT lbxproxy-wire.o -MD -MP -MF "$(DEPDIR)/lbxproxy-wire.Tpo" \ +@am__fastdepCC_TRUE@ -c -o lbxproxy-wire.o `test -f 'di/wire.c' || echo '$(srcdir)/'`di/wire.c; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/lbxproxy-wire.Tpo" "$(DEPDIR)/lbxproxy-wire.Po"; \ +@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/lbxproxy-wire.Tpo"; exit 1; \ +@am__fastdepCC_TRUE@ fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='di/wire.c' object='lbxproxy-wire.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/lbxproxy-wire.Po' tmpdepfile='$(DEPDIR)/lbxproxy-wire.TPo' @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lbxproxy_CFLAGS) $(CFLAGS) -c -o lbxproxy-wire.o `test -f 'di/wire.c' || echo '$(srcdir)/'`di/wire.c + +lbxproxy-wire.obj: di/wire.c +@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lbxproxy_CFLAGS) $(CFLAGS) -MT lbxproxy-wire.obj -MD -MP -MF "$(DEPDIR)/lbxproxy-wire.Tpo" \ +@am__fastdepCC_TRUE@ -c -o lbxproxy-wire.obj `if test -f 'di/wire.c'; then $(CYGPATH_W) 'di/wire.c'; else $(CYGPATH_W) '$(srcdir)/di/wire.c'; fi`; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/lbxproxy-wire.Tpo" "$(DEPDIR)/lbxproxy-wire.Po"; \ +@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/lbxproxy-wire.Tpo"; exit 1; \ +@am__fastdepCC_TRUE@ fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='di/wire.c' object='lbxproxy-wire.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/lbxproxy-wire.Po' tmpdepfile='$(DEPDIR)/lbxproxy-wire.TPo' @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lbxproxy_CFLAGS) $(CFLAGS) -c -o lbxproxy-wire.obj `if test -f 'di/wire.c'; then $(CYGPATH_W) 'di/wire.c'; else $(CYGPATH_W) '$(srcdir)/di/wire.c'; fi` + +lbxproxy-zeropad.o: di/zeropad.c +@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lbxproxy_CFLAGS) $(CFLAGS) -MT lbxproxy-zeropad.o -MD -MP -MF "$(DEPDIR)/lbxproxy-zeropad.Tpo" \ +@am__fastdepCC_TRUE@ -c -o lbxproxy-zeropad.o `test -f 'di/zeropad.c' || echo '$(srcdir)/'`di/zeropad.c; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/lbxproxy-zeropad.Tpo" "$(DEPDIR)/lbxproxy-zeropad.Po"; \ +@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/lbxproxy-zeropad.Tpo"; exit 1; \ +@am__fastdepCC_TRUE@ fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='di/zeropad.c' object='lbxproxy-zeropad.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/lbxproxy-zeropad.Po' tmpdepfile='$(DEPDIR)/lbxproxy-zeropad.TPo' @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lbxproxy_CFLAGS) $(CFLAGS) -c -o lbxproxy-zeropad.o `test -f 'di/zeropad.c' || echo '$(srcdir)/'`di/zeropad.c + +lbxproxy-zeropad.obj: di/zeropad.c +@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lbxproxy_CFLAGS) $(CFLAGS) -MT lbxproxy-zeropad.obj -MD -MP -MF "$(DEPDIR)/lbxproxy-zeropad.Tpo" \ +@am__fastdepCC_TRUE@ -c -o lbxproxy-zeropad.obj `if test -f 'di/zeropad.c'; then $(CYGPATH_W) 'di/zeropad.c'; else $(CYGPATH_W) '$(srcdir)/di/zeropad.c'; fi`; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/lbxproxy-zeropad.Tpo" "$(DEPDIR)/lbxproxy-zeropad.Po"; \ +@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/lbxproxy-zeropad.Tpo"; exit 1; \ +@am__fastdepCC_TRUE@ fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='di/zeropad.c' object='lbxproxy-zeropad.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/lbxproxy-zeropad.Po' tmpdepfile='$(DEPDIR)/lbxproxy-zeropad.TPo' @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lbxproxy_CFLAGS) $(CFLAGS) -c -o lbxproxy-zeropad.obj `if test -f 'di/zeropad.c'; then $(CYGPATH_W) 'di/zeropad.c'; else $(CYGPATH_W) '$(srcdir)/di/zeropad.c'; fi` + +lbxproxy-connection.o: os/connection.c +@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lbxproxy_CFLAGS) $(CFLAGS) -MT lbxproxy-connection.o -MD -MP -MF "$(DEPDIR)/lbxproxy-connection.Tpo" \ +@am__fastdepCC_TRUE@ -c -o lbxproxy-connection.o `test -f 'os/connection.c' || echo '$(srcdir)/'`os/connection.c; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/lbxproxy-connection.Tpo" "$(DEPDIR)/lbxproxy-connection.Po"; \ +@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/lbxproxy-connection.Tpo"; exit 1; \ +@am__fastdepCC_TRUE@ fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='os/connection.c' object='lbxproxy-connection.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/lbxproxy-connection.Po' tmpdepfile='$(DEPDIR)/lbxproxy-connection.TPo' @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lbxproxy_CFLAGS) $(CFLAGS) -c -o lbxproxy-connection.o `test -f 'os/connection.c' || echo '$(srcdir)/'`os/connection.c + +lbxproxy-connection.obj: os/connection.c +@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lbxproxy_CFLAGS) $(CFLAGS) -MT lbxproxy-connection.obj -MD -MP -MF "$(DEPDIR)/lbxproxy-connection.Tpo" \ +@am__fastdepCC_TRUE@ -c -o lbxproxy-connection.obj `if test -f 'os/connection.c'; then $(CYGPATH_W) 'os/connection.c'; else $(CYGPATH_W) '$(srcdir)/os/connection.c'; fi`; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/lbxproxy-connection.Tpo" "$(DEPDIR)/lbxproxy-connection.Po"; \ +@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/lbxproxy-connection.Tpo"; exit 1; \ +@am__fastdepCC_TRUE@ fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='os/connection.c' object='lbxproxy-connection.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/lbxproxy-connection.Po' tmpdepfile='$(DEPDIR)/lbxproxy-connection.TPo' @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lbxproxy_CFLAGS) $(CFLAGS) -c -o lbxproxy-connection.obj `if test -f 'os/connection.c'; then $(CYGPATH_W) 'os/connection.c'; else $(CYGPATH_W) '$(srcdir)/os/connection.c'; fi` + +lbxproxy-io.o: os/io.c +@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lbxproxy_CFLAGS) $(CFLAGS) -MT lbxproxy-io.o -MD -MP -MF "$(DEPDIR)/lbxproxy-io.Tpo" \ +@am__fastdepCC_TRUE@ -c -o lbxproxy-io.o `test -f 'os/io.c' || echo '$(srcdir)/'`os/io.c; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/lbxproxy-io.Tpo" "$(DEPDIR)/lbxproxy-io.Po"; \ +@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/lbxproxy-io.Tpo"; exit 1; \ +@am__fastdepCC_TRUE@ fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='os/io.c' object='lbxproxy-io.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/lbxproxy-io.Po' tmpdepfile='$(DEPDIR)/lbxproxy-io.TPo' @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lbxproxy_CFLAGS) $(CFLAGS) -c -o lbxproxy-io.o `test -f 'os/io.c' || echo '$(srcdir)/'`os/io.c + +lbxproxy-io.obj: os/io.c +@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lbxproxy_CFLAGS) $(CFLAGS) -MT lbxproxy-io.obj -MD -MP -MF "$(DEPDIR)/lbxproxy-io.Tpo" \ +@am__fastdepCC_TRUE@ -c -o lbxproxy-io.obj `if test -f 'os/io.c'; then $(CYGPATH_W) 'os/io.c'; else $(CYGPATH_W) '$(srcdir)/os/io.c'; fi`; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/lbxproxy-io.Tpo" "$(DEPDIR)/lbxproxy-io.Po"; \ +@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/lbxproxy-io.Tpo"; exit 1; \ +@am__fastdepCC_TRUE@ fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='os/io.c' object='lbxproxy-io.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/lbxproxy-io.Po' tmpdepfile='$(DEPDIR)/lbxproxy-io.TPo' @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lbxproxy_CFLAGS) $(CFLAGS) -c -o lbxproxy-io.obj `if test -f 'os/io.c'; then $(CYGPATH_W) 'os/io.c'; else $(CYGPATH_W) '$(srcdir)/os/io.c'; fi` + +lbxproxy-osinit.o: os/osinit.c +@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lbxproxy_CFLAGS) $(CFLAGS) -MT lbxproxy-osinit.o -MD -MP -MF "$(DEPDIR)/lbxproxy-osinit.Tpo" \ +@am__fastdepCC_TRUE@ -c -o lbxproxy-osinit.o `test -f 'os/osinit.c' || echo '$(srcdir)/'`os/osinit.c; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/lbxproxy-osinit.Tpo" "$(DEPDIR)/lbxproxy-osinit.Po"; \ +@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/lbxproxy-osinit.Tpo"; exit 1; \ +@am__fastdepCC_TRUE@ fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='os/osinit.c' object='lbxproxy-osinit.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/lbxproxy-osinit.Po' tmpdepfile='$(DEPDIR)/lbxproxy-osinit.TPo' @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lbxproxy_CFLAGS) $(CFLAGS) -c -o lbxproxy-osinit.o `test -f 'os/osinit.c' || echo '$(srcdir)/'`os/osinit.c + +lbxproxy-osinit.obj: os/osinit.c +@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lbxproxy_CFLAGS) $(CFLAGS) -MT lbxproxy-osinit.obj -MD -MP -MF "$(DEPDIR)/lbxproxy-osinit.Tpo" \ +@am__fastdepCC_TRUE@ -c -o lbxproxy-osinit.obj `if test -f 'os/osinit.c'; then $(CYGPATH_W) 'os/osinit.c'; else $(CYGPATH_W) '$(srcdir)/os/osinit.c'; fi`; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/lbxproxy-osinit.Tpo" "$(DEPDIR)/lbxproxy-osinit.Po"; \ +@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/lbxproxy-osinit.Tpo"; exit 1; \ +@am__fastdepCC_TRUE@ fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='os/osinit.c' object='lbxproxy-osinit.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/lbxproxy-osinit.Po' tmpdepfile='$(DEPDIR)/lbxproxy-osinit.TPo' @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lbxproxy_CFLAGS) $(CFLAGS) -c -o lbxproxy-osinit.obj `if test -f 'os/osinit.c'; then $(CYGPATH_W) 'os/osinit.c'; else $(CYGPATH_W) '$(srcdir)/os/osinit.c'; fi` + +lbxproxy-WaitFor.o: os/WaitFor.c +@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lbxproxy_CFLAGS) $(CFLAGS) -MT lbxproxy-WaitFor.o -MD -MP -MF "$(DEPDIR)/lbxproxy-WaitFor.Tpo" \ +@am__fastdepCC_TRUE@ -c -o lbxproxy-WaitFor.o `test -f 'os/WaitFor.c' || echo '$(srcdir)/'`os/WaitFor.c; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/lbxproxy-WaitFor.Tpo" "$(DEPDIR)/lbxproxy-WaitFor.Po"; \ +@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/lbxproxy-WaitFor.Tpo"; exit 1; \ +@am__fastdepCC_TRUE@ fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='os/WaitFor.c' object='lbxproxy-WaitFor.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/lbxproxy-WaitFor.Po' tmpdepfile='$(DEPDIR)/lbxproxy-WaitFor.TPo' @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lbxproxy_CFLAGS) $(CFLAGS) -c -o lbxproxy-WaitFor.o `test -f 'os/WaitFor.c' || echo '$(srcdir)/'`os/WaitFor.c + +lbxproxy-WaitFor.obj: os/WaitFor.c +@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lbxproxy_CFLAGS) $(CFLAGS) -MT lbxproxy-WaitFor.obj -MD -MP -MF "$(DEPDIR)/lbxproxy-WaitFor.Tpo" \ +@am__fastdepCC_TRUE@ -c -o lbxproxy-WaitFor.obj `if test -f 'os/WaitFor.c'; then $(CYGPATH_W) 'os/WaitFor.c'; else $(CYGPATH_W) '$(srcdir)/os/WaitFor.c'; fi`; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/lbxproxy-WaitFor.Tpo" "$(DEPDIR)/lbxproxy-WaitFor.Po"; \ +@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/lbxproxy-WaitFor.Tpo"; exit 1; \ +@am__fastdepCC_TRUE@ fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='os/WaitFor.c' object='lbxproxy-WaitFor.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/lbxproxy-WaitFor.Po' tmpdepfile='$(DEPDIR)/lbxproxy-WaitFor.TPo' @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lbxproxy_CFLAGS) $(CFLAGS) -c -o lbxproxy-WaitFor.obj `if test -f 'os/WaitFor.c'; then $(CYGPATH_W) 'os/WaitFor.c'; else $(CYGPATH_W) '$(srcdir)/os/WaitFor.c'; fi` + +lbxproxy-lbxproxytrans.o: os/lbxproxytrans.c +@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lbxproxy_CFLAGS) $(CFLAGS) -MT lbxproxy-lbxproxytrans.o -MD -MP -MF "$(DEPDIR)/lbxproxy-lbxproxytrans.Tpo" \ +@am__fastdepCC_TRUE@ -c -o lbxproxy-lbxproxytrans.o `test -f 'os/lbxproxytrans.c' || echo '$(srcdir)/'`os/lbxproxytrans.c; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/lbxproxy-lbxproxytrans.Tpo" "$(DEPDIR)/lbxproxy-lbxproxytrans.Po"; \ +@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/lbxproxy-lbxproxytrans.Tpo"; exit 1; \ +@am__fastdepCC_TRUE@ fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='os/lbxproxytrans.c' object='lbxproxy-lbxproxytrans.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/lbxproxy-lbxproxytrans.Po' tmpdepfile='$(DEPDIR)/lbxproxy-lbxproxytrans.TPo' @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lbxproxy_CFLAGS) $(CFLAGS) -c -o lbxproxy-lbxproxytrans.o `test -f 'os/lbxproxytrans.c' || echo '$(srcdir)/'`os/lbxproxytrans.c + +lbxproxy-lbxproxytrans.obj: os/lbxproxytrans.c +@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lbxproxy_CFLAGS) $(CFLAGS) -MT lbxproxy-lbxproxytrans.obj -MD -MP -MF "$(DEPDIR)/lbxproxy-lbxproxytrans.Tpo" \ +@am__fastdepCC_TRUE@ -c -o lbxproxy-lbxproxytrans.obj `if test -f 'os/lbxproxytrans.c'; then $(CYGPATH_W) 'os/lbxproxytrans.c'; else $(CYGPATH_W) '$(srcdir)/os/lbxproxytrans.c'; fi`; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/lbxproxy-lbxproxytrans.Tpo" "$(DEPDIR)/lbxproxy-lbxproxytrans.Po"; \ +@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/lbxproxy-lbxproxytrans.Tpo"; exit 1; \ +@am__fastdepCC_TRUE@ fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='os/lbxproxytrans.c' object='lbxproxy-lbxproxytrans.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/lbxproxy-lbxproxytrans.Po' tmpdepfile='$(DEPDIR)/lbxproxy-lbxproxytrans.TPo' @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lbxproxy_CFLAGS) $(CFLAGS) -c -o lbxproxy-lbxproxytrans.obj `if test -f 'os/lbxproxytrans.c'; then $(CYGPATH_W) 'os/lbxproxytrans.c'; else $(CYGPATH_W) '$(srcdir)/os/lbxproxytrans.c'; fi` +uninstall-info-am: +appmanDATA_INSTALL = $(INSTALL_DATA) +install-appmanDATA: $(appman_DATA) + @$(NORMAL_INSTALL) + $(mkinstalldirs) $(DESTDIR)$(appmandir) + @list='$(appman_DATA)'; for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + f="`echo $$p | sed -e 's|^.*/||'`"; \ + echo " $(appmanDATA_INSTALL) $$d$$p $(DESTDIR)$(appmandir)/$$f"; \ + $(appmanDATA_INSTALL) $$d$$p $(DESTDIR)$(appmandir)/$$f; \ + done + +uninstall-appmanDATA: + @$(NORMAL_UNINSTALL) + @list='$(appman_DATA)'; for p in $$list; do \ + f="`echo $$p | sed -e 's|^.*/||'`"; \ + echo " rm -f $(DESTDIR)$(appmandir)/$$f"; \ + rm -f $(DESTDIR)$(appmandir)/$$f; \ + done +dist_configDATA_INSTALL = $(INSTALL_DATA) +install-dist_configDATA: $(dist_config_DATA) + @$(NORMAL_INSTALL) + $(mkinstalldirs) $(DESTDIR)$(configdir) + @list='$(dist_config_DATA)'; for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + f="`echo $$p | sed -e 's|^.*/||'`"; \ + echo " $(dist_configDATA_INSTALL) $$d$$p $(DESTDIR)$(configdir)/$$f"; \ + $(dist_configDATA_INSTALL) $$d$$p $(DESTDIR)$(configdir)/$$f; \ + done + +uninstall-dist_configDATA: + @$(NORMAL_UNINSTALL) + @list='$(dist_config_DATA)'; for p in $$list; do \ + f="`echo $$p | sed -e 's|^.*/||'`"; \ + echo " rm -f $(DESTDIR)$(configdir)/$$f"; \ + rm -f $(DESTDIR)$(configdir)/$$f; \ + done + +ETAGS = etags +ETAGSFLAGS = + +CTAGS = ctags +CTAGSFLAGS = + +tags: TAGS + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + mkid -fID $$unique + +TAGS: $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + test -z "$(ETAGS_ARGS)$$tags$$unique" \ + || $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$tags $$unique + +ctags: CTAGS +CTAGS: $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + test -z "$(CTAGS_ARGS)$$tags$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$tags $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && cd $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) $$here + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) + +top_distdir = . +distdir = $(PACKAGE)-$(VERSION) + +am__remove_distdir = \ + { test ! -d $(distdir) \ + || { find $(distdir) -type d ! -perm -200 -exec chmod u+w {} ';' \ + && rm -fr $(distdir); }; } + +GZIP_ENV = --best +distuninstallcheck_listfiles = find . -type f -print +distcleancheck_listfiles = find . -type f -print + +distdir: $(DISTFILES) + $(am__remove_distdir) + mkdir $(distdir) + $(mkinstalldirs) $(distdir)/config + @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ + list='$(DISTFILES)'; for file in $$list; do \ + case $$file in \ + $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ + $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ + esac; \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test "$$dir" != "$$file" && test "$$dir" != "."; then \ + dir="/$$dir"; \ + $(mkinstalldirs) "$(distdir)$$dir"; \ + else \ + dir=''; \ + fi; \ + if test -d $$d/$$file; then \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ + fi; \ + cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ + else \ + test -f $(distdir)/$$file \ + || cp -p $$d/$$file $(distdir)/$$file \ + || exit 1; \ + fi; \ + done + -find $(distdir) -type d ! -perm -777 -exec chmod a+rwx {} \; -o \ + ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \ + ! -type d ! -perm -400 -exec chmod a+r {} \; -o \ + ! -type d ! -perm -444 -exec $(SHELL) $(install_sh) -c -m a+r {} {} \; \ + || chmod -R a+r $(distdir) +dist-gzip: distdir + $(AMTAR) chof - $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz + $(am__remove_distdir) + +dist-bzip2: distdir + $(AMTAR) chof - $(distdir) | bzip2 -9 -c >$(distdir).tar.bz2 + $(am__remove_distdir) + +dist dist-all: distdir + $(AMTAR) chof - $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz + $(AMTAR) chof - $(distdir) | bzip2 -9 -c >$(distdir).tar.bz2 + $(am__remove_distdir) + +# This target untars the dist file and tries a VPATH configuration. Then +# it guarantees that the distribution is self-contained by making another +# tarfile. +distcheck: dist + $(am__remove_distdir) + GZIP=$(GZIP_ENV) gunzip -c $(distdir).tar.gz | $(AMTAR) xf - + chmod -R a-w $(distdir); chmod a+w $(distdir) + mkdir $(distdir)/_build + mkdir $(distdir)/_inst + chmod a-w $(distdir) + dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \ + && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ + && cd $(distdir)/_build \ + && ../configure --srcdir=.. --prefix="$$dc_install_base" \ + $(DISTCHECK_CONFIGURE_FLAGS) \ + && $(MAKE) $(AM_MAKEFLAGS) \ + && $(MAKE) $(AM_MAKEFLAGS) dvi \ + && $(MAKE) $(AM_MAKEFLAGS) check \ + && $(MAKE) $(AM_MAKEFLAGS) install \ + && $(MAKE) $(AM_MAKEFLAGS) installcheck \ + && $(MAKE) $(AM_MAKEFLAGS) uninstall \ + && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \ + distuninstallcheck \ + && chmod -R a-w "$$dc_install_base" \ + && ({ \ + (cd ../.. && $(mkinstalldirs) "$$dc_destdir") \ + && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \ + && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \ + && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \ + distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \ + } || { rm -rf "$$dc_destdir"; exit 1; }) \ + && rm -rf "$$dc_destdir" \ + && $(MAKE) $(AM_MAKEFLAGS) dist-gzip \ + && rm -f $(distdir).tar.gz \ + && $(MAKE) $(AM_MAKEFLAGS) distcleancheck + $(am__remove_distdir) + @echo "$(distdir).tar.gz is ready for distribution" | \ + sed 'h;s/./=/g;p;x;p;x' +distuninstallcheck: + @cd $(distuninstallcheck_dir) \ + && test `$(distuninstallcheck_listfiles) | wc -l` -le 1 \ + || { echo "ERROR: files left after uninstall:" ; \ + if test -n "$(DESTDIR)"; then \ + echo " (check DESTDIR support)"; \ + fi ; \ + $(distuninstallcheck_listfiles) ; \ + exit 1; } >&2 +distcleancheck: distclean + @if test '$(srcdir)' = . ; then \ + echo "ERROR: distcleancheck can only run from a VPATH build" ; \ + exit 1 ; \ + fi + @test `$(distcleancheck_listfiles) | wc -l` -eq 0 \ + || { echo "ERROR: files left in build directory after distclean:" ; \ + $(distcleancheck_listfiles) ; \ + exit 1; } >&2 +check-am: all-am +check: check-am +all-am: Makefile $(PROGRAMS) $(DATA) config.h + +installdirs: + $(mkinstalldirs) $(DESTDIR)$(bindir) $(DESTDIR)$(appmandir) $(DESTDIR)$(configdir) +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) + +distclean-generic: + -rm -f $(CONFIG_CLEAN_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-binPROGRAMS clean-generic mostlyclean-am + +distclean: distclean-am + -rm -f $(am__CONFIG_DISTCLEAN_FILES) + -rm -rf ./$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic distclean-hdr \ + distclean-tags + +dvi: dvi-am + +dvi-am: + +info: info-am + +info-am: + +install-data-am: install-appmanDATA install-dist_configDATA + +install-exec-am: install-binPROGRAMS + +install-info: install-info-am + +install-man: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -f $(am__CONFIG_DISTCLEAN_FILES) + -rm -rf $(top_srcdir)/autom4te.cache + -rm -rf ./$(DEPDIR) + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-appmanDATA uninstall-binPROGRAMS \ + uninstall-dist_configDATA uninstall-info-am + +.PHONY: CTAGS GTAGS all all-am check check-am clean clean-binPROGRAMS \ + clean-generic ctags dist dist-all dist-bzip2 dist-gzip \ + distcheck distclean distclean-compile distclean-generic \ + distclean-hdr distclean-tags distcleancheck distdir \ + distuninstallcheck dvi dvi-am info info-am install install-am \ + install-appmanDATA install-binPROGRAMS install-data \ + install-data-am install-dist_configDATA install-exec \ + install-exec-am install-info install-info-am install-man \ + install-strip installcheck installcheck-am installdirs \ + maintainer-clean maintainer-clean-generic mostlyclean \ + mostlyclean-compile mostlyclean-generic pdf pdf-am ps ps-am \ + tags uninstall uninstall-am uninstall-appmanDATA \ + uninstall-binPROGRAMS uninstall-dist_configDATA \ + uninstall-info-am + + +.man.$(APP_MAN_SUFFIX): + sed $(MAN_SUBSTS) < $< > $@ +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/app/lbxproxy/NEWS b/app/lbxproxy/NEWS new file mode 100644 index 000000000..e69de29bb diff --git a/app/lbxproxy/README b/app/lbxproxy/README new file mode 100644 index 000000000..1854d3624 --- /dev/null +++ b/app/lbxproxy/README @@ -0,0 +1,15 @@ +Applications that would like to take advantage of the Low Bandwidth +extension to X (LBX) must make their connections to an lbxproxy. +These applications need to know nothing about LBX, they simply connect +to the lbxproxy as if were a regular server. The lbxproxy accepts +client connections, multiplexes them over a single connection to the X +server, and performs various optimizations on the X protocol to make +it faster over low bandwidth and/or high latency connections. + +With regard to authentication/authorization, lbxproxy simply passes +along to the server the credentials presented by the client. Since X +clients will connect to lbxproxy, it is important that the user's +.Xauthority file contain entries with valid keys associated with the +network ID of the proxy. lbxproxy does not get involved with how +these entries are added to the .Xauthority file. The user is +responsible for setting it up. diff --git a/app/lbxproxy/aclocal.m4 b/app/lbxproxy/aclocal.m4 new file mode 100644 index 000000000..56c30f318 --- /dev/null +++ b/app/lbxproxy/aclocal.m4 @@ -0,0 +1,1489 @@ +# generated automatically by aclocal 1.7.9 -*- Autoconf -*- + +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002 +# Free Software Foundation, Inc. +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +# Do all the work for Automake. -*- Autoconf -*- + +# This macro actually does too much some checks are only needed if +# your package does certain things. But this isn't really a big deal. + +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 +# Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +# 02111-1307, USA. + +# serial 10 + +AC_PREREQ([2.54]) + +# Autoconf 2.50 wants to disallow AM_ names. We explicitly allow +# the ones we care about. +m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl + +# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) +# AM_INIT_AUTOMAKE([OPTIONS]) +# ----------------------------------------------- +# The call with PACKAGE and VERSION arguments is the old style +# call (pre autoconf-2.50), which is being phased out. PACKAGE +# and VERSION should now be passed to AC_INIT and removed from +# the call to AM_INIT_AUTOMAKE. +# We support both call styles for the transition. After +# the next Automake release, Autoconf can make the AC_INIT +# arguments mandatory, and then we can depend on a new Autoconf +# release and drop the old call support. +AC_DEFUN([AM_INIT_AUTOMAKE], +[AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl + AC_REQUIRE([AC_PROG_INSTALL])dnl +# test to see if srcdir already configured +if test "`cd $srcdir && pwd`" != "`pwd`" && + test -f $srcdir/config.status; then + AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) +fi + +# test whether we have cygpath +if test -z "$CYGPATH_W"; then + if (cygpath --version) >/dev/null 2>/dev/null; then + CYGPATH_W='cygpath -w' + else + CYGPATH_W=echo + fi +fi +AC_SUBST([CYGPATH_W]) + +# Define the identity of the package. +dnl Distinguish between old-style and new-style calls. +m4_ifval([$2], +[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl + AC_SUBST([PACKAGE], [$1])dnl + AC_SUBST([VERSION], [$2])], +[_AM_SET_OPTIONS([$1])dnl + AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl + AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl + +_AM_IF_OPTION([no-define],, +[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package]) + AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl + +# Some tools Automake needs. +AC_REQUIRE([AM_SANITY_CHECK])dnl +AC_REQUIRE([AC_ARG_PROGRAM])dnl +AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version}) +AM_MISSING_PROG(AUTOCONF, autoconf) +AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version}) +AM_MISSING_PROG(AUTOHEADER, autoheader) +AM_MISSING_PROG(MAKEINFO, makeinfo) +AM_MISSING_PROG(AMTAR, tar) +AM_PROG_INSTALL_SH +AM_PROG_INSTALL_STRIP +# We need awk for the "check" target. The system "awk" is bad on +# some platforms. +AC_REQUIRE([AC_PROG_AWK])dnl +AC_REQUIRE([AC_PROG_MAKE_SET])dnl +AC_REQUIRE([AM_SET_LEADING_DOT])dnl + +_AM_IF_OPTION([no-dependencies],, +[AC_PROVIDE_IFELSE([AC_PROG_CC], + [_AM_DEPENDENCIES(CC)], + [define([AC_PROG_CC], + defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl +AC_PROVIDE_IFELSE([AC_PROG_CXX], + [_AM_DEPENDENCIES(CXX)], + [define([AC_PROG_CXX], + defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl +]) +]) + + +# When config.status generates a header, we must update the stamp-h file. +# This file resides in the same directory as the config header +# that is generated. The stamp files are numbered to have different names. + +# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the +# loop where config.status creates the headers, so we can generate +# our stamp files there. +AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], +[# Compute $1's index in $config_headers. +_am_stamp_count=1 +for _am_header in $config_headers :; do + case $_am_header in + $1 | $1:* ) + break ;; + * ) + _am_stamp_count=`expr $_am_stamp_count + 1` ;; + esac +done +echo "timestamp for $1" >`AS_DIRNAME([$1])`/stamp-h[]$_am_stamp_count]) + +# Copyright 2002 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA + +# AM_AUTOMAKE_VERSION(VERSION) +# ---------------------------- +# Automake X.Y traces this macro to ensure aclocal.m4 has been +# generated from the m4 files accompanying Automake X.Y. +AC_DEFUN([AM_AUTOMAKE_VERSION],[am__api_version="1.7"]) + +# AM_SET_CURRENT_AUTOMAKE_VERSION +# ------------------------------- +# Call AM_AUTOMAKE_VERSION so it can be traced. +# This function is AC_REQUIREd by AC_INIT_AUTOMAKE. +AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], + [AM_AUTOMAKE_VERSION([1.7.9])]) + +# Helper functions for option handling. -*- Autoconf -*- + +# Copyright 2001, 2002 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +# 02111-1307, USA. + +# serial 2 + +# _AM_MANGLE_OPTION(NAME) +# ----------------------- +AC_DEFUN([_AM_MANGLE_OPTION], +[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) + +# _AM_SET_OPTION(NAME) +# ------------------------------ +# Set option NAME. Presently that only means defining a flag for this option. +AC_DEFUN([_AM_SET_OPTION], +[m4_define(_AM_MANGLE_OPTION([$1]), 1)]) + +# _AM_SET_OPTIONS(OPTIONS) +# ---------------------------------- +# OPTIONS is a space-separated list of Automake options. +AC_DEFUN([_AM_SET_OPTIONS], +[AC_FOREACH([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) + +# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET]) +# ------------------------------------------- +# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. +AC_DEFUN([_AM_IF_OPTION], +[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) + +# +# Check to make sure that the build environment is sane. +# + +# Copyright 1996, 1997, 2000, 2001 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +# 02111-1307, USA. + +# serial 3 + +# AM_SANITY_CHECK +# --------------- +AC_DEFUN([AM_SANITY_CHECK], +[AC_MSG_CHECKING([whether build environment is sane]) +# Just in case +sleep 1 +echo timestamp > conftest.file +# Do `set' in a subshell so we don't clobber the current shell's +# arguments. Must try -L first in case configure is actually a +# symlink; some systems play weird games with the mod time of symlinks +# (eg FreeBSD returns the mod time of the symlink's containing +# directory). +if ( + set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null` + if test "$[*]" = "X"; then + # -L didn't work. + set X `ls -t $srcdir/configure conftest.file` + fi + rm -f conftest.file + if test "$[*]" != "X $srcdir/configure conftest.file" \ + && test "$[*]" != "X conftest.file $srcdir/configure"; then + + # If neither matched, then we have a broken ls. This can happen + # if, for instance, CONFIG_SHELL is bash and it inherits a + # broken ls alias from the environment. This has actually + # happened. Such a system could not be considered "sane". + AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken +alias in your environment]) + fi + + test "$[2]" = conftest.file + ) +then + # Ok. + : +else + AC_MSG_ERROR([newly created file is older than distributed files! +Check your system clock]) +fi +AC_MSG_RESULT(yes)]) + +# -*- Autoconf -*- + + +# Copyright 1997, 1999, 2000, 2001 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +# 02111-1307, USA. + +# serial 3 + +# AM_MISSING_PROG(NAME, PROGRAM) +# ------------------------------ +AC_DEFUN([AM_MISSING_PROG], +[AC_REQUIRE([AM_MISSING_HAS_RUN]) +$1=${$1-"${am_missing_run}$2"} +AC_SUBST($1)]) + + +# AM_MISSING_HAS_RUN +# ------------------ +# Define MISSING if not defined so far and test if it supports --run. +# If it does, set am_missing_run to use it, otherwise, to nothing. +AC_DEFUN([AM_MISSING_HAS_RUN], +[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl +test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing" +# Use eval to expand $SHELL +if eval "$MISSING --run true"; then + am_missing_run="$MISSING --run " +else + am_missing_run= + AC_MSG_WARN([`missing' script is too old or missing]) +fi +]) + +# AM_AUX_DIR_EXPAND + +# Copyright 2001 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +# 02111-1307, USA. + +# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets +# $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to +# `$srcdir', `$srcdir/..', or `$srcdir/../..'. +# +# Of course, Automake must honor this variable whenever it calls a +# tool from the auxiliary directory. The problem is that $srcdir (and +# therefore $ac_aux_dir as well) can be either absolute or relative, +# depending on how configure is run. This is pretty annoying, since +# it makes $ac_aux_dir quite unusable in subdirectories: in the top +# source directory, any form will work fine, but in subdirectories a +# relative path needs to be adjusted first. +# +# $ac_aux_dir/missing +# fails when called from a subdirectory if $ac_aux_dir is relative +# $top_srcdir/$ac_aux_dir/missing +# fails if $ac_aux_dir is absolute, +# fails when called from a subdirectory in a VPATH build with +# a relative $ac_aux_dir +# +# The reason of the latter failure is that $top_srcdir and $ac_aux_dir +# are both prefixed by $srcdir. In an in-source build this is usually +# harmless because $srcdir is `.', but things will broke when you +# start a VPATH build or use an absolute $srcdir. +# +# So we could use something similar to $top_srcdir/$ac_aux_dir/missing, +# iff we strip the leading $srcdir from $ac_aux_dir. That would be: +# am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"` +# and then we would define $MISSING as +# MISSING="\${SHELL} $am_aux_dir/missing" +# This will work as long as MISSING is not called from configure, because +# unfortunately $(top_srcdir) has no meaning in configure. +# However there are other variables, like CC, which are often used in +# configure, and could therefore not use this "fixed" $ac_aux_dir. +# +# Another solution, used here, is to always expand $ac_aux_dir to an +# absolute PATH. The drawback is that using absolute paths prevent a +# configured tree to be moved without reconfiguration. + +# Rely on autoconf to set up CDPATH properly. +AC_PREREQ([2.50]) + +AC_DEFUN([AM_AUX_DIR_EXPAND], [ +# expand $ac_aux_dir to an absolute path +am_aux_dir=`cd $ac_aux_dir && pwd` +]) + +# AM_PROG_INSTALL_SH +# ------------------ +# Define $install_sh. + +# Copyright 2001 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +# 02111-1307, USA. + +AC_DEFUN([AM_PROG_INSTALL_SH], +[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl +install_sh=${install_sh-"$am_aux_dir/install-sh"} +AC_SUBST(install_sh)]) + +# AM_PROG_INSTALL_STRIP + +# Copyright 2001 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +# 02111-1307, USA. + +# One issue with vendor `install' (even GNU) is that you can't +# specify the program used to strip binaries. This is especially +# annoying in cross-compiling environments, where the build's strip +# is unlikely to handle the host's binaries. +# Fortunately install-sh will honor a STRIPPROG variable, so we +# always use install-sh in `make install-strip', and initialize +# STRIPPROG with the value of the STRIP variable (set by the user). +AC_DEFUN([AM_PROG_INSTALL_STRIP], +[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl +# Installed binaries are usually stripped using `strip' when the user +# run `make install-strip'. However `strip' might not be the right +# tool to use in cross-compilation environments, therefore Automake +# will honor the `STRIP' environment variable to overrule this program. +dnl Don't test for $cross_compiling = yes, because it might be `maybe'. +if test "$cross_compiling" != no; then + AC_CHECK_TOOL([STRIP], [strip], :) +fi +INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s" +AC_SUBST([INSTALL_STRIP_PROGRAM])]) + +# -*- Autoconf -*- +# Copyright (C) 2003 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +# 02111-1307, USA. + +# serial 1 + +# Check whether the underlying file-system supports filenames +# with a leading dot. For instance MS-DOS doesn't. +AC_DEFUN([AM_SET_LEADING_DOT], +[rm -rf .tst 2>/dev/null +mkdir .tst 2>/dev/null +if test -d .tst; then + am__leading_dot=. +else + am__leading_dot=_ +fi +rmdir .tst 2>/dev/null +AC_SUBST([am__leading_dot])]) + +# serial 5 -*- Autoconf -*- + +# Copyright (C) 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +# 02111-1307, USA. + + +# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be +# written in clear, in which case automake, when reading aclocal.m4, +# will think it sees a *use*, and therefore will trigger all it's +# C support machinery. Also note that it means that autoscan, seeing +# CC etc. in the Makefile, will ask for an AC_PROG_CC use... + + + +# _AM_DEPENDENCIES(NAME) +# ---------------------- +# See how the compiler implements dependency checking. +# NAME is "CC", "CXX", "GCJ", or "OBJC". +# We try a few techniques and use that to set a single cache variable. +# +# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was +# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular +# dependency, and given that the user is not expected to run this macro, +# just rely on AC_PROG_CC. +AC_DEFUN([_AM_DEPENDENCIES], +[AC_REQUIRE([AM_SET_DEPDIR])dnl +AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl +AC_REQUIRE([AM_MAKE_INCLUDE])dnl +AC_REQUIRE([AM_DEP_TRACK])dnl + +ifelse([$1], CC, [depcc="$CC" am_compiler_list=], + [$1], CXX, [depcc="$CXX" am_compiler_list=], + [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'], + [$1], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'], + [depcc="$$1" am_compiler_list=]) + +AC_CACHE_CHECK([dependency style of $depcc], + [am_cv_$1_dependencies_compiler_type], +[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then + # We make a subdir and do the tests there. Otherwise we can end up + # making bogus files that we don't know about and never remove. For + # instance it was reported that on HP-UX the gcc test will end up + # making a dummy file named `D' -- because `-MD' means `put the output + # in D'. + mkdir conftest.dir + # Copy depcomp to subdir because otherwise we won't find it if we're + # using a relative directory. + cp "$am_depcomp" conftest.dir + cd conftest.dir + # We will build objects and dependencies in a subdirectory because + # it helps to detect inapplicable dependency modes. For instance + # both Tru64's cc and ICC support -MD to output dependencies as a + # side effect of compilation, but ICC will put the dependencies in + # the current directory while Tru64 will put them in the object + # directory. + mkdir sub + + am_cv_$1_dependencies_compiler_type=none + if test "$am_compiler_list" = ""; then + am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp` + fi + for depmode in $am_compiler_list; do + # Setup a source with many dependencies, because some compilers + # like to wrap large dependency lists on column 80 (with \), and + # we should not choose a depcomp mode which is confused by this. + # + # We need to recreate these files for each test, as the compiler may + # overwrite some of them when testing with obscure command lines. + # This happens at least with the AIX C compiler. + : > sub/conftest.c + for i in 1 2 3 4 5 6; do + echo '#include "conftst'$i'.h"' >> sub/conftest.c + : > sub/conftst$i.h + done + echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf + + case $depmode in + nosideeffect) + # after this tag, mechanisms are not by side-effect, so they'll + # only be used when explicitly requested + if test "x$enable_dependency_tracking" = xyes; then + continue + else + break + fi + ;; + none) break ;; + esac + # We check with `-c' and `-o' for the sake of the "dashmstdout" + # mode. It turns out that the SunPro C++ compiler does not properly + # handle `-M -o', and we need to detect this. + if depmode=$depmode \ + source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \ + depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ + $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \ + >/dev/null 2>conftest.err && + grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && + grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 && + ${MAKE-make} -s -f confmf > /dev/null 2>&1; then + # icc doesn't choke on unknown options, it will just issue warnings + # (even with -Werror). So we grep stderr for any message + # that says an option was ignored. + if grep 'ignoring option' conftest.err >/dev/null 2>&1; then :; else + am_cv_$1_dependencies_compiler_type=$depmode + break + fi + fi + done + + cd .. + rm -rf conftest.dir +else + am_cv_$1_dependencies_compiler_type=none +fi +]) +AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type]) +AM_CONDITIONAL([am__fastdep$1], [ + test "x$enable_dependency_tracking" != xno \ + && test "$am_cv_$1_dependencies_compiler_type" = gcc3]) +]) + + +# AM_SET_DEPDIR +# ------------- +# Choose a directory name for dependency files. +# This macro is AC_REQUIREd in _AM_DEPENDENCIES +AC_DEFUN([AM_SET_DEPDIR], +[AC_REQUIRE([AM_SET_LEADING_DOT])dnl +AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl +]) + + +# AM_DEP_TRACK +# ------------ +AC_DEFUN([AM_DEP_TRACK], +[AC_ARG_ENABLE(dependency-tracking, +[ --disable-dependency-tracking Speeds up one-time builds + --enable-dependency-tracking Do not reject slow dependency extractors]) +if test "x$enable_dependency_tracking" != xno; then + am_depcomp="$ac_aux_dir/depcomp" + AMDEPBACKSLASH='\' +fi +AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) +AC_SUBST([AMDEPBACKSLASH]) +]) + +# Generate code to set up dependency tracking. -*- Autoconf -*- + +# Copyright 1999, 2000, 2001, 2002 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +# 02111-1307, USA. + +#serial 2 + +# _AM_OUTPUT_DEPENDENCY_COMMANDS +# ------------------------------ +AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], +[for mf in $CONFIG_FILES; do + # Strip MF so we end up with the name of the file. + mf=`echo "$mf" | sed -e 's/:.*$//'` + # Check whether this is an Automake generated Makefile or not. + # We used to match only the files named `Makefile.in', but + # some people rename them; so instead we look at the file content. + # Grep'ing the first line is not enough: some people post-process + # each Makefile.in and add a new line on top of each file to say so. + # So let's grep whole file. + if grep '^#.*generated by automake' $mf > /dev/null 2>&1; then + dirpart=`AS_DIRNAME("$mf")` + else + continue + fi + grep '^DEP_FILES *= *[[^ @%:@]]' < "$mf" > /dev/null || continue + # Extract the definition of DEP_FILES from the Makefile without + # running `make'. + DEPDIR=`sed -n -e '/^DEPDIR = / s///p' < "$mf"` + test -z "$DEPDIR" && continue + # When using ansi2knr, U may be empty or an underscore; expand it + U=`sed -n -e '/^U = / s///p' < "$mf"` + test -d "$dirpart/$DEPDIR" || mkdir "$dirpart/$DEPDIR" + # We invoke sed twice because it is the simplest approach to + # changing $(DEPDIR) to its actual value in the expansion. + for file in `sed -n -e ' + /^DEP_FILES = .*\\\\$/ { + s/^DEP_FILES = // + :loop + s/\\\\$// + p + n + /\\\\$/ b loop + p + } + /^DEP_FILES = / s/^DEP_FILES = //p' < "$mf" | \ + sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do + # Make sure the directory exists. + test -f "$dirpart/$file" && continue + fdir=`AS_DIRNAME(["$file"])` + AS_MKDIR_P([$dirpart/$fdir]) + # echo "creating $dirpart/$file" + echo '# dummy' > "$dirpart/$file" + done +done +])# _AM_OUTPUT_DEPENDENCY_COMMANDS + + +# AM_OUTPUT_DEPENDENCY_COMMANDS +# ----------------------------- +# This macro should only be invoked once -- use via AC_REQUIRE. +# +# This code is only required when automatic dependency tracking +# is enabled. FIXME. This creates each `.P' file that we will +# need in order to bootstrap the dependency handling code. +AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], +[AC_CONFIG_COMMANDS([depfiles], + [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS], + [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"]) +]) + +# Check to see how 'make' treats includes. -*- Autoconf -*- + +# Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +# 02111-1307, USA. + +# serial 2 + +# AM_MAKE_INCLUDE() +# ----------------- +# Check to see how make treats includes. +AC_DEFUN([AM_MAKE_INCLUDE], +[am_make=${MAKE-make} +cat > confinc << 'END' +am__doit: + @echo done +.PHONY: am__doit +END +# If we don't find an include directive, just comment out the code. +AC_MSG_CHECKING([for style of include used by $am_make]) +am__include="#" +am__quote= +_am_result=none +# First try GNU make style include. +echo "include confinc" > confmf +# We grep out `Entering directory' and `Leaving directory' +# messages which can occur if `w' ends up in MAKEFLAGS. +# In particular we don't look at `^make:' because GNU make might +# be invoked under some other name (usually "gmake"), in which +# case it prints its new name instead of `make'. +if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then + am__include=include + am__quote= + _am_result=GNU +fi +# Now try BSD make style include. +if test "$am__include" = "#"; then + echo '.include "confinc"' > confmf + if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then + am__include=.include + am__quote="\"" + _am_result=BSD + fi +fi +AC_SUBST([am__include]) +AC_SUBST([am__quote]) +AC_MSG_RESULT([$_am_result]) +rm -f confinc confmf +]) + +# AM_CONDITIONAL -*- Autoconf -*- + +# Copyright 1997, 2000, 2001 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +# 02111-1307, USA. + +# serial 5 + +AC_PREREQ(2.52) + +# AM_CONDITIONAL(NAME, SHELL-CONDITION) +# ------------------------------------- +# Define a conditional. +AC_DEFUN([AM_CONDITIONAL], +[ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], + [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl +AC_SUBST([$1_TRUE]) +AC_SUBST([$1_FALSE]) +if $2; then + $1_TRUE= + $1_FALSE='#' +else + $1_TRUE='#' + $1_FALSE= +fi +AC_CONFIG_COMMANDS_PRE( +[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then + AC_MSG_ERROR([conditional "$1" was never defined. +Usually this means the macro was only invoked conditionally.]) +fi])]) + +# Add --enable-maintainer-mode option to configure. +# From Jim Meyering + +# Copyright 1996, 1998, 2000, 2001, 2002 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +# 02111-1307, USA. + +# serial 2 + +AC_DEFUN([AM_MAINTAINER_MODE], +[AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles]) + dnl maintainer-mode is disabled by default + AC_ARG_ENABLE(maintainer-mode, +[ --enable-maintainer-mode enable make rules and dependencies not useful + (and sometimes confusing) to the casual installer], + USE_MAINTAINER_MODE=$enableval, + USE_MAINTAINER_MODE=no) + AC_MSG_RESULT([$USE_MAINTAINER_MODE]) + AM_CONDITIONAL(MAINTAINER_MODE, [test $USE_MAINTAINER_MODE = yes]) + MAINT=$MAINTAINER_MODE_TRUE + AC_SUBST(MAINT)dnl +] +) + +AU_DEFUN([jm_MAINTAINER_MODE], [AM_MAINTAINER_MODE]) + +# Like AC_CONFIG_HEADER, but automatically create stamp file. -*- Autoconf -*- + +# Copyright 1996, 1997, 2000, 2001 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +# 02111-1307, USA. + +AC_PREREQ([2.52]) + +# serial 6 + +# AM_CONFIG_HEADER is obsolete. It has been replaced by AC_CONFIG_HEADERS. +AU_DEFUN([AM_CONFIG_HEADER], [AC_CONFIG_HEADERS($@)]) + +# pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*- +# +# Copyright © 2004 Scott James Remnant . +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +# PKG_PROG_PKG_CONFIG([MIN-VERSION]) +# ---------------------------------- +AC_DEFUN([PKG_PROG_PKG_CONFIG], +[m4_pattern_forbid([^_?PKG_[A-Z_]+$]) +m4_pattern_allow([^PKG_CONFIG(_PATH)?$]) +AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])dnl +if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then + AC_PATH_TOOL([PKG_CONFIG], [pkg-config]) +fi +if test -n "$PKG_CONFIG"; then + _pkg_min_version=m4_default([$1], [0.9.0]) + AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version]) + if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then + AC_MSG_RESULT([yes]) + else + AC_MSG_RESULT([no]) + PKG_CONFIG="" + fi + +fi[]dnl +])# PKG_PROG_PKG_CONFIG + +# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) +# +# Check to see whether a particular set of modules exists. Similar +# to PKG_CHECK_MODULES(), but does not set variables or print errors. +# +# +# Similar to PKG_CHECK_MODULES, make sure that the first instance of +# this or PKG_CHECK_MODULES is called, or make sure to call +# PKG_CHECK_EXISTS manually +# -------------------------------------------------------------- +AC_DEFUN([PKG_CHECK_EXISTS], +[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl +if test -n "$PKG_CONFIG" && \ + AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then + m4_ifval([$2], [$2], [:]) +m4_ifvaln([$3], [else + $3])dnl +fi]) + + +# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES]) +# --------------------------------------------- +m4_define([_PKG_CONFIG], +[if test -n "$PKG_CONFIG"; then + if test -n "$$1"; then + pkg_cv_[]$1="$$1" + else + PKG_CHECK_EXISTS([$3], + [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`], + [pkg_failed=yes]) + fi +else + pkg_failed=untried +fi[]dnl +])# _PKG_CONFIG + +# _PKG_SHORT_ERRORS_SUPPORTED +# ----------------------------- +AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED], +[AC_REQUIRE([PKG_PROG_PKG_CONFIG]) +if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then + _pkg_short_errors_supported=yes +else + _pkg_short_errors_supported=no +fi[]dnl +])# _PKG_SHORT_ERRORS_SUPPORTED + + +# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND], +# [ACTION-IF-NOT-FOUND]) +# +# +# Note that if there is a possibility the first call to +# PKG_CHECK_MODULES might not happen, you should be sure to include an +# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac +# +# +# -------------------------------------------------------------- +AC_DEFUN([PKG_CHECK_MODULES], +[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl +AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl +AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl + +pkg_failed=no +AC_MSG_CHECKING([for $1]) + +_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2]) +_PKG_CONFIG([$1][_LIBS], [libs], [$2]) + +m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS +and $1[]_LIBS to avoid the need to call pkg-config. +See the pkg-config man page for more details.]) + +if test $pkg_failed = yes; then + _PKG_SHORT_ERRORS_SUPPORTED + if test $_pkg_short_errors_supported = yes; then + $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "$2"` + else + $1[]_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "$2"` + fi + # Put the nasty error message in config.log where it belongs + echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD + + ifelse([$4], , [AC_MSG_ERROR(dnl +[Package requirements ($2) were not met: + +$$1_PKG_ERRORS + +Consider adjusting the PKG_CONFIG_PATH environment variable if you +installed software in a non-standard prefix. + +_PKG_TEXT +])], + [$4]) +elif test $pkg_failed = untried; then + ifelse([$4], , [AC_MSG_FAILURE(dnl +[The pkg-config script could not be found or is too old. Make sure it +is in your PATH or set the PKG_CONFIG environment variable to the full +path to pkg-config. + +_PKG_TEXT + +To get pkg-config, see .])], + [$4]) +else + $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS + $1[]_LIBS=$pkg_cv_[]$1[]_LIBS + AC_MSG_RESULT([yes]) + ifelse([$3], , :, [$3]) +fi[]dnl +])# PKG_CHECK_MODULES + +dnl $XdotOrg: lib/xtrans/xtrans.m4,v 1.6 2005/07/26 18:59:11 alanc Exp $ +dnl +dnl Copyright 2005 Sun Microsystems, Inc. All rights reserved. +dnl +dnl Permission to use, copy, modify, distribute, and sell this software and its +dnl documentation for any purpose is hereby granted without fee, provided that +dnl the above copyright notice appear in all copies and that both that +dnl copyright notice and this permission notice appear in supporting +dnl documentation. +dnl +dnl The above copyright notice and this permission notice shall be included +dnl in all copies or substantial portions of the Software. +dnl +dnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +dnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +dnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +dnl IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR +dnl OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +dnl ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +dnl OTHER DEALINGS IN THE SOFTWARE. +dnl +dnl Except as contained in this notice, the name of the copyright holders shall +dnl not be used in advertising or otherwise to promote the sale, use or +dnl other dealings in this Software without prior written authorization +dnl from the copyright holders. +dnl + +# XTRANS_TCP_FLAGS() +# ------------------ +# Find needed libraries for TCP sockets, and check for IPv6 support +AC_DEFUN([XTRANS_TCP_FLAGS],[ + # SVR4 hides these in libraries other than libc + AC_SEARCH_LIBS(socket, [socket]) + AC_SEARCH_LIBS(gethostbyname, [nsl]) + + # Needs to come after above checks for libsocket & libnsl for SVR4 systems + AC_ARG_ENABLE(ipv6, + AC_HELP_STRING([--enable-IPv6],[Enable IPv6 support]), + [IPV6CONN=$enableval], + [AC_CHECK_FUNC(getaddrinfo,[IPV6CONN=yes],[IPV6CONN=no])]) + AC_MSG_CHECKING([if IPv6 support should be built]) + if test "$IPV6CONN" = "yes"; then + AC_DEFINE(IPv6,1,[Support IPv6 for TCP connections]) + fi + AC_MSG_RESULT($IPV6CONN) + + # 4.3BSD-Reno added a new member to struct sockaddr_in + AC_CHECK_MEMBER([struct sockaddr_in.sin_len], + AC_DEFINE([BSD44SOCKETS],1, + [Define to 1 if `struct sockaddr_in' has a `sin_len' member]), [], [ +#include +#include +#include + ]) +]) # XTRANS_TCP_FLAGS + +# XTRANS_CONNECTION_FLAGS() +# ------------------------- +# Standard checks for which Xtrans transports to use by the Xorg packages +# that use Xtrans functions +AC_DEFUN([XTRANS_CONNECTION_FLAGS], +[AC_REQUIRE([AC_TYPE_SIGNAL]) + AC_ARG_ENABLE(unix-transport, + AC_HELP_STRING([--enable-unix-transport],[Enable UNIX domain socket transport]), + [UNIXCONN=$enableval], [UNIXCONN=yes]) + AC_ARG_ENABLE(tcp-transport, + AC_HELP_STRING([--enable-tcp-transport],[Enable TCP socket transport]), + [TCPCONN=$enableval], [TCPCONN=yes]) + AC_MSG_CHECKING([if Xtrans should support UNIX socket connections]) + if test "$UNIXCONN" = "yes"; then + AC_DEFINE(UNIXCONN,1,[Support UNIX socket connections]) + fi + AC_MSG_RESULT($UNIXCONN) + AC_MSG_CHECKING([if Xtrans should support TCP socket connections]) + AC_MSG_RESULT($TCPCONN) + if test "$TCPCONN" = "yes"; then + AC_DEFINE(TCPCONN,1,[Support TCP socket connections]) + XTRANS_TCP_FLAGS + fi +]) # XTRANS_CONNECTION_FLAGS + + +# XTRANS_SECURE_RPC_FLAGS() +# ------------------------- +# Check for Secure RPC functions - must come after XTRANS_TCP_FLAGS +# so that any necessary networking libraries are already found +AC_DEFUN([XTRANS_SECURE_RPC_FLAGS], +[AC_REQUIRE([XTRANS_TCP_FLAGS]) + AC_ARG_ENABLE(secure-rpc, + AC_HELP_STRING([--enable-secure-rpc],[Enable Secure RPC]), + [SECURE_RPC=$enableval], [SECURE_RPC="try"]) + + if test "x$SECURE_RPC" = "xyes" -o "x$SECURE_RPC" = "xtry" ; then + FOUND_SECURE_RPC="no" + AC_CHECK_FUNCS([authdes_seccreate authdes_create], + [FOUND_SECURE_RPC="yes"]) + if test "x$FOUND_SECURE_RPC" = "xno" ; then + if test "x$SECURE_RPC" = "xyes" ; then + AC_MSG_ERROR([Secure RPC requested, but required functions not found]) + fi + SECURE_RPC="no" + else + dnl FreeBSD keeps getsecretkey in librpcsvc + AC_SEARCH_LIBS(getsecretkey, [rpcsvc]) + SECURE_RPC="yes" + fi + fi + AC_MSG_CHECKING([if Secure RPC authentication ("SUN-DES-1") should be supported]) + if test "x$SECURE_RPC" = "xyes" ; then + AC_DEFINE(SECURE_RPC, 1, [Support Secure RPC ("SUN-DES-1") authentication for X11 clients]) + fi + AC_MSG_RESULT($SECURE_RPC) +]) # XTRANS_SECURE_RPC_FLAGS + + +dnl $Id: aclocal.m4,v 1.1.1.1 2006/11/26 14:09:32 matthieu Exp $ +dnl +dnl Copyright 2005 Sun Microsystems, Inc. All rights reserved. +dnl +dnl Permission to use, copy, modify, distribute, and sell this software and its +dnl documentation for any purpose is hereby granted without fee, provided that +dnl the above copyright notice appear in all copies and that both that +dnl copyright notice and this permission notice appear in supporting +dnl documentation. +dnl +dnl The above copyright notice and this permission notice shall be included +dnl in all copies or substantial portions of the Software. +dnl +dnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +dnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +dnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +dnl IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR +dnl OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +dnl ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +dnl OTHER DEALINGS IN THE SOFTWARE. +dnl +dnl Except as contained in this notice, the name of the copyright holders shall +dnl not be used in advertising or otherwise to promote the sale, use or +dnl other dealings in this Software without prior written authorization +dnl from the copyright holders. +dnl + +# XORG_PROG_RAWCPP() +# ------------------ +# Find cpp program and necessary flags for use in pre-processing text files +# such as man pages and config files +AC_DEFUN([XORG_PROG_RAWCPP],[ +AC_REQUIRE([AC_PROG_CPP]) +AC_PATH_PROGS(RAWCPP, [cpp], [${CPP}], + [$PATH:/bin:/usr/bin:/usr/lib:/usr/libexec:/usr/ccs/lib:/usr/ccs/lbin:/lib]) + +# Check for flag to avoid builtin definitions - assumes unix is predefined, +# which is not the best choice for supporting other OS'es, but covers most +# of the ones we need for now. +AC_MSG_CHECKING([if $RAWCPP requires -undef]) +AC_LANG_CONFTEST([Does cpp redefine unix ?]) +if test `${RAWCPP} < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then + AC_MSG_RESULT([no]) +else + if test `${RAWCPP} -undef < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then + RAWCPPFLAGS=-undef + AC_MSG_RESULT([yes]) + else + AC_MSG_ERROR([${RAWCPP} defines unix with or without -undef. I don't know what to do.]) + fi +fi +rm -f conftest.$ac_ext + +AC_MSG_CHECKING([if $RAWCPP requires -traditional]) +AC_LANG_CONFTEST([Does cpp preserve "whitespace"?]) +if test `${RAWCPP} < conftest.$ac_ext | grep -c 'preserve \"'` -eq 1 ; then + AC_MSG_RESULT([no]) +else + if test `${RAWCPP} -traditional < conftest.$ac_ext | grep -c 'preserve \"'` -eq 1 ; then + RAWCPPFLAGS="${RAWCPPFLAGS} -traditional" + AC_MSG_RESULT([yes]) + else + AC_MSG_ERROR([${RAWCPP} does not preserve whitespace with or without -traditional. I don't know what to do.]) + fi +fi +rm -f conftest.$ac_ext +AC_SUBST(RAWCPPFLAGS) +]) # XORG_PROG_RAWCPP + +# XORG_MANPAGE_SECTIONS() +# ----------------------- +# Determine which sections man pages go in for the different man page types +# on this OS - replaces *ManSuffix settings in old Imake *.cf per-os files. +# Not sure if there's any better way than just hardcoding by OS name. +# Override default settings by setting environment variables + +AC_DEFUN([XORG_MANPAGE_SECTIONS],[ +AC_REQUIRE([AC_CANONICAL_HOST]) + +if test x$APP_MAN_SUFFIX = x ; then + case $host_os in + linux*) APP_MAN_SUFFIX=1x ;; + *) APP_MAN_SUFFIX=1 ;; + esac +fi +if test x$APP_MAN_DIR = x ; then + case $host_os in + linux*) APP_MAN_DIR='$(mandir)/man1' ;; + *) APP_MAN_DIR='$(mandir)/man$(APP_MAN_SUFFIX)' ;; + esac +fi + +if test x$LIB_MAN_SUFFIX = x ; then + case $host_os in + linux*) LIB_MAN_SUFFIX=3x ;; + *) LIB_MAN_SUFFIX=3 ;; + esac +fi +if test x$LIB_MAN_DIR = x ; then + case $host_os in + linux*) LIB_MAN_DIR='$(mandir)/man3' ;; + *) LIB_MAN_DIR='$(mandir)/man$(LIB_MAN_SUFFIX)' ;; + esac +fi + +if test x$FILE_MAN_SUFFIX = x ; then + case $host_os in + linux*) FILE_MAN_SUFFIX=5x ;; + solaris*) FILE_MAN_SUFFIX=4 ;; + *) FILE_MAN_SUFFIX=5 ;; + esac +fi +if test x$FILE_MAN_DIR = x ; then + case $host_os in + linux*) FILE_MAN_DIR='$(mandir)/man5' ;; + *) FILE_MAN_DIR='$(mandir)/man$(FILE_MAN_SUFFIX)' ;; + esac +fi + +# In Imake's linux.cf, the misc man suffix & dir was only changed for +# LinuxDebian, not other Linuxes, so we leave it unchanged here +if test x$MISC_MAN_SUFFIX = x ; then + case $host_os in +# linux*) MISC_MAN_SUFFIX=7x ;; + solaris*) MISC_MAN_SUFFIX=5 ;; + *) MISC_MAN_SUFFIX=7 ;; + esac +fi +if test x$MISC_MAN_DIR = x ; then + case $host_os in +# linux*) MISC_MAN_DIR='$(mandir)/man7' ;; + *) MISC_MAN_DIR='$(mandir)/man$(MISC_MAN_SUFFIX)' ;; + esac +fi + +# In Imake's linux.cf, the driver man suffix & dir was only changed for +# LinuxDebian, not other Linuxes, so we leave it unchanged here +if test x$DRIVER_MAN_SUFFIX = x ; then + case $host_os in +# linux*) DRIVER_MAN_SUFFIX=4x ;; + solaris*) DRIVER_MAN_SUFFIX=7 ;; + *) DRIVER_MAN_SUFFIX=4 ;; + esac +fi +if test x$DRIVER_MAN_DIR = x ; then + case $host_os in +# linux*) DRIVER_MAN_DIR='$(mandir)/man4' ;; + *) DRIVER_MAN_DIR='$(mandir)/man$(DRIVER_MAN_SUFFIX)' ;; + esac +fi + +if test x$ADMIN_MAN_SUFFIX = x ; then + case $host_os in + solaris*) ADMIN_MAN_SUFFIX=1m ;; + *) ADMIN_MAN_SUFFIX=8 ;; + esac +fi +if test x$ADMIN_MAN_DIR = x ; then + ADMIN_MAN_DIR='$(mandir)/man$(ADMIN_MAN_SUFFIX)' +fi + + +AC_SUBST([APP_MAN_SUFFIX]) +AC_SUBST([LIB_MAN_SUFFIX]) +AC_SUBST([FILE_MAN_SUFFIX]) +AC_SUBST([MISC_MAN_SUFFIX]) +AC_SUBST([DRIVER_MAN_SUFFIX]) +AC_SUBST([ADMIN_MAN_SUFFIX]) +AC_SUBST([APP_MAN_DIR]) +AC_SUBST([LIB_MAN_DIR]) +AC_SUBST([FILE_MAN_DIR]) +AC_SUBST([MISC_MAN_DIR]) +AC_SUBST([DRIVER_MAN_DIR]) +AC_SUBST([ADMIN_MAN_DIR]) +]) # XORG_MANPAGE_SECTIONS + +# XORG_CHECK_LINUXDOC +# ------------------- +# Defines the variable MAKE_TEXT if the necessary tools and +# files are found. $(MAKE_TEXT) blah.sgml will then produce blah.txt. +# Whether or not the necessary tools and files are found can be checked +# with the AM_CONDITIONAL "BUILD_LINUXDOC" +AC_DEFUN([XORG_CHECK_LINUXDOC],[ +AC_CHECK_FILE( + [$prefix/share/X11/sgml/defs.ent], + [DEFS_ENT_PATH=$prefix/share/X11/sgml], + [DEFS_ENT_PATH=] +) + +AC_PATH_PROG(LINUXDOC, linuxdoc) +AC_PATH_PROG(PS2PDF, ps2pdf) + +AC_MSG_CHECKING([Whether to build documentation]) + +if test x$DEFS_ENT_PATH != x && test x$LINUXDOC != x ; then + BUILDDOC=yes +else + BUILDDOC=no +fi + +AM_CONDITIONAL(BUILD_LINUXDOC, [test x$BUILDDOC = xyes]) + +AC_MSG_RESULT([$BUILDDOC]) + +AC_MSG_CHECKING([Whether to build pdf documentation]) + +if test x$PS2PDF != x ; then + BUILDPDFDOC=yes +else + BUILDPDFDOC=no +fi + +AM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes]) + +AC_MSG_RESULT([$BUILDPDFDOC]) + +MAKE_TEXT="SGML_SEARCH_PATH=$DEFS_ENT_PATH GROFF_NO_SGR=y $LINUXDOC -B txt" +MAKE_PS="SGML_SEARCH_PATH=$DEFS_ENT_PATH $LINUXDOC -B latex --papersize=letter --output=ps" +MAKE_PDF="$PS2PDF" +MAKE_HTML="SGML_SEARCH_PATH=$DEFS_ENT_PATH $LINUXDOC -B html --split=0" + +AC_SUBST(MAKE_TEXT) +AC_SUBST(MAKE_PS) +AC_SUBST(MAKE_PDF) +AC_SUBST(MAKE_HTML) +]) # XORG_CHECK_LINUXDOC + +# XORG_CHECK_MALLOC_ZERO +# ---------------------- +# Defines {MALLOC,XMALLOC,XTMALLOC}_ZERO_CFLAGS appropriately if +# malloc(0) returns NULL. Packages should add one of these cflags to +# their AM_CFLAGS (or other appropriate *_CFLAGS) to use them. +AC_DEFUN([XORG_CHECK_MALLOC_ZERO],[ +AC_ARG_ENABLE(malloc0returnsnull, + AC_HELP_STRING([--enable-malloc0returnsnull], + [malloc(0) returns NULL (default: auto)]), + [MALLOC_ZERO_RETURNS_NULL=$enableval], + [MALLOC_ZERO_RETURNS_NULL=auto]) + +AC_MSG_CHECKING([whether malloc(0) returns NULL]) +if test "x$MALLOC_ZERO_RETURNS_NULL" = xauto; then + AC_RUN_IFELSE([ +char *malloc(); +char *realloc(); +char *calloc(); +main() { + char *m0, *r0, *c0, *p; + m0 = malloc(0); + p = malloc(10); + r0 = realloc(p,0); + c0 = calloc(0); + exit(m0 == 0 || r0 == 0 || c0 == 0 ? 0 : 1); +}], + [MALLOC_ZERO_RETURNS_NULL=yes], + [MALLOC_ZERO_RETURNS_NULL=no]) +fi +AC_MSG_RESULT([$MALLOC_ZERO_RETURNS_NULL]) + +if test "x$MALLOC_ZERO_RETURNS_NULL" = xyes; then + MALLOC_ZERO_CFLAGS="-DMALLOC_0_RETURNS_NULL" + XMALLOC_ZERO_CFLAGS=$MALLOC_ZERO_CFLAGS + XTMALLOC_ZERO_CFLAGS="$MALLOC_ZERO_CFLAGS -DXTMALLOC_BC" +else + MALLOC_ZERO_CFLAGS="" + XMALLOC_ZERO_CFLAGS="" + XTMALLOC_ZERO_CFLAGS="" +fi + +AC_SUBST([MALLOC_ZERO_CFLAGS]) +AC_SUBST([XMALLOC_ZERO_CFLAGS]) +AC_SUBST([XTMALLOC_ZERO_CFLAGS]) +]) # XORG_CHECK_MALLOC_ZERO + +dnl Copyright 2005 Red Hat, Inc +dnl +dnl Permission to use, copy, modify, distribute, and sell this software and its +dnl documentation for any purpose is hereby granted without fee, provided that +dnl the above copyright notice appear in all copies and that both that +dnl copyright notice and this permission notice appear in supporting +dnl documentation. +dnl +dnl The above copyright notice and this permission notice shall be included +dnl in all copies or substantial portions of the Software. +dnl +dnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +dnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +dnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +dnl IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR +dnl OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +dnl ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +dnl OTHER DEALINGS IN THE SOFTWARE. +dnl +dnl Except as contained in this notice, the name of the copyright holders shall +dnl not be used in advertising or otherwise to promote the sale, use or +dnl other dealings in this Software without prior written authorization +dnl from the copyright holders. +dnl + +# XORG_RELEASE_VERSION +# -------------------- +# Adds --with/without-release-string and changes the PACKAGE and +# PACKAGE_TARNAME to use "$PACKAGE{_TARNAME}-$RELEASE_VERSION". If +# no option is given, PACKAGE and PACKAGE_TARNAME are unchanged. + +AC_DEFUN([XORG_RELEASE_VERSION],[ + AC_ARG_WITH(release-version, + AC_HELP_STRING([--with-release-version=STRING], + [Use release version string in package name]), + [RELEASE_VERSION="$withval"], + [RELEASE_VERSION=""]) + if test "x$RELEASE_VERSION" != "x"; then + PACKAGE="$PACKAGE-$RELEASE_VERSION" + PACKAGE_TARNAME="$PACKAGE_TARNAME-$RELEASE_VERSION" + AC_MSG_NOTICE([Building with package name set to $PACKAGE]) + fi +]) + diff --git a/app/lbxproxy/compile b/app/lbxproxy/compile new file mode 100644 index 000000000..9bb997a6a --- /dev/null +++ b/app/lbxproxy/compile @@ -0,0 +1,99 @@ +#! /bin/sh + +# Wrapper for compilers which do not understand `-c -o'. + +# Copyright 1999, 2000 Free Software Foundation, Inc. +# Written by Tom Tromey . +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +# Usage: +# compile PROGRAM [ARGS]... +# `-o FOO.o' is removed from the args passed to the actual compile. + +prog=$1 +shift + +ofile= +cfile= +args= +while test $# -gt 0; do + case "$1" in + -o) + # configure might choose to run compile as `compile cc -o foo foo.c'. + # So we do something ugly here. + ofile=$2 + shift + case "$ofile" in + *.o | *.obj) + ;; + *) + args="$args -o $ofile" + ofile= + ;; + esac + ;; + *.c) + cfile=$1 + args="$args $1" + ;; + *) + args="$args $1" + ;; + esac + shift +done + +if test -z "$ofile" || test -z "$cfile"; then + # If no `-o' option was seen then we might have been invoked from a + # pattern rule where we don't need one. That is ok -- this is a + # normal compilation that the losing compiler can handle. If no + # `.c' file was seen then we are probably linking. That is also + # ok. + exec "$prog" $args +fi + +# Name of file we expect compiler to create. +cofile=`echo $cfile | sed -e 's|^.*/||' -e 's/\.c$/.o/'` + +# Create the lock directory. +# Note: use `[/.-]' here to ensure that we don't use the same name +# that we are using for the .o file. Also, base the name on the expected +# object file name, since that is what matters with a parallel build. +lockdir=`echo $cofile | sed -e 's|[/.-]|_|g'`.d +while true; do + if mkdir $lockdir > /dev/null 2>&1; then + break + fi + sleep 1 +done +# FIXME: race condition here if user kills between mkdir and trap. +trap "rmdir $lockdir; exit 1" 1 2 15 + +# Run the compile. +"$prog" $args +status=$? + +if test -f "$cofile"; then + mv "$cofile" "$ofile" +fi + +rmdir $lockdir +exit $status diff --git a/app/lbxproxy/config.guess b/app/lbxproxy/config.guess new file mode 100644 index 000000000..2fc3acce2 --- /dev/null +++ b/app/lbxproxy/config.guess @@ -0,0 +1,1411 @@ +#! /bin/sh +# Attempt to guess a canonical system name. +# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, +# 2000, 2001, 2002, 2003 Free Software Foundation, Inc. + +timestamp='2003-06-17' + +# This file is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +# Originally written by Per Bothner . +# Please send patches to . Submit a context +# diff and a properly formatted ChangeLog entry. +# +# This script attempts to guess a canonical system name similar to +# config.sub. If it succeeds, it prints the system name on stdout, and +# exits with 0. Otherwise, it exits with 1. +# +# The plan is that this can be called by configure scripts if you +# don't specify an explicit build system type. + +me=`echo "$0" | sed -e 's,.*/,,'` + +usage="\ +Usage: $0 [OPTION] + +Output the configuration name of the system \`$me' is run on. + +Operation modes: + -h, --help print this help, then exit + -t, --time-stamp print date of last modification, then exit + -v, --version print version number, then exit + +Report bugs and patches to ." + +version="\ +GNU config.guess ($timestamp) + +Originally written by Per Bothner. +Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001 +Free Software Foundation, Inc. + +This is free software; see the source for copying conditions. There is NO +warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." + +help=" +Try \`$me --help' for more information." + +# Parse command line +while test $# -gt 0 ; do + case $1 in + --time-stamp | --time* | -t ) + echo "$timestamp" ; exit 0 ;; + --version | -v ) + echo "$version" ; exit 0 ;; + --help | --h* | -h ) + echo "$usage"; exit 0 ;; + -- ) # Stop option processing + shift; break ;; + - ) # Use stdin as input. + break ;; + -* ) + echo "$me: invalid option $1$help" >&2 + exit 1 ;; + * ) + break ;; + esac +done + +if test $# != 0; then + echo "$me: too many arguments$help" >&2 + exit 1 +fi + +trap 'exit 1' 1 2 15 + +# CC_FOR_BUILD -- compiler used by this script. Note that the use of a +# compiler to aid in system detection is discouraged as it requires +# temporary files to be created and, as you can see below, it is a +# headache to deal with in a portable fashion. + +# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still +# use `HOST_CC' if defined, but it is deprecated. + +# Portable tmp directory creation inspired by the Autoconf team. + +set_cc_for_build=' +trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ; +trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ; +: ${TMPDIR=/tmp} ; + { tmp=`(umask 077 && mktemp -d -q "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || + { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } || + { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } || + { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ; +dummy=$tmp/dummy ; +tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ; +case $CC_FOR_BUILD,$HOST_CC,$CC in + ,,) echo "int x;" > $dummy.c ; + for c in cc gcc c89 c99 ; do + if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then + CC_FOR_BUILD="$c"; break ; + fi ; + done ; + if test x"$CC_FOR_BUILD" = x ; then + CC_FOR_BUILD=no_compiler_found ; + fi + ;; + ,,*) CC_FOR_BUILD=$CC ;; + ,*,*) CC_FOR_BUILD=$HOST_CC ;; +esac ;' + +# This is needed to find uname on a Pyramid OSx when run in the BSD universe. +# (ghazi@noc.rutgers.edu 1994-08-24) +if (test -f /.attbin/uname) >/dev/null 2>&1 ; then + PATH=$PATH:/.attbin ; export PATH +fi + +UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown +UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown +UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown +UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown + +## for Red Hat Linux +if test -f /etc/redhat-release ; then + VENDOR=redhat ; +else + VENDOR= ; +fi + +# Note: order is significant - the case branches are not exclusive. + +case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in + *:NetBSD:*:*) + # NetBSD (nbsd) targets should (where applicable) match one or + # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*, + # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently + # switched to ELF, *-*-netbsd* would select the old + # object file format. This provides both forward + # compatibility and a consistent mechanism for selecting the + # object file format. + # + # Note: NetBSD doesn't particularly care about the vendor + # portion of the name. We always set it to "unknown". + sysctl="sysctl -n hw.machine_arch" + UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \ + /usr/sbin/$sysctl 2>/dev/null || echo unknown)` + case "${UNAME_MACHINE_ARCH}" in + armeb) machine=armeb-unknown ;; + arm*) machine=arm-unknown ;; + sh3el) machine=shl-unknown ;; + sh3eb) machine=sh-unknown ;; + *) machine=${UNAME_MACHINE_ARCH}-unknown ;; + esac + # The Operating System including object format, if it has switched + # to ELF recently, or will in the future. + case "${UNAME_MACHINE_ARCH}" in + arm*|i386|m68k|ns32k|sh3*|sparc|vax) + eval $set_cc_for_build + if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ + | grep __ELF__ >/dev/null + then + # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). + # Return netbsd for either. FIX? + os=netbsd + else + os=netbsdelf + fi + ;; + *) + os=netbsd + ;; + esac + # The OS release + # Debian GNU/NetBSD machines have a different userland, and + # thus, need a distinct triplet. However, they do not need + # kernel version information, so it can be replaced with a + # suitable tag, in the style of linux-gnu. + case "${UNAME_VERSION}" in + Debian*) + release='-gnu' + ;; + *) + release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` + ;; + esac + # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: + # contains redundant information, the shorter form: + # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. + echo "${machine}-${os}${release}" + exit 0 ;; + amiga:OpenBSD:*:*) + echo m68k-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + arc:OpenBSD:*:*) + echo mipsel-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + hp300:OpenBSD:*:*) + echo m68k-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + mac68k:OpenBSD:*:*) + echo m68k-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + macppc:OpenBSD:*:*) + echo powerpc-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + mvme68k:OpenBSD:*:*) + echo m68k-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + mvme88k:OpenBSD:*:*) + echo m88k-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + mvmeppc:OpenBSD:*:*) + echo powerpc-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + pmax:OpenBSD:*:*) + echo mipsel-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + sgi:OpenBSD:*:*) + echo mipseb-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + sun3:OpenBSD:*:*) + echo m68k-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + wgrisc:OpenBSD:*:*) + echo mipsel-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + *:OpenBSD:*:*) + echo ${UNAME_MACHINE}-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + alpha:OSF1:*:*) + if test $UNAME_RELEASE = "V4.0"; then + UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` + fi + # According to Compaq, /usr/sbin/psrinfo has been available on + # OSF/1 and Tru64 systems produced since 1995. I hope that + # covers most systems running today. This code pipes the CPU + # types through head -n 1, so we only detect the type of CPU 0. + ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` + case "$ALPHA_CPU_TYPE" in + "EV4 (21064)") + UNAME_MACHINE="alpha" ;; + "EV4.5 (21064)") + UNAME_MACHINE="alpha" ;; + "LCA4 (21066/21068)") + UNAME_MACHINE="alpha" ;; + "EV5 (21164)") + UNAME_MACHINE="alphaev5" ;; + "EV5.6 (21164A)") + UNAME_MACHINE="alphaev56" ;; + "EV5.6 (21164PC)") + UNAME_MACHINE="alphapca56" ;; + "EV5.7 (21164PC)") + UNAME_MACHINE="alphapca57" ;; + "EV6 (21264)") + UNAME_MACHINE="alphaev6" ;; + "EV6.7 (21264A)") + UNAME_MACHINE="alphaev67" ;; + "EV6.8CB (21264C)") + UNAME_MACHINE="alphaev68" ;; + "EV6.8AL (21264B)") + UNAME_MACHINE="alphaev68" ;; + "EV6.8CX (21264D)") + UNAME_MACHINE="alphaev68" ;; + "EV6.9A (21264/EV69A)") + UNAME_MACHINE="alphaev69" ;; + "EV7 (21364)") + UNAME_MACHINE="alphaev7" ;; + "EV7.9 (21364A)") + UNAME_MACHINE="alphaev79" ;; + esac + # A Vn.n version is a released version. + # A Tn.n version is a released field test version. + # A Xn.n version is an unreleased experimental baselevel. + # 1.2 uses "1.2" for uname -r. + echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[VTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + exit 0 ;; + Alpha*:OpenVMS:*:*) + echo alpha-hp-vms + exit 0 ;; + Alpha\ *:Windows_NT*:*) + # How do we know it's Interix rather than the generic POSIX subsystem? + # Should we change UNAME_MACHINE based on the output of uname instead + # of the specific Alpha model? + echo alpha-pc-interix + exit 0 ;; + 21064:Windows_NT:50:3) + echo alpha-dec-winnt3.5 + exit 0 ;; + Amiga*:UNIX_System_V:4.0:*) + echo m68k-unknown-sysv4 + exit 0;; + *:[Aa]miga[Oo][Ss]:*:*) + echo ${UNAME_MACHINE}-unknown-amigaos + exit 0 ;; + *:[Mm]orph[Oo][Ss]:*:*) + echo ${UNAME_MACHINE}-unknown-morphos + exit 0 ;; + *:OS/390:*:*) + echo i370-ibm-openedition + exit 0 ;; + arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) + echo arm-acorn-riscix${UNAME_RELEASE} + exit 0;; + SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) + echo hppa1.1-hitachi-hiuxmpp + exit 0;; + Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) + # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. + if test "`(/bin/universe) 2>/dev/null`" = att ; then + echo pyramid-pyramid-sysv3 + else + echo pyramid-pyramid-bsd + fi + exit 0 ;; + NILE*:*:*:dcosx) + echo pyramid-pyramid-svr4 + exit 0 ;; + DRS?6000:unix:4.0:6*) + echo sparc-icl-nx6 + exit 0 ;; + DRS?6000:UNIX_SV:4.2*:7*) + case `/usr/bin/uname -p` in + sparc) echo sparc-icl-nx7 && exit 0 ;; + esac ;; + sun4H:SunOS:5.*:*) + echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit 0 ;; + sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) + echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit 0 ;; + i86pc:SunOS:5.*:*) + echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit 0 ;; + sun4*:SunOS:6*:*) + # According to config.sub, this is the proper way to canonicalize + # SunOS6. Hard to guess exactly what SunOS6 will be like, but + # it's likely to be more like Solaris than SunOS4. + echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit 0 ;; + sun4*:SunOS:*:*) + case "`/usr/bin/arch -k`" in + Series*|S4*) + UNAME_RELEASE=`uname -v` + ;; + esac + # Japanese Language versions have a version number like `4.1.3-JL'. + echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'` + exit 0 ;; + sun3*:SunOS:*:*) + echo m68k-sun-sunos${UNAME_RELEASE} + exit 0 ;; + sun*:*:4.2BSD:*) + UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` + test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3 + case "`/bin/arch`" in + sun3) + echo m68k-sun-sunos${UNAME_RELEASE} + ;; + sun4) + echo sparc-sun-sunos${UNAME_RELEASE} + ;; + esac + exit 0 ;; + aushp:SunOS:*:*) + echo sparc-auspex-sunos${UNAME_RELEASE} + exit 0 ;; + # The situation for MiNT is a little confusing. The machine name + # can be virtually everything (everything which is not + # "atarist" or "atariste" at least should have a processor + # > m68000). The system name ranges from "MiNT" over "FreeMiNT" + # to the lowercase version "mint" (or "freemint"). Finally + # the system name "TOS" denotes a system which is actually not + # MiNT. But MiNT is downward compatible to TOS, so this should + # be no problem. + atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) + echo m68k-atari-mint${UNAME_RELEASE} + exit 0 ;; + atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) + echo m68k-atari-mint${UNAME_RELEASE} + exit 0 ;; + *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) + echo m68k-atari-mint${UNAME_RELEASE} + exit 0 ;; + milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) + echo m68k-milan-mint${UNAME_RELEASE} + exit 0 ;; + hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) + echo m68k-hades-mint${UNAME_RELEASE} + exit 0 ;; + *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) + echo m68k-unknown-mint${UNAME_RELEASE} + exit 0 ;; + powerpc:machten:*:*) + echo powerpc-apple-machten${UNAME_RELEASE} + exit 0 ;; + RISC*:Mach:*:*) + echo mips-dec-mach_bsd4.3 + exit 0 ;; + RISC*:ULTRIX:*:*) + echo mips-dec-ultrix${UNAME_RELEASE} + exit 0 ;; + VAX*:ULTRIX*:*:*) + echo vax-dec-ultrix${UNAME_RELEASE} + exit 0 ;; + 2020:CLIX:*:* | 2430:CLIX:*:*) + echo clipper-intergraph-clix${UNAME_RELEASE} + exit 0 ;; + mips:*:*:UMIPS | mips:*:*:RISCos) + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c +#ifdef __cplusplus +#include /* for printf() prototype */ + int main (int argc, char *argv[]) { +#else + int main (argc, argv) int argc; char *argv[]; { +#endif + #if defined (host_mips) && defined (MIPSEB) + #if defined (SYSTYPE_SYSV) + printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0); + #endif + #if defined (SYSTYPE_SVR4) + printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0); + #endif + #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) + printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0); + #endif + #endif + exit (-1); + } +EOF + $CC_FOR_BUILD -o $dummy $dummy.c \ + && $dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \ + && exit 0 + echo mips-mips-riscos${UNAME_RELEASE} + exit 0 ;; + Motorola:PowerMAX_OS:*:*) + echo powerpc-motorola-powermax + exit 0 ;; + Motorola:*:4.3:PL8-*) + echo powerpc-harris-powermax + exit 0 ;; + Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) + echo powerpc-harris-powermax + exit 0 ;; + Night_Hawk:Power_UNIX:*:*) + echo powerpc-harris-powerunix + exit 0 ;; + m88k:CX/UX:7*:*) + echo m88k-harris-cxux7 + exit 0 ;; + m88k:*:4*:R4*) + echo m88k-motorola-sysv4 + exit 0 ;; + m88k:*:3*:R3*) + echo m88k-motorola-sysv3 + exit 0 ;; + AViiON:dgux:*:*) + # DG/UX returns AViiON for all architectures + UNAME_PROCESSOR=`/usr/bin/uname -p` + if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ] + then + if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ + [ ${TARGET_BINARY_INTERFACE}x = x ] + then + echo m88k-dg-dgux${UNAME_RELEASE} + else + echo m88k-dg-dguxbcs${UNAME_RELEASE} + fi + else + echo i586-dg-dgux${UNAME_RELEASE} + fi + exit 0 ;; + M88*:DolphinOS:*:*) # DolphinOS (SVR3) + echo m88k-dolphin-sysv3 + exit 0 ;; + M88*:*:R3*:*) + # Delta 88k system running SVR3 + echo m88k-motorola-sysv3 + exit 0 ;; + XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) + echo m88k-tektronix-sysv3 + exit 0 ;; + Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) + echo m68k-tektronix-bsd + exit 0 ;; + *:IRIX*:*:*) + echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` + exit 0 ;; + ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. + echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id + exit 0 ;; # Note that: echo "'`uname -s`'" gives 'AIX ' + i*86:AIX:*:*) + echo i386-ibm-aix + exit 0 ;; + ia64:AIX:*:*) + if [ -x /usr/bin/oslevel ] ; then + IBM_REV=`/usr/bin/oslevel` + else + IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} + fi + echo ${UNAME_MACHINE}-ibm-aix${IBM_REV} + exit 0 ;; + *:AIX:2:3) + if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #include + + main() + { + if (!__power_pc()) + exit(1); + puts("powerpc-ibm-aix3.2.5"); + exit(0); + } +EOF + $CC_FOR_BUILD -o $dummy $dummy.c && $dummy && exit 0 + echo rs6000-ibm-aix3.2.5 + elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then + echo rs6000-ibm-aix3.2.4 + else + echo rs6000-ibm-aix3.2 + fi + exit 0 ;; + *:AIX:*:[45]) + IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` + if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then + IBM_ARCH=rs6000 + else + IBM_ARCH=powerpc + fi + if [ -x /usr/bin/oslevel ] ; then + IBM_REV=`/usr/bin/oslevel` + else + IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} + fi + echo ${IBM_ARCH}-ibm-aix${IBM_REV} + exit 0 ;; + *:AIX:*:*) + echo rs6000-ibm-aix + exit 0 ;; + ibmrt:4.4BSD:*|romp-ibm:BSD:*) + echo romp-ibm-bsd4.4 + exit 0 ;; + ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and + echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to + exit 0 ;; # report: romp-ibm BSD 4.3 + *:BOSX:*:*) + echo rs6000-bull-bosx + exit 0 ;; + DPX/2?00:B.O.S.:*:*) + echo m68k-bull-sysv3 + exit 0 ;; + 9000/[34]??:4.3bsd:1.*:*) + echo m68k-hp-bsd + exit 0 ;; + hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) + echo m68k-hp-bsd4.4 + exit 0 ;; + 9000/[34678]??:HP-UX:*:*) + HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` + case "${UNAME_MACHINE}" in + 9000/31? ) HP_ARCH=m68000 ;; + 9000/[34]?? ) HP_ARCH=m68k ;; + 9000/[678][0-9][0-9]) + if [ -x /usr/bin/getconf ]; then + sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` + sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` + case "${sc_cpu_version}" in + 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 + 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 + 532) # CPU_PA_RISC2_0 + case "${sc_kernel_bits}" in + 32) HP_ARCH="hppa2.0n" ;; + 64) HP_ARCH="hppa2.0w" ;; + '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20 + esac ;; + esac + fi + if [ "${HP_ARCH}" = "" ]; then + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + + #define _HPUX_SOURCE + #include + #include + + int main () + { + #if defined(_SC_KERNEL_BITS) + long bits = sysconf(_SC_KERNEL_BITS); + #endif + long cpu = sysconf (_SC_CPU_VERSION); + + switch (cpu) + { + case CPU_PA_RISC1_0: puts ("hppa1.0"); break; + case CPU_PA_RISC1_1: puts ("hppa1.1"); break; + case CPU_PA_RISC2_0: + #if defined(_SC_KERNEL_BITS) + switch (bits) + { + case 64: puts ("hppa2.0w"); break; + case 32: puts ("hppa2.0n"); break; + default: puts ("hppa2.0"); break; + } break; + #else /* !defined(_SC_KERNEL_BITS) */ + puts ("hppa2.0"); break; + #endif + default: puts ("hppa1.0"); break; + } + exit (0); + } +EOF + (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` + test -z "$HP_ARCH" && HP_ARCH=hppa + fi ;; + esac + if [ ${HP_ARCH} = "hppa2.0w" ] + then + # avoid double evaluation of $set_cc_for_build + test -n "$CC_FOR_BUILD" || eval $set_cc_for_build + if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E -) | grep __LP64__ >/dev/null + then + HP_ARCH="hppa2.0w" + else + HP_ARCH="hppa64" + fi + fi + echo ${HP_ARCH}-hp-hpux${HPUX_REV} + exit 0 ;; + ia64:HP-UX:*:*) + HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` + echo ia64-hp-hpux${HPUX_REV} + exit 0 ;; + 3050*:HI-UX:*:*) + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #include + int + main () + { + long cpu = sysconf (_SC_CPU_VERSION); + /* The order matters, because CPU_IS_HP_MC68K erroneously returns + true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct + results, however. */ + if (CPU_IS_PA_RISC (cpu)) + { + switch (cpu) + { + case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; + case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; + case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; + default: puts ("hppa-hitachi-hiuxwe2"); break; + } + } + else if (CPU_IS_HP_MC68K (cpu)) + puts ("m68k-hitachi-hiuxwe2"); + else puts ("unknown-hitachi-hiuxwe2"); + exit (0); + } +EOF + $CC_FOR_BUILD -o $dummy $dummy.c && $dummy && exit 0 + echo unknown-hitachi-hiuxwe2 + exit 0 ;; + 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) + echo hppa1.1-hp-bsd + exit 0 ;; + 9000/8??:4.3bsd:*:*) + echo hppa1.0-hp-bsd + exit 0 ;; + *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) + echo hppa1.0-hp-mpeix + exit 0 ;; + hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) + echo hppa1.1-hp-osf + exit 0 ;; + hp8??:OSF1:*:*) + echo hppa1.0-hp-osf + exit 0 ;; + i*86:OSF1:*:*) + if [ -x /usr/sbin/sysversion ] ; then + echo ${UNAME_MACHINE}-unknown-osf1mk + else + echo ${UNAME_MACHINE}-unknown-osf1 + fi + exit 0 ;; + parisc*:Lites*:*:*) + echo hppa1.1-hp-lites + exit 0 ;; + C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) + echo c1-convex-bsd + exit 0 ;; + C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) + if getsysinfo -f scalar_acc + then echo c32-convex-bsd + else echo c2-convex-bsd + fi + exit 0 ;; + C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) + echo c34-convex-bsd + exit 0 ;; + C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) + echo c38-convex-bsd + exit 0 ;; + C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) + echo c4-convex-bsd + exit 0 ;; + CRAY*Y-MP:*:*:*) + echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit 0 ;; + CRAY*[A-Z]90:*:*:*) + echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ + | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ + -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ + -e 's/\.[^.]*$/.X/' + exit 0 ;; + CRAY*TS:*:*:*) + echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit 0 ;; + CRAY*T3E:*:*:*) + echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit 0 ;; + CRAY*SV1:*:*:*) + echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit 0 ;; + *:UNICOS/mp:*:*) + echo nv1-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit 0 ;; + F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) + FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` + FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` + echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" + exit 0 ;; + i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) + echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} + exit 0 ;; + sparc*:BSD/OS:*:*) + echo sparc-unknown-bsdi${UNAME_RELEASE} + exit 0 ;; + *:BSD/OS:*:*) + echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} + exit 0 ;; + *:FreeBSD:*:*|*:GNU/FreeBSD:*:*) + # Determine whether the default compiler uses glibc. + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #include + #if __GLIBC__ >= 2 + LIBC=gnu + #else + LIBC= + #endif +EOF + eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=` + echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`${LIBC:+-$LIBC} + exit 0 ;; + i*:CYGWIN*:*) + echo ${UNAME_MACHINE}-pc-cygwin + exit 0 ;; + i*:MINGW*:*) + echo ${UNAME_MACHINE}-pc-mingw32 + exit 0 ;; + i*:PW*:*) + echo ${UNAME_MACHINE}-pc-pw32 + exit 0 ;; + x86:Interix*:[34]*) + echo i586-pc-interix${UNAME_RELEASE}|sed -e 's/\..*//' + exit 0 ;; + [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) + echo i${UNAME_MACHINE}-pc-mks + exit 0 ;; + i*:Windows_NT*:* | Pentium*:Windows_NT*:*) + # How do we know it's Interix rather than the generic POSIX subsystem? + # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we + # UNAME_MACHINE based on the output of uname instead of i386? + echo i586-pc-interix + exit 0 ;; + i*:UWIN*:*) + echo ${UNAME_MACHINE}-pc-uwin + exit 0 ;; + p*:CYGWIN*:*) + echo powerpcle-unknown-cygwin + exit 0 ;; + prep*:SunOS:5.*:*) + echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit 0 ;; + *:GNU:*:*) + echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` + exit 0 ;; + i*86:Minix:*:*) + echo ${UNAME_MACHINE}-pc-minix + exit 0 ;; + arm*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit 0 ;; + cris:Linux:*:*) + echo cris-axis-linux-gnu + exit 0 ;; + ia64:Linux:*:*) + echo ${UNAME_MACHINE}-${VENDOR:-unknown}-linux-gnu + exit 0 ;; + m68*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit 0 ;; + mips:Linux:*:*) + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #undef CPU + #undef mips + #undef mipsel + #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) + CPU=mipsel + #else + #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) + CPU=mips + #else + CPU= + #endif + #endif +EOF + eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=` + test x"${CPU}" != x && echo "${CPU}-unknown-linux-gnu" && exit 0 + ;; + mips64:Linux:*:*) + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #undef CPU + #undef mips64 + #undef mips64el + #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) + CPU=mips64el + #else + #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) + CPU=mips64 + #else + CPU= + #endif + #endif +EOF + eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=` + test x"${CPU}" != x && echo "${CPU}-unknown-linux-gnu" && exit 0 + ;; + ppc:Linux:*:*) + echo powerpc-${VENDOR:-unknown}-linux-gnu + exit 0 ;; + ppc64:Linux:*:*) + echo powerpc64-${VENDOR:-unknown}-linux-gnu + exit 0 ;; + alpha:Linux:*:*) + case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in + EV5) UNAME_MACHINE=alphaev5 ;; + EV56) UNAME_MACHINE=alphaev56 ;; + PCA56) UNAME_MACHINE=alphapca56 ;; + PCA57) UNAME_MACHINE=alphapca56 ;; + EV6) UNAME_MACHINE=alphaev6 ;; + EV67) UNAME_MACHINE=alphaev67 ;; + EV68*) UNAME_MACHINE=alphaev68 ;; + esac + objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null + if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi + echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} + exit 0 ;; + parisc:Linux:*:* | hppa:Linux:*:*) + # Look for CPU level + case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in + PA7*) echo hppa1.1-unknown-linux-gnu ;; + PA8*) echo hppa2.0-unknown-linux-gnu ;; + *) echo hppa-unknown-linux-gnu ;; + esac + exit 0 ;; + parisc64:Linux:*:* | hppa64:Linux:*:*) + echo hppa64-unknown-linux-gnu + exit 0 ;; + s390:Linux:*:* | s390x:Linux:*:*) + echo ${UNAME_MACHINE}-${VENDOR:-ibm}-linux-gnu + exit 0 ;; + sh64*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit 0 ;; + sh*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit 0 ;; + sparc:Linux:*:* | sparc64:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit 0 ;; + x86_64:Linux:*:*) + echo x86_64-${VENDOR:-unknown}-linux-gnu + exit 0 ;; + i*86:Linux:*:*) + # The BFD linker knows what the default object file format is, so + # first see if it will tell us. cd to the root directory to prevent + # problems with other programs or directories called `ld' in the path. + # Set LC_ALL=C to ensure ld outputs messages in English. + ld_supported_targets=`cd /; LC_ALL=C ld --help 2>&1 \ + | sed -ne '/supported targets:/!d + s/[ ][ ]*/ /g + s/.*supported targets: *// + s/ .*// + p'` + case "$ld_supported_targets" in + elf32-i386) + TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu" + ;; + a.out-i386-linux) + echo "${UNAME_MACHINE}-pc-linux-gnuaout" + exit 0 ;; + coff-i386) + echo "${UNAME_MACHINE}-pc-linux-gnucoff" + exit 0 ;; + "") + # Either a pre-BFD a.out linker (linux-gnuoldld) or + # one that does not give us useful --help. + echo "${UNAME_MACHINE}-pc-linux-gnuoldld" + exit 0 ;; + esac + # Determine whether the default compiler is a.out or elf + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #include + #ifdef __ELF__ + # ifdef __GLIBC__ + # if __GLIBC__ >= 2 + LIBC=gnu + # else + LIBC=gnulibc1 + # endif + # else + LIBC=gnulibc1 + # endif + #else + #ifdef __INTEL_COMPILER + LIBC=gnu + #else + LIBC=gnuaout + #endif + #endif +EOF + eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=` + test x"${LIBC}" != x && echo "${UNAME_MACHINE}-${VENDOR:-pc}-linux-${LIBC}" && exit 0 + test x"${TENTATIVE}" != x && echo "${TENTATIVE}" && exit 0 + ;; + i*86:DYNIX/ptx:4*:*) + # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. + # earlier versions are messed up and put the nodename in both + # sysname and nodename. + echo i386-sequent-sysv4 + exit 0 ;; + i*86:UNIX_SV:4.2MP:2.*) + # Unixware is an offshoot of SVR4, but it has its own version + # number series starting with 2... + # I am not positive that other SVR4 systems won't match this, + # I just have to hope. -- rms. + # Use sysv4.2uw... so that sysv4* matches it. + echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} + exit 0 ;; + i*86:OS/2:*:*) + # If we were able to find `uname', then EMX Unix compatibility + # is probably installed. + echo ${UNAME_MACHINE}-pc-os2-emx + exit 0 ;; + i*86:XTS-300:*:STOP) + echo ${UNAME_MACHINE}-unknown-stop + exit 0 ;; + i*86:atheos:*:*) + echo ${UNAME_MACHINE}-unknown-atheos + exit 0 ;; + i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*) + echo i386-unknown-lynxos${UNAME_RELEASE} + exit 0 ;; + i*86:*DOS:*:*) + echo ${UNAME_MACHINE}-pc-msdosdjgpp + exit 0 ;; + i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*) + UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` + if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then + echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL} + else + echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} + fi + exit 0 ;; + i*86:*:5:[78]*) + case `/bin/uname -X | grep "^Machine"` in + *486*) UNAME_MACHINE=i486 ;; + *Pentium) UNAME_MACHINE=i586 ;; + *Pent*|*Celeron) UNAME_MACHINE=i686 ;; + esac + echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} + exit 0 ;; + i*86:*:3.2:*) + if test -f /usr/options/cb.name; then + UNAME_REL=`sed -n 's/.*Version //p' /dev/null >/dev/null ; then + UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` + (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 + (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \ + && UNAME_MACHINE=i586 + (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \ + && UNAME_MACHINE=i686 + (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ + && UNAME_MACHINE=i686 + echo ${UNAME_MACHINE}-pc-sco$UNAME_REL + else + echo ${UNAME_MACHINE}-pc-sysv32 + fi + exit 0 ;; + pc:*:*:*) + # Left here for compatibility: + # uname -m prints for DJGPP always 'pc', but it prints nothing about + # the processor, so we play safe by assuming i386. + echo i386-pc-msdosdjgpp + exit 0 ;; + Intel:Mach:3*:*) + echo i386-pc-mach3 + exit 0 ;; + paragon:*:*:*) + echo i860-intel-osf1 + exit 0 ;; + i860:*:4.*:*) # i860-SVR4 + if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then + echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4 + else # Add other i860-SVR4 vendors below as they are discovered. + echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4 + fi + exit 0 ;; + mini*:CTIX:SYS*5:*) + # "miniframe" + echo m68010-convergent-sysv + exit 0 ;; + mc68k:UNIX:SYSTEM5:3.51m) + echo m68k-convergent-sysv + exit 0 ;; + M680?0:D-NIX:5.3:*) + echo m68k-diab-dnix + exit 0 ;; + M68*:*:R3V[567]*:*) + test -r /sysV68 && echo 'm68k-motorola-sysv' && exit 0 ;; + 3[34]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0) + OS_REL='' + test -r /etc/.relid \ + && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` + /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ + && echo i486-ncr-sysv4.3${OS_REL} && exit 0 + /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ + && echo i586-ncr-sysv4.3${OS_REL} && exit 0 ;; + 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) + /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ + && echo i486-ncr-sysv4 && exit 0 ;; + m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) + echo m68k-unknown-lynxos${UNAME_RELEASE} + exit 0 ;; + mc68030:UNIX_System_V:4.*:*) + echo m68k-atari-sysv4 + exit 0 ;; + TSUNAMI:LynxOS:2.*:*) + echo sparc-unknown-lynxos${UNAME_RELEASE} + exit 0 ;; + rs6000:LynxOS:2.*:*) + echo rs6000-unknown-lynxos${UNAME_RELEASE} + exit 0 ;; + PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*) + echo powerpc-unknown-lynxos${UNAME_RELEASE} + exit 0 ;; + SM[BE]S:UNIX_SV:*:*) + echo mips-dde-sysv${UNAME_RELEASE} + exit 0 ;; + RM*:ReliantUNIX-*:*:*) + echo mips-sni-sysv4 + exit 0 ;; + RM*:SINIX-*:*:*) + echo mips-sni-sysv4 + exit 0 ;; + *:SINIX-*:*:*) + if uname -p 2>/dev/null >/dev/null ; then + UNAME_MACHINE=`(uname -p) 2>/dev/null` + echo ${UNAME_MACHINE}-sni-sysv4 + else + echo ns32k-sni-sysv + fi + exit 0 ;; + PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort + # says + echo i586-unisys-sysv4 + exit 0 ;; + *:UNIX_System_V:4*:FTX*) + # From Gerald Hewes . + # How about differentiating between stratus architectures? -djm + echo hppa1.1-stratus-sysv4 + exit 0 ;; + *:*:*:FTX*) + # From seanf@swdc.stratus.com. + echo i860-stratus-sysv4 + exit 0 ;; + *:VOS:*:*) + # From Paul.Green@stratus.com. + echo hppa1.1-stratus-vos + exit 0 ;; + mc68*:A/UX:*:*) + echo m68k-apple-aux${UNAME_RELEASE} + exit 0 ;; + news*:NEWS-OS:6*:*) + echo mips-sony-newsos6 + exit 0 ;; + R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) + if [ -d /usr/nec ]; then + echo mips-nec-sysv${UNAME_RELEASE} + else + echo mips-unknown-sysv${UNAME_RELEASE} + fi + exit 0 ;; + BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. + echo powerpc-be-beos + exit 0 ;; + BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. + echo powerpc-apple-beos + exit 0 ;; + BePC:BeOS:*:*) # BeOS running on Intel PC compatible. + echo i586-pc-beos + exit 0 ;; + SX-4:SUPER-UX:*:*) + echo sx4-nec-superux${UNAME_RELEASE} + exit 0 ;; + SX-5:SUPER-UX:*:*) + echo sx5-nec-superux${UNAME_RELEASE} + exit 0 ;; + SX-6:SUPER-UX:*:*) + echo sx6-nec-superux${UNAME_RELEASE} + exit 0 ;; + Power*:Rhapsody:*:*) + echo powerpc-apple-rhapsody${UNAME_RELEASE} + exit 0 ;; + *:Rhapsody:*:*) + echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} + exit 0 ;; + *:Darwin:*:*) + case `uname -p` in + *86) UNAME_PROCESSOR=i686 ;; + powerpc) UNAME_PROCESSOR=powerpc ;; + esac + echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} + exit 0 ;; + *:procnto*:*:* | *:QNX:[0123456789]*:*) + UNAME_PROCESSOR=`uname -p` + if test "$UNAME_PROCESSOR" = "x86"; then + UNAME_PROCESSOR=i386 + UNAME_MACHINE=pc + fi + echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE} + exit 0 ;; + *:QNX:*:4*) + echo i386-pc-qnx + exit 0 ;; + NSR-[DGKLNPTVW]:NONSTOP_KERNEL:*:*) + echo nsr-tandem-nsk${UNAME_RELEASE} + exit 0 ;; + *:NonStop-UX:*:*) + echo mips-compaq-nonstopux + exit 0 ;; + BS2000:POSIX*:*:*) + echo bs2000-siemens-sysv + exit 0 ;; + DS/*:UNIX_System_V:*:*) + echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} + exit 0 ;; + *:Plan9:*:*) + # "uname -m" is not consistent, so use $cputype instead. 386 + # is converted to i386 for consistency with other x86 + # operating systems. + if test "$cputype" = "386"; then + UNAME_MACHINE=i386 + else + UNAME_MACHINE="$cputype" + fi + echo ${UNAME_MACHINE}-unknown-plan9 + exit 0 ;; + *:TOPS-10:*:*) + echo pdp10-unknown-tops10 + exit 0 ;; + *:TENEX:*:*) + echo pdp10-unknown-tenex + exit 0 ;; + KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) + echo pdp10-dec-tops20 + exit 0 ;; + XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) + echo pdp10-xkl-tops20 + exit 0 ;; + *:TOPS-20:*:*) + echo pdp10-unknown-tops20 + exit 0 ;; + *:ITS:*:*) + echo pdp10-unknown-its + exit 0 ;; + SEI:*:*:SEIUX) + echo mips-sei-seiux${UNAME_RELEASE} + exit 0 ;; +esac + +#echo '(No uname command or uname output not recognized.)' 1>&2 +#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2 + +eval $set_cc_for_build +cat >$dummy.c < +# include +#endif +main () +{ +#if defined (sony) +#if defined (MIPSEB) + /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed, + I don't know.... */ + printf ("mips-sony-bsd\n"); exit (0); +#else +#include + printf ("m68k-sony-newsos%s\n", +#ifdef NEWSOS4 + "4" +#else + "" +#endif + ); exit (0); +#endif +#endif + +#if defined (__arm) && defined (__acorn) && defined (__unix) + printf ("arm-acorn-riscix"); exit (0); +#endif + +#if defined (hp300) && !defined (hpux) + printf ("m68k-hp-bsd\n"); exit (0); +#endif + +#if defined (NeXT) +#if !defined (__ARCHITECTURE__) +#define __ARCHITECTURE__ "m68k" +#endif + int version; + version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; + if (version < 4) + printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); + else + printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version); + exit (0); +#endif + +#if defined (MULTIMAX) || defined (n16) +#if defined (UMAXV) + printf ("ns32k-encore-sysv\n"); exit (0); +#else +#if defined (CMU) + printf ("ns32k-encore-mach\n"); exit (0); +#else + printf ("ns32k-encore-bsd\n"); exit (0); +#endif +#endif +#endif + +#if defined (__386BSD__) + printf ("i386-pc-bsd\n"); exit (0); +#endif + +#if defined (sequent) +#if defined (i386) + printf ("i386-sequent-dynix\n"); exit (0); +#endif +#if defined (ns32000) + printf ("ns32k-sequent-dynix\n"); exit (0); +#endif +#endif + +#if defined (_SEQUENT_) + struct utsname un; + + uname(&un); + + if (strncmp(un.version, "V2", 2) == 0) { + printf ("i386-sequent-ptx2\n"); exit (0); + } + if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */ + printf ("i386-sequent-ptx1\n"); exit (0); + } + printf ("i386-sequent-ptx\n"); exit (0); + +#endif + +#if defined (vax) +# if !defined (ultrix) +# include +# if defined (BSD) +# if BSD == 43 + printf ("vax-dec-bsd4.3\n"); exit (0); +# else +# if BSD == 199006 + printf ("vax-dec-bsd4.3reno\n"); exit (0); +# else + printf ("vax-dec-bsd\n"); exit (0); +# endif +# endif +# else + printf ("vax-dec-bsd\n"); exit (0); +# endif +# else + printf ("vax-dec-ultrix\n"); exit (0); +# endif +#endif + +#if defined (alliant) && defined (i860) + printf ("i860-alliant-bsd\n"); exit (0); +#endif + + exit (1); +} +EOF + +$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && $dummy && exit 0 + +# Apollos put the system type in the environment. + +test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit 0; } + +# Convex versions that predate uname can use getsysinfo(1) + +if [ -x /usr/convex/getsysinfo ] +then + case `getsysinfo -f cpu_type` in + c1*) + echo c1-convex-bsd + exit 0 ;; + c2*) + if getsysinfo -f scalar_acc + then echo c32-convex-bsd + else echo c2-convex-bsd + fi + exit 0 ;; + c34*) + echo c34-convex-bsd + exit 0 ;; + c38*) + echo c38-convex-bsd + exit 0 ;; + c4*) + echo c4-convex-bsd + exit 0 ;; + esac +fi + +cat >&2 < in order to provide the needed +information to handle your system. + +config.guess timestamp = $timestamp + +uname -m = `(uname -m) 2>/dev/null || echo unknown` +uname -r = `(uname -r) 2>/dev/null || echo unknown` +uname -s = `(uname -s) 2>/dev/null || echo unknown` +uname -v = `(uname -v) 2>/dev/null || echo unknown` + +/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null` +/bin/uname -X = `(/bin/uname -X) 2>/dev/null` + +hostinfo = `(hostinfo) 2>/dev/null` +/bin/universe = `(/bin/universe) 2>/dev/null` +/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` +/bin/arch = `(/bin/arch) 2>/dev/null` +/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` +/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` + +UNAME_MACHINE = ${UNAME_MACHINE} +UNAME_RELEASE = ${UNAME_RELEASE} +UNAME_SYSTEM = ${UNAME_SYSTEM} +UNAME_VERSION = ${UNAME_VERSION} +EOF + +exit 1 + +# Local variables: +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "timestamp='" +# time-stamp-format: "%:y-%02m-%02d" +# time-stamp-end: "'" +# End: diff --git a/app/lbxproxy/config.h.in b/app/lbxproxy/config.h.in new file mode 100644 index 000000000..6cd82a594 --- /dev/null +++ b/app/lbxproxy/config.h.in @@ -0,0 +1,40 @@ +/* config.h.in. Generated from configure.ac by autoheader. */ + +/* Define to 1 if `struct sockaddr_in' has a `sin_len' member */ +#undef BSD44SOCKETS + +/* Define to 1 if you have the `z' library (-lz). */ +#undef HAVE_LIBZ + +/* Support IPv6 for TCP connections */ +#undef IPv6 + +/* Name of package */ +#undef PACKAGE + +/* Define to the address where bug reports for this package should be sent. */ +#undef PACKAGE_BUGREPORT + +/* Define to the full name of this package. */ +#undef PACKAGE_NAME + +/* Define to the full name and version of this package. */ +#undef PACKAGE_STRING + +/* Define to the one symbol short name of this package. */ +#undef PACKAGE_TARNAME + +/* Define to the version of this package. */ +#undef PACKAGE_VERSION + +/* Define as the return type of signal handlers (`int' or `void'). */ +#undef RETSIGTYPE + +/* Support TCP socket connections */ +#undef TCPCONN + +/* Support UNIX socket connections */ +#undef UNIXCONN + +/* Version number of package */ +#undef VERSION diff --git a/app/lbxproxy/config.sub b/app/lbxproxy/config.sub new file mode 100644 index 000000000..7cee3d6ec --- /dev/null +++ b/app/lbxproxy/config.sub @@ -0,0 +1,1500 @@ +#! /bin/sh +# Configuration validation subroutine script. +# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, +# 2000, 2001, 2002, 2003 Free Software Foundation, Inc. + +timestamp='2003-06-18' + +# This file is (in principle) common to ALL GNU software. +# The presence of a machine in this file suggests that SOME GNU software +# can handle that machine. It does not imply ALL GNU software can. +# +# This file is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, +# Boston, MA 02111-1307, USA. + +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +# Please send patches to . Submit a context +# diff and a properly formatted ChangeLog entry. +# +# Configuration subroutine to validate and canonicalize a configuration type. +# Supply the specified configuration type as an argument. +# If it is invalid, we print an error message on stderr and exit with code 1. +# Otherwise, we print the canonical config type on stdout and succeed. + +# This file is supposed to be the same for all GNU packages +# and recognize all the CPU types, system types and aliases +# that are meaningful with *any* GNU software. +# Each package is responsible for reporting which valid configurations +# it does not support. The user should be able to distinguish +# a failure to support a valid configuration from a meaningless +# configuration. + +# The goal of this file is to map all the various variations of a given +# machine specification into a single specification in the form: +# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM +# or in some cases, the newer four-part form: +# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM +# It is wrong to echo any other type of specification. + +me=`echo "$0" | sed -e 's,.*/,,'` + +usage="\ +Usage: $0 [OPTION] CPU-MFR-OPSYS + $0 [OPTION] ALIAS + +Canonicalize a configuration name. + +Operation modes: + -h, --help print this help, then exit + -t, --time-stamp print date of last modification, then exit + -v, --version print version number, then exit + +Report bugs and patches to ." + +version="\ +GNU config.sub ($timestamp) + +Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001 +Free Software Foundation, Inc. + +This is free software; see the source for copying conditions. There is NO +warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." + +help=" +Try \`$me --help' for more information." + +# Parse command line +while test $# -gt 0 ; do + case $1 in + --time-stamp | --time* | -t ) + echo "$timestamp" ; exit 0 ;; + --version | -v ) + echo "$version" ; exit 0 ;; + --help | --h* | -h ) + echo "$usage"; exit 0 ;; + -- ) # Stop option processing + shift; break ;; + - ) # Use stdin as input. + break ;; + -* ) + echo "$me: invalid option $1$help" + exit 1 ;; + + *local*) + # First pass through any local machine types. + echo $1 + exit 0;; + + * ) + break ;; + esac +done + +case $# in + 0) echo "$me: missing argument$help" >&2 + exit 1;; + 1) ;; + *) echo "$me: too many arguments$help" >&2 + exit 1;; +esac + +# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). +# Here we must recognize all the valid KERNEL-OS combinations. +maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` +case $maybe_os in + nto-qnx* | linux-gnu* | freebsd*-gnu* | netbsd*-gnu* | storm-chaos* | os2-emx* | rtmk-nova*) + os=-$maybe_os + basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` + ;; + *) + basic_machine=`echo $1 | sed 's/-[^-]*$//'` + if [ $basic_machine != $1 ] + then os=`echo $1 | sed 's/.*-/-/'` + else os=; fi + ;; +esac + +### Let's recognize common machines as not being operating systems so +### that things like config.sub decstation-3100 work. We also +### recognize some manufacturers as not being operating systems, so we +### can provide default operating systems below. +case $os in + -sun*os*) + # Prevent following clause from handling this invalid input. + ;; + -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \ + -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \ + -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \ + -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ + -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ + -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ + -apple | -axis) + os= + basic_machine=$1 + ;; + -sim | -cisco | -oki | -wec | -winbond) + os= + basic_machine=$1 + ;; + -scout) + ;; + -wrs) + os=-vxworks + basic_machine=$1 + ;; + -chorusos*) + os=-chorusos + basic_machine=$1 + ;; + -chorusrdb) + os=-chorusrdb + basic_machine=$1 + ;; + -hiux*) + os=-hiuxwe2 + ;; + -sco5) + os=-sco3.2v5 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco4) + os=-sco3.2v4 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco3.2.[4-9]*) + os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco3.2v[4-9]*) + # Don't forget version if it is 3.2v4 or newer. + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco*) + os=-sco3.2v2 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -udk*) + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -isc) + os=-isc2.2 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -clix*) + basic_machine=clipper-intergraph + ;; + -isc*) + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -lynx*) + os=-lynxos + ;; + -ptx*) + basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'` + ;; + -windowsnt*) + os=`echo $os | sed -e 's/windowsnt/winnt/'` + ;; + -psos*) + os=-psos + ;; + -mint | -mint[0-9]*) + basic_machine=m68k-atari + os=-mint + ;; +esac + +# Decode aliases for certain CPU-COMPANY combinations. +case $basic_machine in + # Recognize the basic CPU types without company name. + # Some are omitted here because they have special meanings below. + 1750a | 580 \ + | a29k \ + | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ + | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ + | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr \ + | c4x | clipper \ + | d10v | d30v | dlx | dsp16xx \ + | fr30 | frv \ + | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ + | i370 | i860 | i960 | ia64 \ + | ip2k \ + | m32r | m68000 | m68k | m88k | mcore \ + | mips | mipsbe | mipseb | mipsel | mipsle \ + | mips16 \ + | mips64 | mips64el \ + | mips64vr | mips64vrel \ + | mips64orion | mips64orionel \ + | mips64vr4100 | mips64vr4100el \ + | mips64vr4300 | mips64vr4300el \ + | mips64vr5000 | mips64vr5000el \ + | mipsisa32 | mipsisa32el \ + | mipsisa32r2 | mipsisa32r2el \ + | mipsisa64 | mipsisa64el \ + | mipsisa64sb1 | mipsisa64sb1el \ + | mipsisa64sr71k | mipsisa64sr71kel \ + | mipstx39 | mipstx39el \ + | mn10200 | mn10300 \ + | msp430 \ + | ns16k | ns32k \ + | openrisc | or32 \ + | pdp10 | pdp11 | pj | pjl \ + | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \ + | pyramid \ + | s390 | s390x \ + | sh | sh[1234] | sh[23]e | sh[34]eb | shbe | shle | sh[1234]le | sh3ele \ + | sh64 | sh64le \ + | sparc | sparc64 | sparc86x | sparclet | sparclite | sparcv9 | sparcv9b \ + | strongarm \ + | tahoe | thumb | tic4x | tic80 | tron \ + | v850 | v850e \ + | we32k \ + | x86 | xscale | xstormy16 | xtensa \ + | z8k) + basic_machine=$basic_machine-unknown + ;; + m6811 | m68hc11 | m6812 | m68hc12) + # Motorola 68HC11/12. + basic_machine=$basic_machine-unknown + os=-none + ;; + m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) + ;; + + # We use `pc' rather than `unknown' + # because (1) that's what they normally are, and + # (2) the word "unknown" tends to confuse beginning users. + i*86 | x86_64) + basic_machine=$basic_machine-pc + ;; + # Object if more than one company name word. + *-*-*) + echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 + exit 1 + ;; + # Recognize the basic CPU types with company name. + 580-* \ + | a29k-* \ + | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ + | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ + | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \ + | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ + | avr-* \ + | bs2000-* \ + | c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \ + | clipper-* | cydra-* \ + | d10v-* | d30v-* | dlx-* \ + | elxsi-* \ + | f30[01]-* | f700-* | fr30-* | frv-* | fx80-* \ + | h8300-* | h8500-* \ + | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ + | i*86-* | i860-* | i960-* | ia64-* \ + | ip2k-* \ + | m32r-* \ + | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ + | m88110-* | m88k-* | mcore-* \ + | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ + | mips16-* \ + | mips64-* | mips64el-* \ + | mips64vr-* | mips64vrel-* \ + | mips64orion-* | mips64orionel-* \ + | mips64vr4100-* | mips64vr4100el-* \ + | mips64vr4300-* | mips64vr4300el-* \ + | mips64vr5000-* | mips64vr5000el-* \ + | mipsisa32-* | mipsisa32el-* \ + | mipsisa32r2-* | mipsisa32r2el-* \ + | mipsisa64-* | mipsisa64el-* \ + | mipsisa64sb1-* | mipsisa64sb1el-* \ + | mipsisa64sr71k-* | mipsisa64sr71kel-* \ + | mipstx39-* | mipstx39el-* \ + | msp430-* \ + | none-* | np1-* | nv1-* | ns16k-* | ns32k-* \ + | orion-* \ + | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ + | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \ + | pyramid-* \ + | romp-* | rs6000-* \ + | s390-* | s390x-* \ + | sh-* | sh[1234]-* | sh[23]e-* | sh[34]eb-* | shbe-* \ + | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ + | sparc-* | sparc64-* | sparc86x-* | sparclet-* | sparclite-* \ + | sparcv9-* | sparcv9b-* | strongarm-* | sv1-* | sx?-* \ + | tahoe-* | thumb-* \ + | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ + | tron-* \ + | v850-* | v850e-* | vax-* \ + | we32k-* \ + | x86-* | x86_64-* | xps100-* | xscale-* | xstormy16-* \ + | xtensa-* \ + | ymp-* \ + | z8k-*) + ;; + # Recognize the various machine names and aliases which stand + # for a CPU type and a company and sometimes even an OS. + 386bsd) + basic_machine=i386-unknown + os=-bsd + ;; + 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) + basic_machine=m68000-att + ;; + 3b*) + basic_machine=we32k-att + ;; + a29khif) + basic_machine=a29k-amd + os=-udi + ;; + adobe68k) + basic_machine=m68010-adobe + os=-scout + ;; + alliant | fx80) + basic_machine=fx80-alliant + ;; + altos | altos3068) + basic_machine=m68k-altos + ;; + am29k) + basic_machine=a29k-none + os=-bsd + ;; + amd64) + basic_machine=x86_64-pc + ;; + amdahl) + basic_machine=580-amdahl + os=-sysv + ;; + amiga | amiga-*) + basic_machine=m68k-unknown + ;; + amigaos | amigados) + basic_machine=m68k-unknown + os=-amigaos + ;; + amigaunix | amix) + basic_machine=m68k-unknown + os=-sysv4 + ;; + apollo68) + basic_machine=m68k-apollo + os=-sysv + ;; + apollo68bsd) + basic_machine=m68k-apollo + os=-bsd + ;; + aux) + basic_machine=m68k-apple + os=-aux + ;; + balance) + basic_machine=ns32k-sequent + os=-dynix + ;; + c90) + basic_machine=c90-cray + os=-unicos + ;; + convex-c1) + basic_machine=c1-convex + os=-bsd + ;; + convex-c2) + basic_machine=c2-convex + os=-bsd + ;; + convex-c32) + basic_machine=c32-convex + os=-bsd + ;; + convex-c34) + basic_machine=c34-convex + os=-bsd + ;; + convex-c38) + basic_machine=c38-convex + os=-bsd + ;; + cray | j90) + basic_machine=j90-cray + os=-unicos + ;; + crds | unos) + basic_machine=m68k-crds + ;; + cris | cris-* | etrax*) + basic_machine=cris-axis + ;; + da30 | da30-*) + basic_machine=m68k-da30 + ;; + decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn) + basic_machine=mips-dec + ;; + decsystem10* | dec10*) + basic_machine=pdp10-dec + os=-tops10 + ;; + decsystem20* | dec20*) + basic_machine=pdp10-dec + os=-tops20 + ;; + delta | 3300 | motorola-3300 | motorola-delta \ + | 3300-motorola | delta-motorola) + basic_machine=m68k-motorola + ;; + delta88) + basic_machine=m88k-motorola + os=-sysv3 + ;; + dpx20 | dpx20-*) + basic_machine=rs6000-bull + os=-bosx + ;; + dpx2* | dpx2*-bull) + basic_machine=m68k-bull + os=-sysv3 + ;; + ebmon29k) + basic_machine=a29k-amd + os=-ebmon + ;; + elxsi) + basic_machine=elxsi-elxsi + os=-bsd + ;; + encore | umax | mmax) + basic_machine=ns32k-encore + ;; + es1800 | OSE68k | ose68k | ose | OSE) + basic_machine=m68k-ericsson + os=-ose + ;; + fx2800) + basic_machine=i860-alliant + ;; + genix) + basic_machine=ns32k-ns + ;; + gmicro) + basic_machine=tron-gmicro + os=-sysv + ;; + go32) + basic_machine=i386-pc + os=-go32 + ;; + h3050r* | hiux*) + basic_machine=hppa1.1-hitachi + os=-hiuxwe2 + ;; + h8300hms) + basic_machine=h8300-hitachi + os=-hms + ;; + h8300xray) + basic_machine=h8300-hitachi + os=-xray + ;; + h8500hms) + basic_machine=h8500-hitachi + os=-hms + ;; + harris) + basic_machine=m88k-harris + os=-sysv3 + ;; + hp300-*) + basic_machine=m68k-hp + ;; + hp300bsd) + basic_machine=m68k-hp + os=-bsd + ;; + hp300hpux) + basic_machine=m68k-hp + os=-hpux + ;; + hp3k9[0-9][0-9] | hp9[0-9][0-9]) + basic_machine=hppa1.0-hp + ;; + hp9k2[0-9][0-9] | hp9k31[0-9]) + basic_machine=m68000-hp + ;; + hp9k3[2-9][0-9]) + basic_machine=m68k-hp + ;; + hp9k6[0-9][0-9] | hp6[0-9][0-9]) + basic_machine=hppa1.0-hp + ;; + hp9k7[0-79][0-9] | hp7[0-79][0-9]) + basic_machine=hppa1.1-hp + ;; + hp9k78[0-9] | hp78[0-9]) + # FIXME: really hppa2.0-hp + basic_machine=hppa1.1-hp + ;; + hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) + # FIXME: really hppa2.0-hp + basic_machine=hppa1.1-hp + ;; + hp9k8[0-9][13679] | hp8[0-9][13679]) + basic_machine=hppa1.1-hp + ;; + hp9k8[0-9][0-9] | hp8[0-9][0-9]) + basic_machine=hppa1.0-hp + ;; + hppa-next) + os=-nextstep3 + ;; + hppaosf) + basic_machine=hppa1.1-hp + os=-osf + ;; + hppro) + basic_machine=hppa1.1-hp + os=-proelf + ;; + i370-ibm* | ibm*) + basic_machine=i370-ibm + ;; +# I'm not sure what "Sysv32" means. Should this be sysv3.2? + i*86v32) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-sysv32 + ;; + i*86v4*) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-sysv4 + ;; + i*86v) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-sysv + ;; + i*86sol2) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-solaris2 + ;; + i386mach) + basic_machine=i386-mach + os=-mach + ;; + i386-vsta | vsta) + basic_machine=i386-unknown + os=-vsta + ;; + iris | iris4d) + basic_machine=mips-sgi + case $os in + -irix*) + ;; + *) + os=-irix4 + ;; + esac + ;; + isi68 | isi) + basic_machine=m68k-isi + os=-sysv + ;; + m88k-omron*) + basic_machine=m88k-omron + ;; + magnum | m3230) + basic_machine=mips-mips + os=-sysv + ;; + merlin) + basic_machine=ns32k-utek + os=-sysv + ;; + mingw32) + basic_machine=i386-pc + os=-mingw32 + ;; + miniframe) + basic_machine=m68000-convergent + ;; + *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*) + basic_machine=m68k-atari + os=-mint + ;; + mips3*-*) + basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` + ;; + mips3*) + basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown + ;; + mmix*) + basic_machine=mmix-knuth + os=-mmixware + ;; + monitor) + basic_machine=m68k-rom68k + os=-coff + ;; + morphos) + basic_machine=powerpc-unknown + os=-morphos + ;; + msdos) + basic_machine=i386-pc + os=-msdos + ;; + mvs) + basic_machine=i370-ibm + os=-mvs + ;; + ncr3000) + basic_machine=i486-ncr + os=-sysv4 + ;; + netbsd386) + basic_machine=i386-unknown + os=-netbsd + ;; + netwinder) + basic_machine=armv4l-rebel + os=-linux + ;; + news | news700 | news800 | news900) + basic_machine=m68k-sony + os=-newsos + ;; + news1000) + basic_machine=m68030-sony + os=-newsos + ;; + news-3600 | risc-news) + basic_machine=mips-sony + os=-newsos + ;; + necv70) + basic_machine=v70-nec + os=-sysv + ;; + next | m*-next ) + basic_machine=m68k-next + case $os in + -nextstep* ) + ;; + -ns2*) + os=-nextstep2 + ;; + *) + os=-nextstep3 + ;; + esac + ;; + nh3000) + basic_machine=m68k-harris + os=-cxux + ;; + nh[45]000) + basic_machine=m88k-harris + os=-cxux + ;; + nindy960) + basic_machine=i960-intel + os=-nindy + ;; + mon960) + basic_machine=i960-intel + os=-mon960 + ;; + nonstopux) + basic_machine=mips-compaq + os=-nonstopux + ;; + np1) + basic_machine=np1-gould + ;; + nv1) + basic_machine=nv1-cray + os=-unicosmp + ;; + nsr-tandem) + basic_machine=nsr-tandem + ;; + op50n-* | op60c-*) + basic_machine=hppa1.1-oki + os=-proelf + ;; + or32 | or32-*) + basic_machine=or32-unknown + os=-coff + ;; + OSE68000 | ose68000) + basic_machine=m68000-ericsson + os=-ose + ;; + os68k) + basic_machine=m68k-none + os=-os68k + ;; + pa-hitachi) + basic_machine=hppa1.1-hitachi + os=-hiuxwe2 + ;; + paragon) + basic_machine=i860-intel + os=-osf + ;; + pbd) + basic_machine=sparc-tti + ;; + pbb) + basic_machine=m68k-tti + ;; + pc532 | pc532-*) + basic_machine=ns32k-pc532 + ;; + pentium | p5 | k5 | k6 | nexgen | viac3) + basic_machine=i586-pc + ;; + pentiumpro | p6 | 6x86 | athlon | athlon_*) + basic_machine=i686-pc + ;; + pentiumii | pentium2 | pentiumiii | pentium3) + basic_machine=i686-pc + ;; + pentium4) + basic_machine=i786-pc + ;; + pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) + basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pentiumpro-* | p6-* | 6x86-* | athlon-*) + basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*) + basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pentium4-*) + basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pn) + basic_machine=pn-gould + ;; + power) basic_machine=power-ibm + ;; + ppc) basic_machine=powerpc-unknown + ;; + ppc-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ppcle | powerpclittle | ppc-le | powerpc-little) + basic_machine=powerpcle-unknown + ;; + ppcle-* | powerpclittle-*) + basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ppc64) basic_machine=powerpc64-unknown + ;; + ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ppc64le | powerpc64little | ppc64-le | powerpc64-little) + basic_machine=powerpc64le-unknown + ;; + ppc64le-* | powerpc64little-*) + basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ps2) + basic_machine=i386-ibm + ;; + pw32) + basic_machine=i586-unknown + os=-pw32 + ;; + rom68k) + basic_machine=m68k-rom68k + os=-coff + ;; + rm[46]00) + basic_machine=mips-siemens + ;; + rtpc | rtpc-*) + basic_machine=romp-ibm + ;; + sa29200) + basic_machine=a29k-amd + os=-udi + ;; + sb1) + basic_machine=mipsisa64sb1-unknown + ;; + sb1el) + basic_machine=mipsisa64sb1el-unknown + ;; + sei) + basic_machine=mips-sei + os=-seiux + ;; + sequent) + basic_machine=i386-sequent + ;; + sh) + basic_machine=sh-hitachi + os=-hms + ;; + sh64) + basic_machine=sh64-unknown + ;; + sparclite-wrs | simso-wrs) + basic_machine=sparclite-wrs + os=-vxworks + ;; + sps7) + basic_machine=m68k-bull + os=-sysv2 + ;; + spur) + basic_machine=spur-unknown + ;; + st2000) + basic_machine=m68k-tandem + ;; + stratus) + basic_machine=i860-stratus + os=-sysv4 + ;; + sun2) + basic_machine=m68000-sun + ;; + sun2os3) + basic_machine=m68000-sun + os=-sunos3 + ;; + sun2os4) + basic_machine=m68000-sun + os=-sunos4 + ;; + sun3os3) + basic_machine=m68k-sun + os=-sunos3 + ;; + sun3os4) + basic_machine=m68k-sun + os=-sunos4 + ;; + sun4os3) + basic_machine=sparc-sun + os=-sunos3 + ;; + sun4os4) + basic_machine=sparc-sun + os=-sunos4 + ;; + sun4sol2) + basic_machine=sparc-sun + os=-solaris2 + ;; + sun3 | sun3-*) + basic_machine=m68k-sun + ;; + sun4) + basic_machine=sparc-sun + ;; + sun386 | sun386i | roadrunner) + basic_machine=i386-sun + ;; + sv1) + basic_machine=sv1-cray + os=-unicos + ;; + symmetry) + basic_machine=i386-sequent + os=-dynix + ;; + t3e) + basic_machine=alphaev5-cray + os=-unicos + ;; + t90) + basic_machine=t90-cray + os=-unicos + ;; + tic54x | c54x*) + basic_machine=tic54x-unknown + os=-coff + ;; + tic55x | c55x*) + basic_machine=tic55x-unknown + os=-coff + ;; + tic6x | c6x*) + basic_machine=tic6x-unknown + os=-coff + ;; + tx39) + basic_machine=mipstx39-unknown + ;; + tx39el) + basic_machine=mipstx39el-unknown + ;; + toad1) + basic_machine=pdp10-xkl + os=-tops20 + ;; + tower | tower-32) + basic_machine=m68k-ncr + ;; + udi29k) + basic_machine=a29k-amd + os=-udi + ;; + ultra3) + basic_machine=a29k-nyu + os=-sym1 + ;; + v810 | necv810) + basic_machine=v810-nec + os=-none + ;; + vaxv) + basic_machine=vax-dec + os=-sysv + ;; + vms) + basic_machine=vax-dec + os=-vms + ;; + vpp*|vx|vx-*) + basic_machine=f301-fujitsu + ;; + vxworks960) + basic_machine=i960-wrs + os=-vxworks + ;; + vxworks68) + basic_machine=m68k-wrs + os=-vxworks + ;; + vxworks29k) + basic_machine=a29k-wrs + os=-vxworks + ;; + w65*) + basic_machine=w65-wdc + os=-none + ;; + w89k-*) + basic_machine=hppa1.1-winbond + os=-proelf + ;; + xps | xps100) + basic_machine=xps100-honeywell + ;; + ymp) + basic_machine=ymp-cray + os=-unicos + ;; + z8k-*-coff) + basic_machine=z8k-unknown + os=-sim + ;; + none) + basic_machine=none-none + os=-none + ;; + +# Here we handle the default manufacturer of certain CPU types. It is in +# some cases the only manufacturer, in others, it is the most popular. + w89k) + basic_machine=hppa1.1-winbond + ;; + op50n) + basic_machine=hppa1.1-oki + ;; + op60c) + basic_machine=hppa1.1-oki + ;; + romp) + basic_machine=romp-ibm + ;; + rs6000) + basic_machine=rs6000-ibm + ;; + vax) + basic_machine=vax-dec + ;; + pdp10) + # there are many clones, so DEC is not a safe bet + basic_machine=pdp10-unknown + ;; + pdp11) + basic_machine=pdp11-dec + ;; + we32k) + basic_machine=we32k-att + ;; + sh3 | sh4 | sh[34]eb | sh[1234]le | sh[23]ele) + basic_machine=sh-unknown + ;; + sh64) + basic_machine=sh64-unknown + ;; + sparc | sparcv9 | sparcv9b) + basic_machine=sparc-sun + ;; + cydra) + basic_machine=cydra-cydrome + ;; + orion) + basic_machine=orion-highlevel + ;; + orion105) + basic_machine=clipper-highlevel + ;; + mac | mpw | mac-mpw) + basic_machine=m68k-apple + ;; + pmac | pmac-mpw) + basic_machine=powerpc-apple + ;; + *-unknown) + # Make sure to match an already-canonicalized machine name. + ;; + *) + echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 + exit 1 + ;; +esac + +# Here we canonicalize certain aliases for manufacturers. +case $basic_machine in + *-digital*) + basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'` + ;; + *-commodore*) + basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'` + ;; + *) + ;; +esac + +# Decode manufacturer-specific aliases for certain operating systems. + +if [ x"$os" != x"" ] +then +case $os in + # First match some system type aliases + # that might get confused with valid system types. + # -solaris* is a basic system type, with this one exception. + -solaris1 | -solaris1.*) + os=`echo $os | sed -e 's|solaris1|sunos4|'` + ;; + -solaris) + os=-solaris2 + ;; + -svr4*) + os=-sysv4 + ;; + -unixware*) + os=-sysv4.2uw + ;; + -gnu/linux*) + os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` + ;; + # First accept the basic system types. + # The portable systems comes first. + # Each alternative MUST END IN A *, to match a version number. + # -sysv* is not here because it comes later, after sysvr4. + -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ + | -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\ + | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \ + | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ + | -aos* \ + | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ + | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ + | -hiux* | -386bsd* | -netbsd* | -openbsd* | -freebsd* | -riscix* \ + | -lynxos* | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ + | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ + | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ + | -chorusos* | -chorusrdb* \ + | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ + | -mingw32* | -linux-gnu* | -uxpv* | -beos* | -mpeix* | -udk* \ + | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ + | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ + | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ + | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ + | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ + | -powermax* | -dnix* | -nx6 | -nx7 | -sei*) + # Remember, each alternative MUST END IN *, to match a version number. + ;; + -qnx*) + case $basic_machine in + x86-* | i*86-*) + ;; + *) + os=-nto$os + ;; + esac + ;; + -nto-qnx*) + ;; + -nto*) + os=`echo $os | sed -e 's|nto|nto-qnx|'` + ;; + -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ + | -windows* | -osx | -abug | -netware* | -os9* | -beos* \ + | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) + ;; + -mac*) + os=`echo $os | sed -e 's|mac|macos|'` + ;; + -linux*) + os=`echo $os | sed -e 's|linux|linux-gnu|'` + ;; + -sunos5*) + os=`echo $os | sed -e 's|sunos5|solaris2|'` + ;; + -sunos6*) + os=`echo $os | sed -e 's|sunos6|solaris3|'` + ;; + -opened*) + os=-openedition + ;; + -wince*) + os=-wince + ;; + -osfrose*) + os=-osfrose + ;; + -osf*) + os=-osf + ;; + -utek*) + os=-bsd + ;; + -dynix*) + os=-bsd + ;; + -acis*) + os=-aos + ;; + -atheos*) + os=-atheos + ;; + -386bsd) + os=-bsd + ;; + -ctix* | -uts*) + os=-sysv + ;; + -nova*) + os=-rtmk-nova + ;; + -ns2 ) + os=-nextstep2 + ;; + -nsk*) + os=-nsk + ;; + # Preserve the version number of sinix5. + -sinix5.*) + os=`echo $os | sed -e 's|sinix|sysv|'` + ;; + -sinix*) + os=-sysv4 + ;; + -triton*) + os=-sysv3 + ;; + -oss*) + os=-sysv3 + ;; + -svr4) + os=-sysv4 + ;; + -svr3) + os=-sysv3 + ;; + -sysvr4) + os=-sysv4 + ;; + # This must come after -sysvr4. + -sysv*) + ;; + -ose*) + os=-ose + ;; + -es1800*) + os=-ose + ;; + -xenix) + os=-xenix + ;; + -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) + os=-mint + ;; + -aros*) + os=-aros + ;; + -kaos*) + os=-kaos + ;; + -none) + ;; + *) + # Get rid of the `-' at the beginning of $os. + os=`echo $os | sed 's/[^-]*-//'` + echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2 + exit 1 + ;; +esac +else + +# Here we handle the default operating systems that come with various machines. +# The value should be what the vendor currently ships out the door with their +# machine or put another way, the most popular os provided with the machine. + +# Note that if you're going to try to match "-MANUFACTURER" here (say, +# "-sun"), then you have to tell the case statement up towards the top +# that MANUFACTURER isn't an operating system. Otherwise, code above +# will signal an error saying that MANUFACTURER isn't an operating +# system, and we'll never get to this point. + +case $basic_machine in + *-acorn) + os=-riscix1.2 + ;; + arm*-rebel) + os=-linux + ;; + arm*-semi) + os=-aout + ;; + c4x-* | tic4x-*) + os=-coff + ;; + # This must come before the *-dec entry. + pdp10-*) + os=-tops20 + ;; + pdp11-*) + os=-none + ;; + *-dec | vax-*) + os=-ultrix4.2 + ;; + m68*-apollo) + os=-domain + ;; + i386-sun) + os=-sunos4.0.2 + ;; + m68000-sun) + os=-sunos3 + # This also exists in the configure program, but was not the + # default. + # os=-sunos4 + ;; + m68*-cisco) + os=-aout + ;; + mips*-cisco) + os=-elf + ;; + mips*-*) + os=-elf + ;; + or32-*) + os=-coff + ;; + *-tti) # must be before sparc entry or we get the wrong os. + os=-sysv3 + ;; + sparc-* | *-sun) + os=-sunos4.1.1 + ;; + *-be) + os=-beos + ;; + *-ibm) + os=-aix + ;; + *-wec) + os=-proelf + ;; + *-winbond) + os=-proelf + ;; + *-oki) + os=-proelf + ;; + *-hp) + os=-hpux + ;; + *-hitachi) + os=-hiux + ;; + i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) + os=-sysv + ;; + *-cbm) + os=-amigaos + ;; + *-dg) + os=-dgux + ;; + *-dolphin) + os=-sysv3 + ;; + m68k-ccur) + os=-rtu + ;; + m88k-omron*) + os=-luna + ;; + *-next ) + os=-nextstep + ;; + *-sequent) + os=-ptx + ;; + *-crds) + os=-unos + ;; + *-ns) + os=-genix + ;; + i370-*) + os=-mvs + ;; + *-next) + os=-nextstep3 + ;; + *-gould) + os=-sysv + ;; + *-highlevel) + os=-bsd + ;; + *-encore) + os=-bsd + ;; + *-sgi) + os=-irix + ;; + *-siemens) + os=-sysv4 + ;; + *-masscomp) + os=-rtu + ;; + f30[01]-fujitsu | f700-fujitsu) + os=-uxpv + ;; + *-rom68k) + os=-coff + ;; + *-*bug) + os=-coff + ;; + *-apple) + os=-macos + ;; + *-atari*) + os=-mint + ;; + *) + os=-none + ;; +esac +fi + +# Here we handle the case where we know the os, and the CPU type, but not the +# manufacturer. We pick the logical manufacturer. +vendor=unknown +case $basic_machine in + *-unknown) + case $os in + -riscix*) + vendor=acorn + ;; + -sunos*) + vendor=sun + ;; + -aix*) + vendor=ibm + ;; + -beos*) + vendor=be + ;; + -hpux*) + vendor=hp + ;; + -mpeix*) + vendor=hp + ;; + -hiux*) + vendor=hitachi + ;; + -unos*) + vendor=crds + ;; + -dgux*) + vendor=dg + ;; + -luna*) + vendor=omron + ;; + -genix*) + vendor=ns + ;; + -mvs* | -opened*) + vendor=ibm + ;; + -ptx*) + vendor=sequent + ;; + -vxsim* | -vxworks* | -windiss*) + vendor=wrs + ;; + -aux*) + vendor=apple + ;; + -hms*) + vendor=hitachi + ;; + -mpw* | -macos*) + vendor=apple + ;; + -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) + vendor=atari + ;; + -vos*) + vendor=stratus + ;; + esac + basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"` + ;; +esac + +echo $basic_machine$os +exit 0 + +# Local variables: +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "timestamp='" +# time-stamp-format: "%:y-%02m-%02d" +# time-stamp-end: "'" +# End: diff --git a/app/lbxproxy/config/AtomControl b/app/lbxproxy/config/AtomControl new file mode 100644 index 000000000..ddaa6ec5b --- /dev/null +++ b/app/lbxproxy/config/AtomControl @@ -0,0 +1,91 @@ +! $Xorg: AtomControl,v 1.3 2000/08/17 19:53:53 cpqbld Exp $ +! +! z +! means do not cache property data smaller than this many bytes +! +! +! where options are: +! i = pre-intern at startup +! w = cache only if WM is running through the proxy +! n = never cache +! +! depending on the apps you use, you might not want all of these +! +!z 8 +i _DT_NETFILE +i _DT_RESTORE_DIR +i _DT_SAVE_MODE +i _MOTIF_ATOM_0 +i _MOTIF_BINDINGS +i _MOTIF_CLIP_DATA_DELETE +i _MOTIF_CLIP_DATA_REQUEST +i _MOTIF_CLIP_HEADER +i _MOTIF_CLIP_LOCK_ACCESS_VALID +i _MOTIF_CLIP_MESSAGE +i _MOTIF_CLIP_NEXT_ID +i _MOTIF_CLIP_TIME +i _MOTIF_DEFAULT_BINDINGS +i _MOTIF_DRAG_ATOMS +i _MOTIF_DRAG_ATOM_PAIRS +i _MOTIF_DRAG_INITIATOR_INFO +i _MOTIF_DRAG_PROXY_WINDOW +i _MOTIF_DRAG_RECEIVER_INFO +i _MOTIF_DRAG_TARGETS +i _MOTIF_DRAG_WINDOW +i _MOTIF_DROP +i _MOTIF_MESSAGE +i _MOTIF_WM_HINTS +i _MOTIF_WM_INFO +i _MOTIF_WM_MENU +i _MOTIF_WM_MESSAGES +i _MOTIF_WM_OFFSET +i _XIM_INPUTMETHOD +i _XM_TEXT_I_S_PROP +i _XT_SELECTION_0 +i ATOM_PAIR +i AVERAGE_WIDTH +i CLIPBOARD +i CLIP_TEMPORARY +i Compose +i COMPOUND_TEXT +i Customize Data:0 +i DELETE +i FILE_NAME +i INCR +i INSERT_SELECTION +i LENGTH +i MOTIF_DESTINATION +i MULTIPLE +i Pixel Sets +i PIXEL_SIZE +i PRIMARY +i RESOLUTION_Y +i SCREEN_RESOURCES +i SDT Pixel Set +i SM_CLIENT_ID +i STRING +i TARGETS +i TEXT +i TIMESTAMP +i TT_SESSION +iw WM_CHANGE_STATE +iw WM_CLASS +iw WM_CLIENT_LEADER +w WM_CLIENT_MACHINE +iw WM_COLORMAP_WINDOWS +i WM_DELETE_WINDOW +w WM_ICON_NAME +w WM_ICON_SIZE +w WM_HINTS +iw WM_LOCALE_NAME +i WM_MOVED +iw WM_NAME +iw WM_NORMAL_HINTS +iw WM_PROTOCOLS +i WM_SAVE_YOURSELF +iw WM_STATE +i WM_TAKE_FOCUS +iw WM_TRANSIENT_FOR +iw WM_WINDOW_ROLE +i XmTRANSFER_SUCCESS +i XmTRANSFER_FAILURE diff --git a/app/lbxproxy/configure b/app/lbxproxy/configure new file mode 100644 index 000000000..16c99fe29 --- /dev/null +++ b/app/lbxproxy/configure @@ -0,0 +1,5413 @@ +#! /bin/sh +# Guess values for system-dependent variables and create Makefiles. +# Generated by GNU Autoconf 2.59 for lbxproxy 1.0.1. +# +# Report bugs to . +# +# Copyright (C) 2003 Free Software Foundation, Inc. +# This configure script is free software; the Free Software Foundation +# gives unlimited permission to copy, distribute and modify it. +## --------------------- ## +## M4sh Initialization. ## +## --------------------- ## + +# Be Bourne compatible +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then + emulate sh + NULLCMD=: + # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' +elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then + set -o posix +fi +DUALCASE=1; export DUALCASE # for MKS sh + +# Support unset when possible. +if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then + as_unset=unset +else + as_unset=false +fi + + +# Work around bugs in pre-3.0 UWIN ksh. +$as_unset ENV MAIL MAILPATH +PS1='$ ' +PS2='> ' +PS4='+ ' + +# NLS nuisances. +for as_var in \ + LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ + LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ + LC_TELEPHONE LC_TIME +do + if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then + eval $as_var=C; export $as_var + else + $as_unset $as_var + fi +done + +# Required to use basename. +if expr a : '\(a\)' >/dev/null 2>&1; then + as_expr=expr +else + as_expr=false +fi + +if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then + as_basename=basename +else + as_basename=false +fi + + +# Name of the executable. +as_me=`$as_basename "$0" || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)$' \| \ + . : '\(.\)' 2>/dev/null || +echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; } + /^X\/\(\/\/\)$/{ s//\1/; q; } + /^X\/\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + + +# PATH needs CR, and LINENO needs CR and PATH. +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + echo "#! /bin/sh" >conf$$.sh + echo "exit 0" >>conf$$.sh + chmod +x conf$$.sh + if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then + PATH_SEPARATOR=';' + else + PATH_SEPARATOR=: + fi + rm -f conf$$.sh +fi + + + as_lineno_1=$LINENO + as_lineno_2=$LINENO + as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` + test "x$as_lineno_1" != "x$as_lineno_2" && + test "x$as_lineno_3" = "x$as_lineno_2" || { + # Find who we are. Look in the path if we contain no path at all + # relative or not. + case $0 in + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break +done + + ;; + esac + # We did not find ourselves, most probably we were run as `sh COMMAND' + # in which case we are not to be found in the path. + if test "x$as_myself" = x; then + as_myself=$0 + fi + if test ! -f "$as_myself"; then + { echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2 + { (exit 1); exit 1; }; } + fi + case $CONFIG_SHELL in + '') + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for as_base in sh bash ksh sh5; do + case $as_dir in + /*) + if ("$as_dir/$as_base" -c ' + as_lineno_1=$LINENO + as_lineno_2=$LINENO + as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` + test "x$as_lineno_1" != "x$as_lineno_2" && + test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then + $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; } + $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; } + CONFIG_SHELL=$as_dir/$as_base + export CONFIG_SHELL + exec "$CONFIG_SHELL" "$0" ${1+"$@"} + fi;; + esac + done +done +;; + esac + + # Create $as_me.lineno as a copy of $as_myself, but with $LINENO + # uniformly replaced by the line number. The first 'sed' inserts a + # line-number line before each line; the second 'sed' does the real + # work. The second script uses 'N' to pair each line-number line + # with the numbered line, and appends trailing '-' during + # substitution so that $LINENO is not a special case at line end. + # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the + # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-) + sed '=' <$as_myself | + sed ' + N + s,$,-, + : loop + s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3, + t loop + s,-$,, + s,^['$as_cr_digits']*\n,, + ' >$as_me.lineno && + chmod +x $as_me.lineno || + { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 + { (exit 1); exit 1; }; } + + # Don't try to exec as it changes $[0], causing all sort of problems + # (the dirname of $[0] is not the place where we might find the + # original and so on. Autoconf is especially sensible to this). + . ./$as_me.lineno + # Exit status is that of the last command. + exit +} + + +case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in + *c*,-n*) ECHO_N= ECHO_C=' +' ECHO_T=' ' ;; + *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; + *) ECHO_N= ECHO_C='\c' ECHO_T= ;; +esac + +if expr a : '\(a\)' >/dev/null 2>&1; then + as_expr=expr +else + as_expr=false +fi + +rm -f conf$$ conf$$.exe conf$$.file +echo >conf$$.file +if ln -s conf$$.file conf$$ 2>/dev/null; then + # We could just check for DJGPP; but this test a) works b) is more generic + # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). + if test -f conf$$.exe; then + # Don't use ln at all; we don't have any links + as_ln_s='cp -p' + else + as_ln_s='ln -s' + fi +elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln +else + as_ln_s='cp -p' +fi +rm -f conf$$ conf$$.exe conf$$.file + +if mkdir -p . 2>/dev/null; then + as_mkdir_p=: +else + test -d ./-p && rmdir ./-p + as_mkdir_p=false +fi + +as_executable_p="test -f" + +# Sed expression to map a string onto a valid CPP name. +as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" + +# Sed expression to map a string onto a valid variable name. +as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" + + +# IFS +# We need space, tab and new line, in precisely that order. +as_nl=' +' +IFS=" $as_nl" + +# CDPATH. +$as_unset CDPATH + + +# Name of the host. +# hostname on some systems (SVR3.2, Linux) returns a bogus exit status, +# so uname gets run too. +ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` + +exec 6>&1 + +# +# Initializations. +# +ac_default_prefix=/usr/local +ac_config_libobj_dir=. +cross_compiling=no +subdirs= +MFLAGS= +MAKEFLAGS= +SHELL=${CONFIG_SHELL-/bin/sh} + +# Maximum number of lines to put in a shell here document. +# This variable seems obsolete. It should probably be removed, and +# only ac_max_sed_lines should be used. +: ${ac_max_here_lines=38} + +# Identity of this package. +PACKAGE_NAME='lbxproxy' +PACKAGE_TARNAME='lbxproxy' +PACKAGE_VERSION='1.0.1' +PACKAGE_STRING='lbxproxy 1.0.1' +PACKAGE_BUGREPORT='https://bugs.freedesktop.org/enter_bug.cgi?product=xorg' + +ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CYGPATH_W PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO AMTAR install_sh STRIP ac_ct_STRIP INSTALL_STRIP_PROGRAM AWK SET_MAKE am__leading_dot MAINTAINER_MODE_TRUE MAINTAINER_MODE_FALSE MAINT CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT DEPDIR am__include am__quote AMDEP_TRUE AMDEP_FALSE AMDEPBACKSLASH CCDEPMODE am__fastdepCC_TRUE am__fastdepCC_FALSE build build_cpu build_vendor build_os host host_cpu host_vendor host_os PKG_CONFIG ac_pt_PKG_CONFIG LBXPROXY_CFLAGS LBXPROXY_LIBS APP_MAN_SUFFIX LIB_MAN_SUFFIX FILE_MAN_SUFFIX MISC_MAN_SUFFIX DRIVER_MAN_SUFFIX ADMIN_MAN_SUFFIX APP_MAN_DIR LIB_MAN_DIR FILE_MAN_DIR MISC_MAN_DIR DRIVER_MAN_DIR ADMIN_MAN_DIR LIBOBJS LTLIBOBJS' +ac_subst_files='' + +# Initialize some variables set by options. +ac_init_help= +ac_init_version=false +# The variables have the same names as the options, with +# dashes changed to underlines. +cache_file=/dev/null +exec_prefix=NONE +no_create= +no_recursion= +prefix=NONE +program_prefix=NONE +program_suffix=NONE +program_transform_name=s,x,x, +silent= +site= +srcdir= +verbose= +x_includes=NONE +x_libraries=NONE + +# Installation directory options. +# These are left unexpanded so users can "make install exec_prefix=/foo" +# and all the variables that are supposed to be based on exec_prefix +# by default will actually change. +# Use braces instead of parens because sh, perl, etc. also accept them. +bindir='${exec_prefix}/bin' +sbindir='${exec_prefix}/sbin' +libexecdir='${exec_prefix}/libexec' +datadir='${prefix}/share' +sysconfdir='${prefix}/etc' +sharedstatedir='${prefix}/com' +localstatedir='${prefix}/var' +libdir='${exec_prefix}/lib' +includedir='${prefix}/include' +oldincludedir='/usr/include' +infodir='${prefix}/info' +mandir='${prefix}/man' + +ac_prev= +for ac_option +do + # If the previous option needs an argument, assign it. + if test -n "$ac_prev"; then + eval "$ac_prev=\$ac_option" + ac_prev= + continue + fi + + ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'` + + # Accept the important Cygnus configure options, so we can diagnose typos. + + case $ac_option in + + -bindir | --bindir | --bindi | --bind | --bin | --bi) + ac_prev=bindir ;; + -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) + bindir=$ac_optarg ;; + + -build | --build | --buil | --bui | --bu) + ac_prev=build_alias ;; + -build=* | --build=* | --buil=* | --bui=* | --bu=*) + build_alias=$ac_optarg ;; + + -cache-file | --cache-file | --cache-fil | --cache-fi \ + | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) + ac_prev=cache_file ;; + -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ + | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) + cache_file=$ac_optarg ;; + + --config-cache | -C) + cache_file=config.cache ;; + + -datadir | --datadir | --datadi | --datad | --data | --dat | --da) + ac_prev=datadir ;; + -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \ + | --da=*) + datadir=$ac_optarg ;; + + -disable-* | --disable-*) + ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid feature name: $ac_feature" >&2 + { (exit 1); exit 1; }; } + ac_feature=`echo $ac_feature | sed 's/-/_/g'` + eval "enable_$ac_feature=no" ;; + + -enable-* | --enable-*) + ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid feature name: $ac_feature" >&2 + { (exit 1); exit 1; }; } + ac_feature=`echo $ac_feature | sed 's/-/_/g'` + case $ac_option in + *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; + *) ac_optarg=yes ;; + esac + eval "enable_$ac_feature='$ac_optarg'" ;; + + -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ + | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ + | --exec | --exe | --ex) + ac_prev=exec_prefix ;; + -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ + | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ + | --exec=* | --exe=* | --ex=*) + exec_prefix=$ac_optarg ;; + + -gas | --gas | --ga | --g) + # Obsolete; use --with-gas. + with_gas=yes ;; + + -help | --help | --hel | --he | -h) + ac_init_help=long ;; + -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) + ac_init_help=recursive ;; + -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) + ac_init_help=short ;; + + -host | --host | --hos | --ho) + ac_prev=host_alias ;; + -host=* | --host=* | --hos=* | --ho=*) + host_alias=$ac_optarg ;; + + -includedir | --includedir | --includedi | --included | --include \ + | --includ | --inclu | --incl | --inc) + ac_prev=includedir ;; + -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ + | --includ=* | --inclu=* | --incl=* | --inc=*) + includedir=$ac_optarg ;; + + -infodir | --infodir | --infodi | --infod | --info | --inf) + ac_prev=infodir ;; + -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) + infodir=$ac_optarg ;; + + -libdir | --libdir | --libdi | --libd) + ac_prev=libdir ;; + -libdir=* | --libdir=* | --libdi=* | --libd=*) + libdir=$ac_optarg ;; + + -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ + | --libexe | --libex | --libe) + ac_prev=libexecdir ;; + -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ + | --libexe=* | --libex=* | --libe=*) + libexecdir=$ac_optarg ;; + + -localstatedir | --localstatedir | --localstatedi | --localstated \ + | --localstate | --localstat | --localsta | --localst \ + | --locals | --local | --loca | --loc | --lo) + ac_prev=localstatedir ;; + -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ + | --localstate=* | --localstat=* | --localsta=* | --localst=* \ + | --locals=* | --local=* | --loca=* | --loc=* | --lo=*) + localstatedir=$ac_optarg ;; + + -mandir | --mandir | --mandi | --mand | --man | --ma | --m) + ac_prev=mandir ;; + -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) + mandir=$ac_optarg ;; + + -nfp | --nfp | --nf) + # Obsolete; use --without-fp. + with_fp=no ;; + + -no-create | --no-create | --no-creat | --no-crea | --no-cre \ + | --no-cr | --no-c | -n) + no_create=yes ;; + + -no-recursion | --no-recursion | --no-recursio | --no-recursi \ + | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) + no_recursion=yes ;; + + -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ + | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ + | --oldin | --oldi | --old | --ol | --o) + ac_prev=oldincludedir ;; + -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ + | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ + | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) + oldincludedir=$ac_optarg ;; + + -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) + ac_prev=prefix ;; + -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) + prefix=$ac_optarg ;; + + -program-prefix | --program-prefix | --program-prefi | --program-pref \ + | --program-pre | --program-pr | --program-p) + ac_prev=program_prefix ;; + -program-prefix=* | --program-prefix=* | --program-prefi=* \ + | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) + program_prefix=$ac_optarg ;; + + -program-suffix | --program-suffix | --program-suffi | --program-suff \ + | --program-suf | --program-su | --program-s) + ac_prev=program_suffix ;; + -program-suffix=* | --program-suffix=* | --program-suffi=* \ + | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) + program_suffix=$ac_optarg ;; + + -program-transform-name | --program-transform-name \ + | --program-transform-nam | --program-transform-na \ + | --program-transform-n | --program-transform- \ + | --program-transform | --program-transfor \ + | --program-transfo | --program-transf \ + | --program-trans | --program-tran \ + | --progr-tra | --program-tr | --program-t) + ac_prev=program_transform_name ;; + -program-transform-name=* | --program-transform-name=* \ + | --program-transform-nam=* | --program-transform-na=* \ + | --program-transform-n=* | --program-transform-=* \ + | --program-transform=* | --program-transfor=* \ + | --program-transfo=* | --program-transf=* \ + | --program-trans=* | --program-tran=* \ + | --progr-tra=* | --program-tr=* | --program-t=*) + program_transform_name=$ac_optarg ;; + + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + silent=yes ;; + + -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) + ac_prev=sbindir ;; + -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ + | --sbi=* | --sb=*) + sbindir=$ac_optarg ;; + + -sharedstatedir | --sharedstatedir | --sharedstatedi \ + | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ + | --sharedst | --shareds | --shared | --share | --shar \ + | --sha | --sh) + ac_prev=sharedstatedir ;; + -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ + | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ + | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ + | --sha=* | --sh=*) + sharedstatedir=$ac_optarg ;; + + -site | --site | --sit) + ac_prev=site ;; + -site=* | --site=* | --sit=*) + site=$ac_optarg ;; + + -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) + ac_prev=srcdir ;; + -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) + srcdir=$ac_optarg ;; + + -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ + | --syscon | --sysco | --sysc | --sys | --sy) + ac_prev=sysconfdir ;; + -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ + | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) + sysconfdir=$ac_optarg ;; + + -target | --target | --targe | --targ | --tar | --ta | --t) + ac_prev=target_alias ;; + -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) + target_alias=$ac_optarg ;; + + -v | -verbose | --verbose | --verbos | --verbo | --verb) + verbose=yes ;; + + -version | --version | --versio | --versi | --vers | -V) + ac_init_version=: ;; + + -with-* | --with-*) + ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid package name: $ac_package" >&2 + { (exit 1); exit 1; }; } + ac_package=`echo $ac_package| sed 's/-/_/g'` + case $ac_option in + *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; + *) ac_optarg=yes ;; + esac + eval "with_$ac_package='$ac_optarg'" ;; + + -without-* | --without-*) + ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid package name: $ac_package" >&2 + { (exit 1); exit 1; }; } + ac_package=`echo $ac_package | sed 's/-/_/g'` + eval "with_$ac_package=no" ;; + + --x) + # Obsolete; use --with-x. + with_x=yes ;; + + -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ + | --x-incl | --x-inc | --x-in | --x-i) + ac_prev=x_includes ;; + -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ + | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) + x_includes=$ac_optarg ;; + + -x-libraries | --x-libraries | --x-librarie | --x-librari \ + | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) + ac_prev=x_libraries ;; + -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ + | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) + x_libraries=$ac_optarg ;; + + -*) { echo "$as_me: error: unrecognized option: $ac_option +Try \`$0 --help' for more information." >&2 + { (exit 1); exit 1; }; } + ;; + + *=*) + ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` + # Reject names that are not valid shell variable names. + expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid variable name: $ac_envvar" >&2 + { (exit 1); exit 1; }; } + ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` + eval "$ac_envvar='$ac_optarg'" + export $ac_envvar ;; + + *) + # FIXME: should be removed in autoconf 3.0. + echo "$as_me: WARNING: you should use --build, --host, --target" >&2 + expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && + echo "$as_me: WARNING: invalid host type: $ac_option" >&2 + : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option} + ;; + + esac +done + +if test -n "$ac_prev"; then + ac_option=--`echo $ac_prev | sed 's/_/-/g'` + { echo "$as_me: error: missing argument to $ac_option" >&2 + { (exit 1); exit 1; }; } +fi + +# Be sure to have absolute paths. +for ac_var in exec_prefix prefix +do + eval ac_val=$`echo $ac_var` + case $ac_val in + [\\/$]* | ?:[\\/]* | NONE | '' ) ;; + *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 + { (exit 1); exit 1; }; };; + esac +done + +# Be sure to have absolute paths. +for ac_var in bindir sbindir libexecdir datadir sysconfdir sharedstatedir \ + localstatedir libdir includedir oldincludedir infodir mandir +do + eval ac_val=$`echo $ac_var` + case $ac_val in + [\\/$]* | ?:[\\/]* ) ;; + *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 + { (exit 1); exit 1; }; };; + esac +done + +# There might be people who depend on the old broken behavior: `$host' +# used to hold the argument of --host etc. +# FIXME: To remove some day. +build=$build_alias +host=$host_alias +target=$target_alias + +# FIXME: To remove some day. +if test "x$host_alias" != x; then + if test "x$build_alias" = x; then + cross_compiling=maybe + echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host. + If a cross compiler is detected then cross compile mode will be used." >&2 + elif test "x$build_alias" != "x$host_alias"; then + cross_compiling=yes + fi +fi + +ac_tool_prefix= +test -n "$host_alias" && ac_tool_prefix=$host_alias- + +test "$silent" = yes && exec 6>/dev/null + + +# Find the source files, if location was not specified. +if test -z "$srcdir"; then + ac_srcdir_defaulted=yes + # Try the directory containing this script, then its parent. + ac_confdir=`(dirname "$0") 2>/dev/null || +$as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$0" : 'X\(//\)[^/]' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$0" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + srcdir=$ac_confdir + if test ! -r $srcdir/$ac_unique_file; then + srcdir=.. + fi +else + ac_srcdir_defaulted=no +fi +if test ! -r $srcdir/$ac_unique_file; then + if test "$ac_srcdir_defaulted" = yes; then + { echo "$as_me: error: cannot find sources ($ac_unique_file) in $ac_confdir or .." >&2 + { (exit 1); exit 1; }; } + else + { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 + { (exit 1); exit 1; }; } + fi +fi +(cd $srcdir && test -r ./$ac_unique_file) 2>/dev/null || + { echo "$as_me: error: sources are in $srcdir, but \`cd $srcdir' does not work" >&2 + { (exit 1); exit 1; }; } +srcdir=`echo "$srcdir" | sed 's%\([^\\/]\)[\\/]*$%\1%'` +ac_env_build_alias_set=${build_alias+set} +ac_env_build_alias_value=$build_alias +ac_cv_env_build_alias_set=${build_alias+set} +ac_cv_env_build_alias_value=$build_alias +ac_env_host_alias_set=${host_alias+set} +ac_env_host_alias_value=$host_alias +ac_cv_env_host_alias_set=${host_alias+set} +ac_cv_env_host_alias_value=$host_alias +ac_env_target_alias_set=${target_alias+set} +ac_env_target_alias_value=$target_alias +ac_cv_env_target_alias_set=${target_alias+set} +ac_cv_env_target_alias_value=$target_alias +ac_env_CC_set=${CC+set} +ac_env_CC_value=$CC +ac_cv_env_CC_set=${CC+set} +ac_cv_env_CC_value=$CC +ac_env_CFLAGS_set=${CFLAGS+set} +ac_env_CFLAGS_value=$CFLAGS +ac_cv_env_CFLAGS_set=${CFLAGS+set} +ac_cv_env_CFLAGS_value=$CFLAGS +ac_env_LDFLAGS_set=${LDFLAGS+set} +ac_env_LDFLAGS_value=$LDFLAGS +ac_cv_env_LDFLAGS_set=${LDFLAGS+set} +ac_cv_env_LDFLAGS_value=$LDFLAGS +ac_env_CPPFLAGS_set=${CPPFLAGS+set} +ac_env_CPPFLAGS_value=$CPPFLAGS +ac_cv_env_CPPFLAGS_set=${CPPFLAGS+set} +ac_cv_env_CPPFLAGS_value=$CPPFLAGS +ac_env_PKG_CONFIG_set=${PKG_CONFIG+set} +ac_env_PKG_CONFIG_value=$PKG_CONFIG +ac_cv_env_PKG_CONFIG_set=${PKG_CONFIG+set} +ac_cv_env_PKG_CONFIG_value=$PKG_CONFIG +ac_env_LBXPROXY_CFLAGS_set=${LBXPROXY_CFLAGS+set} +ac_env_LBXPROXY_CFLAGS_value=$LBXPROXY_CFLAGS +ac_cv_env_LBXPROXY_CFLAGS_set=${LBXPROXY_CFLAGS+set} +ac_cv_env_LBXPROXY_CFLAGS_value=$LBXPROXY_CFLAGS +ac_env_LBXPROXY_LIBS_set=${LBXPROXY_LIBS+set} +ac_env_LBXPROXY_LIBS_value=$LBXPROXY_LIBS +ac_cv_env_LBXPROXY_LIBS_set=${LBXPROXY_LIBS+set} +ac_cv_env_LBXPROXY_LIBS_value=$LBXPROXY_LIBS + +# +# Report the --help message. +# +if test "$ac_init_help" = "long"; then + # Omit some internal or obsolete options to make the list less imposing. + # This message is too long to be a string in the A/UX 3.1 sh. + cat <<_ACEOF +\`configure' configures lbxproxy 1.0.1 to adapt to many kinds of systems. + +Usage: $0 [OPTION]... [VAR=VALUE]... + +To assign environment variables (e.g., CC, CFLAGS...), specify them as +VAR=VALUE. See below for descriptions of some of the useful variables. + +Defaults for the options are specified in brackets. + +Configuration: + -h, --help display this help and exit + --help=short display options specific to this package + --help=recursive display the short help of all the included packages + -V, --version display version information and exit + -q, --quiet, --silent do not print \`checking...' messages + --cache-file=FILE cache test results in FILE [disabled] + -C, --config-cache alias for \`--cache-file=config.cache' + -n, --no-create do not create output files + --srcdir=DIR find the sources in DIR [configure dir or \`..'] + +_ACEOF + + cat <<_ACEOF +Installation directories: + --prefix=PREFIX install architecture-independent files in PREFIX + [$ac_default_prefix] + --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX + [PREFIX] + +By default, \`make install' will install all the files in +\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify +an installation prefix other than \`$ac_default_prefix' using \`--prefix', +for instance \`--prefix=\$HOME'. + +For better control, use the options below. + +Fine tuning of the installation directories: + --bindir=DIR user executables [EPREFIX/bin] + --sbindir=DIR system admin executables [EPREFIX/sbin] + --libexecdir=DIR program executables [EPREFIX/libexec] + --datadir=DIR read-only architecture-independent data [PREFIX/share] + --sysconfdir=DIR read-only single-machine data [PREFIX/etc] + --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] + --localstatedir=DIR modifiable single-machine data [PREFIX/var] + --libdir=DIR object code libraries [EPREFIX/lib] + --includedir=DIR C header files [PREFIX/include] + --oldincludedir=DIR C header files for non-gcc [/usr/include] + --infodir=DIR info documentation [PREFIX/info] + --mandir=DIR man documentation [PREFIX/man] +_ACEOF + + cat <<\_ACEOF + +Program names: + --program-prefix=PREFIX prepend PREFIX to installed program names + --program-suffix=SUFFIX append SUFFIX to installed program names + --program-transform-name=PROGRAM run sed PROGRAM on installed program names + +System types: + --build=BUILD configure for building on BUILD [guessed] + --host=HOST cross-compile to build programs to run on HOST [BUILD] +_ACEOF +fi + +if test -n "$ac_init_help"; then + case $ac_init_help in + short | recursive ) echo "Configuration of lbxproxy 1.0.1:";; + esac + cat <<\_ACEOF + +Optional Features: + --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) + --enable-FEATURE[=ARG] include FEATURE [ARG=yes] + --enable-maintainer-mode enable make rules and dependencies not useful + (and sometimes confusing) to the casual installer + --disable-dependency-tracking Speeds up one-time builds + --enable-dependency-tracking Do not reject slow dependency extractors + --enable-unix-transport Enable UNIX domain socket transport + --enable-tcp-transport Enable TCP socket transport + --enable-IPv6 Enable IPv6 support + +Optional Packages: + --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] + --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) + --with-release-version=STRING + Use release version string in package name + +Some influential environment variables: + CC C compiler command + CFLAGS C compiler flags + LDFLAGS linker flags, e.g. -L if you have libraries in a + nonstandard directory + CPPFLAGS C/C++ preprocessor flags, e.g. -I if you have + headers in a nonstandard directory + PKG_CONFIG path to pkg-config utility + LBXPROXY_CFLAGS + C compiler flags for LBXPROXY, overriding pkg-config + LBXPROXY_LIBS + linker flags for LBXPROXY, overriding pkg-config + +Use these variables to override the choices made by `configure' or to help +it to find libraries and programs with nonstandard names/locations. + +Report bugs to . +_ACEOF +fi + +if test "$ac_init_help" = "recursive"; then + # If there are subdirs, report their specific --help. + ac_popdir=`pwd` + for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue + test -d $ac_dir || continue + ac_builddir=. + +if test "$ac_dir" != .; then + ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` + # A "../" for each directory in $ac_dir_suffix. + ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` +else + ac_dir_suffix= ac_top_builddir= +fi + +case $srcdir in + .) # No --srcdir option. We are building in place. + ac_srcdir=. + if test -z "$ac_top_builddir"; then + ac_top_srcdir=. + else + ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` + fi ;; + [\\/]* | ?:[\\/]* ) # Absolute path. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir ;; + *) # Relative path. + ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_builddir$srcdir ;; +esac + +# Do not use `cd foo && pwd` to compute absolute paths, because +# the directories may not exist. +case `pwd` in +.) ac_abs_builddir="$ac_dir";; +*) + case "$ac_dir" in + .) ac_abs_builddir=`pwd`;; + [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";; + *) ac_abs_builddir=`pwd`/"$ac_dir";; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_top_builddir=${ac_top_builddir}.;; +*) + case ${ac_top_builddir}. in + .) ac_abs_top_builddir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;; + *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_srcdir=$ac_srcdir;; +*) + case $ac_srcdir in + .) ac_abs_srcdir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;; + *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_top_srcdir=$ac_top_srcdir;; +*) + case $ac_top_srcdir in + .) ac_abs_top_srcdir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;; + *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;; + esac;; +esac + + cd $ac_dir + # Check for guested configure; otherwise get Cygnus style configure. + if test -f $ac_srcdir/configure.gnu; then + echo + $SHELL $ac_srcdir/configure.gnu --help=recursive + elif test -f $ac_srcdir/configure; then + echo + $SHELL $ac_srcdir/configure --help=recursive + elif test -f $ac_srcdir/configure.ac || + test -f $ac_srcdir/configure.in; then + echo + $ac_configure --help + else + echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 + fi + cd $ac_popdir + done +fi + +test -n "$ac_init_help" && exit 0 +if $ac_init_version; then + cat <<\_ACEOF +lbxproxy configure 1.0.1 +generated by GNU Autoconf 2.59 + +Copyright (C) 2003 Free Software Foundation, Inc. +This configure script is free software; the Free Software Foundation +gives unlimited permission to copy, distribute and modify it. +_ACEOF + exit 0 +fi +exec 5>config.log +cat >&5 <<_ACEOF +This file contains any messages produced by compilers while +running configure, to aid debugging if configure makes a mistake. + +It was created by lbxproxy $as_me 1.0.1, which was +generated by GNU Autoconf 2.59. Invocation command line was + + $ $0 $@ + +_ACEOF +{ +cat <<_ASUNAME +## --------- ## +## Platform. ## +## --------- ## + +hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` +uname -m = `(uname -m) 2>/dev/null || echo unknown` +uname -r = `(uname -r) 2>/dev/null || echo unknown` +uname -s = `(uname -s) 2>/dev/null || echo unknown` +uname -v = `(uname -v) 2>/dev/null || echo unknown` + +/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` +/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` + +/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` +/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` +/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` +hostinfo = `(hostinfo) 2>/dev/null || echo unknown` +/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` +/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` +/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` + +_ASUNAME + +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + echo "PATH: $as_dir" +done + +} >&5 + +cat >&5 <<_ACEOF + + +## ----------- ## +## Core tests. ## +## ----------- ## + +_ACEOF + + +# Keep a trace of the command line. +# Strip out --no-create and --no-recursion so they do not pile up. +# Strip out --silent because we don't want to record it for future runs. +# Also quote any args containing shell meta-characters. +# Make two passes to allow for proper duplicate-argument suppression. +ac_configure_args= +ac_configure_args0= +ac_configure_args1= +ac_sep= +ac_must_keep_next=false +for ac_pass in 1 2 +do + for ac_arg + do + case $ac_arg in + -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + continue ;; + *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*) + ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + case $ac_pass in + 1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;; + 2) + ac_configure_args1="$ac_configure_args1 '$ac_arg'" + if test $ac_must_keep_next = true; then + ac_must_keep_next=false # Got value, back to normal. + else + case $ac_arg in + *=* | --config-cache | -C | -disable-* | --disable-* \ + | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ + | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ + | -with-* | --with-* | -without-* | --without-* | --x) + case "$ac_configure_args0 " in + "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; + esac + ;; + -* ) ac_must_keep_next=true ;; + esac + fi + ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'" + # Get rid of the leading space. + ac_sep=" " + ;; + esac + done +done +$as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; } +$as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export ac_configure_args1; } + +# When interrupted or exit'd, cleanup temporary files, and complete +# config.log. We remove comments because anyway the quotes in there +# would cause problems or look ugly. +# WARNING: Be sure not to use single quotes in there, as some shells, +# such as our DU 5.0 friend, will then `close' the trap. +trap 'exit_status=$? + # Save into config.log some information that might help in debugging. + { + echo + + cat <<\_ASBOX +## ---------------- ## +## Cache variables. ## +## ---------------- ## +_ASBOX + echo + # The following way of writing the cache mishandles newlines in values, +{ + (set) 2>&1 | + case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in + *ac_space=\ *) + sed -n \ + "s/'"'"'/'"'"'\\\\'"'"''"'"'/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p" + ;; + *) + sed -n \ + "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" + ;; + esac; +} + echo + + cat <<\_ASBOX +## ----------------- ## +## Output variables. ## +## ----------------- ## +_ASBOX + echo + for ac_var in $ac_subst_vars + do + eval ac_val=$`echo $ac_var` + echo "$ac_var='"'"'$ac_val'"'"'" + done | sort + echo + + if test -n "$ac_subst_files"; then + cat <<\_ASBOX +## ------------- ## +## Output files. ## +## ------------- ## +_ASBOX + echo + for ac_var in $ac_subst_files + do + eval ac_val=$`echo $ac_var` + echo "$ac_var='"'"'$ac_val'"'"'" + done | sort + echo + fi + + if test -s confdefs.h; then + cat <<\_ASBOX +## ----------- ## +## confdefs.h. ## +## ----------- ## +_ASBOX + echo + sed "/^$/d" confdefs.h | sort + echo + fi + test "$ac_signal" != 0 && + echo "$as_me: caught signal $ac_signal" + echo "$as_me: exit $exit_status" + } >&5 + rm -f core *.core && + rm -rf conftest* confdefs* conf$$* $ac_clean_files && + exit $exit_status + ' 0 +for ac_signal in 1 2 13 15; do + trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal +done +ac_signal=0 + +# confdefs.h avoids OS command line length limits that DEFS can exceed. +rm -rf conftest* confdefs.h +# AIX cpp loses on an empty file, so make sure it contains at least a newline. +echo >confdefs.h + +# Predefined preprocessor variables. + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_NAME "$PACKAGE_NAME" +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_TARNAME "$PACKAGE_TARNAME" +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_VERSION "$PACKAGE_VERSION" +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_STRING "$PACKAGE_STRING" +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" +_ACEOF + + +# Let the site file select an alternate cache file if it wants to. +# Prefer explicitly selected file to automatically selected ones. +if test -z "$CONFIG_SITE"; then + if test "x$prefix" != xNONE; then + CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" + else + CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" + fi +fi +for ac_site_file in $CONFIG_SITE; do + if test -r "$ac_site_file"; then + { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5 +echo "$as_me: loading site script $ac_site_file" >&6;} + sed 's/^/| /' "$ac_site_file" >&5 + . "$ac_site_file" + fi +done + +if test -r "$cache_file"; then + # Some versions of bash will fail to source /dev/null (special + # files actually), so we avoid doing that. + if test -f "$cache_file"; then + { echo "$as_me:$LINENO: loading cache $cache_file" >&5 +echo "$as_me: loading cache $cache_file" >&6;} + case $cache_file in + [\\/]* | ?:[\\/]* ) . $cache_file;; + *) . ./$cache_file;; + esac + fi +else + { echo "$as_me:$LINENO: creating cache $cache_file" >&5 +echo "$as_me: creating cache $cache_file" >&6;} + >$cache_file +fi + +# Check that the precious variables saved in the cache have kept the same +# value. +ac_cache_corrupted=false +for ac_var in `(set) 2>&1 | + sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do + eval ac_old_set=\$ac_cv_env_${ac_var}_set + eval ac_new_set=\$ac_env_${ac_var}_set + eval ac_old_val="\$ac_cv_env_${ac_var}_value" + eval ac_new_val="\$ac_env_${ac_var}_value" + case $ac_old_set,$ac_new_set in + set,) + { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 +echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,set) + { echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5 +echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,);; + *) + if test "x$ac_old_val" != "x$ac_new_val"; then + { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5 +echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} + { echo "$as_me:$LINENO: former value: $ac_old_val" >&5 +echo "$as_me: former value: $ac_old_val" >&2;} + { echo "$as_me:$LINENO: current value: $ac_new_val" >&5 +echo "$as_me: current value: $ac_new_val" >&2;} + ac_cache_corrupted=: + fi;; + esac + # Pass precious variables to config.status. + if test "$ac_new_set" = set; then + case $ac_new_val in + *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*) + ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; + *) ac_arg=$ac_var=$ac_new_val ;; + esac + case " $ac_configure_args " in + *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. + *) ac_configure_args="$ac_configure_args '$ac_arg'" ;; + esac + fi +done +if $ac_cache_corrupted; then + { echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5 +echo "$as_me: error: changes in the environment can compromise the build" >&2;} + { { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5 +echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;} + { (exit 1); exit 1; }; } +fi + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + + + + + + + + + + + + + + + + + + + + + + + + + + +am__api_version="1.7" +ac_aux_dir= +for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do + if test -f $ac_dir/install-sh; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install-sh -c" + break + elif test -f $ac_dir/install.sh; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install.sh -c" + break + elif test -f $ac_dir/shtool; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/shtool install -c" + break + fi +done +if test -z "$ac_aux_dir"; then + { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&5 +echo "$as_me: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&2;} + { (exit 1); exit 1; }; } +fi +ac_config_guess="$SHELL $ac_aux_dir/config.guess" +ac_config_sub="$SHELL $ac_aux_dir/config.sub" +ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure. + +# Find a good install program. We prefer a C program (faster), +# so one script is as good as another. But avoid the broken or +# incompatible versions: +# SysV /etc/install, /usr/sbin/install +# SunOS /usr/etc/install +# IRIX /sbin/install +# AIX /bin/install +# AmigaOS /C/install, which installs bootblocks on floppy discs +# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag +# AFS /usr/afsws/bin/install, which mishandles nonexistent args +# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" +# OS/2's system install, which has a completely different semantic +# ./install, which can be erroneously created by make from ./install.sh. +echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5 +echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6 +if test -z "$INSTALL"; then +if test "${ac_cv_path_install+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + # Account for people who put trailing slashes in PATH elements. +case $as_dir/ in + ./ | .// | /cC/* | \ + /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ + ?:\\/os2\\/install\\/* | ?:\\/OS2\\/INSTALL\\/* | \ + /usr/ucb/* ) ;; + *) + # OSF1 and SCO ODT 3.0 have their own names for install. + # Don't use installbsd from OSF since it installs stuff as root + # by default. + for ac_prog in ginstall scoinst install; do + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then + if test $ac_prog = install && + grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + # AIX install. It has an incompatible calling convention. + : + elif test $ac_prog = install && + grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + # program-specific install script used by HP pwplus--don't use. + : + else + ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" + break 3 + fi + fi + done + done + ;; +esac +done + + +fi + if test "${ac_cv_path_install+set}" = set; then + INSTALL=$ac_cv_path_install + else + # As a last resort, use the slow shell script. We don't cache a + # path for INSTALL within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the path is relative. + INSTALL=$ac_install_sh + fi +fi +echo "$as_me:$LINENO: result: $INSTALL" >&5 +echo "${ECHO_T}$INSTALL" >&6 + +# Use test -z because SunOS4 sh mishandles braces in ${var-val}. +# It thinks the first close brace ends the variable substitution. +test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' + +test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' + +test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' + +echo "$as_me:$LINENO: checking whether build environment is sane" >&5 +echo $ECHO_N "checking whether build environment is sane... $ECHO_C" >&6 +# Just in case +sleep 1 +echo timestamp > conftest.file +# Do `set' in a subshell so we don't clobber the current shell's +# arguments. Must try -L first in case configure is actually a +# symlink; some systems play weird games with the mod time of symlinks +# (eg FreeBSD returns the mod time of the symlink's containing +# directory). +if ( + set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null` + if test "$*" = "X"; then + # -L didn't work. + set X `ls -t $srcdir/configure conftest.file` + fi + rm -f conftest.file + if test "$*" != "X $srcdir/configure conftest.file" \ + && test "$*" != "X conftest.file $srcdir/configure"; then + + # If neither matched, then we have a broken ls. This can happen + # if, for instance, CONFIG_SHELL is bash and it inherits a + # broken ls alias from the environment. This has actually + # happened. Such a system could not be considered "sane". + { { echo "$as_me:$LINENO: error: ls -t appears to fail. Make sure there is not a broken +alias in your environment" >&5 +echo "$as_me: error: ls -t appears to fail. Make sure there is not a broken +alias in your environment" >&2;} + { (exit 1); exit 1; }; } + fi + + test "$2" = conftest.file + ) +then + # Ok. + : +else + { { echo "$as_me:$LINENO: error: newly created file is older than distributed files! +Check your system clock" >&5 +echo "$as_me: error: newly created file is older than distributed files! +Check your system clock" >&2;} + { (exit 1); exit 1; }; } +fi +echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 +test "$program_prefix" != NONE && + program_transform_name="s,^,$program_prefix,;$program_transform_name" +# Use a double $ so make ignores it. +test "$program_suffix" != NONE && + program_transform_name="s,\$,$program_suffix,;$program_transform_name" +# Double any \ or $. echo might interpret backslashes. +# By default was `s,x,x', remove it if useless. +cat <<\_ACEOF >conftest.sed +s/[\\$]/&&/g;s/;s,x,x,$// +_ACEOF +program_transform_name=`echo $program_transform_name | sed -f conftest.sed` +rm conftest.sed + + +# expand $ac_aux_dir to an absolute path +am_aux_dir=`cd $ac_aux_dir && pwd` + +test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing" +# Use eval to expand $SHELL +if eval "$MISSING --run true"; then + am_missing_run="$MISSING --run " +else + am_missing_run= + { echo "$as_me:$LINENO: WARNING: \`missing' script is too old or missing" >&5 +echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;} +fi + +for ac_prog in gawk mawk nawk awk +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_AWK+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$AWK"; then + ac_cv_prog_AWK="$AWK" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_AWK="$ac_prog" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +AWK=$ac_cv_prog_AWK +if test -n "$AWK"; then + echo "$as_me:$LINENO: result: $AWK" >&5 +echo "${ECHO_T}$AWK" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + test -n "$AWK" && break +done + +echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5 +echo $ECHO_N "checking whether ${MAKE-make} sets \$(MAKE)... $ECHO_C" >&6 +set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,:./+-,___p_,'` +if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.make <<\_ACEOF +all: + @echo 'ac_maketemp="$(MAKE)"' +_ACEOF +# GNU make sometimes prints "make[1]: Entering...", which would confuse us. +eval `${MAKE-make} -f conftest.make 2>/dev/null | grep temp=` +if test -n "$ac_maketemp"; then + eval ac_cv_prog_make_${ac_make}_set=yes +else + eval ac_cv_prog_make_${ac_make}_set=no +fi +rm -f conftest.make +fi +if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 + SET_MAKE= +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 + SET_MAKE="MAKE=${MAKE-make}" +fi + +rm -rf .tst 2>/dev/null +mkdir .tst 2>/dev/null +if test -d .tst; then + am__leading_dot=. +else + am__leading_dot=_ +fi +rmdir .tst 2>/dev/null + + # test to see if srcdir already configured +if test "`cd $srcdir && pwd`" != "`pwd`" && + test -f $srcdir/config.status; then + { { echo "$as_me:$LINENO: error: source directory already configured; run \"make distclean\" there first" >&5 +echo "$as_me: error: source directory already configured; run \"make distclean\" there first" >&2;} + { (exit 1); exit 1; }; } +fi + +# test whether we have cygpath +if test -z "$CYGPATH_W"; then + if (cygpath --version) >/dev/null 2>/dev/null; then + CYGPATH_W='cygpath -w' + else + CYGPATH_W=echo + fi +fi + + +# Define the identity of the package. + PACKAGE='lbxproxy' + VERSION='1.0.1' + + +cat >>confdefs.h <<_ACEOF +#define PACKAGE "$PACKAGE" +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define VERSION "$VERSION" +_ACEOF + +# Some tools Automake needs. + +ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"} + + +AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"} + + +AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"} + + +AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"} + + +MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} + + +AMTAR=${AMTAR-"${am_missing_run}tar"} + +install_sh=${install_sh-"$am_aux_dir/install-sh"} + +# Installed binaries are usually stripped using `strip' when the user +# run `make install-strip'. However `strip' might not be the right +# tool to use in cross-compilation environments, therefore Automake +# will honor the `STRIP' environment variable to overrule this program. +if test "$cross_compiling" != no; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. +set dummy ${ac_tool_prefix}strip; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_STRIP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$STRIP"; then + ac_cv_prog_STRIP="$STRIP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_STRIP="${ac_tool_prefix}strip" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +STRIP=$ac_cv_prog_STRIP +if test -n "$STRIP"; then + echo "$as_me:$LINENO: result: $STRIP" >&5 +echo "${ECHO_T}$STRIP" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + +fi +if test -z "$ac_cv_prog_STRIP"; then + ac_ct_STRIP=$STRIP + # Extract the first word of "strip", so it can be a program name with args. +set dummy strip; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_STRIP"; then + ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_STRIP="strip" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + + test -z "$ac_cv_prog_ac_ct_STRIP" && ac_cv_prog_ac_ct_STRIP=":" +fi +fi +ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP +if test -n "$ac_ct_STRIP"; then + echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5 +echo "${ECHO_T}$ac_ct_STRIP" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + STRIP=$ac_ct_STRIP +else + STRIP="$ac_cv_prog_STRIP" +fi + +fi +INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s" + +# We need awk for the "check" target. The system "awk" is bad on +# some platforms. + + + +echo "$as_me:$LINENO: checking whether to enable maintainer-specific portions of Makefiles" >&5 +echo $ECHO_N "checking whether to enable maintainer-specific portions of Makefiles... $ECHO_C" >&6 + # Check whether --enable-maintainer-mode or --disable-maintainer-mode was given. +if test "${enable_maintainer_mode+set}" = set; then + enableval="$enable_maintainer_mode" + USE_MAINTAINER_MODE=$enableval +else + USE_MAINTAINER_MODE=no +fi; + echo "$as_me:$LINENO: result: $USE_MAINTAINER_MODE" >&5 +echo "${ECHO_T}$USE_MAINTAINER_MODE" >&6 + + +if test $USE_MAINTAINER_MODE = yes; then + MAINTAINER_MODE_TRUE= + MAINTAINER_MODE_FALSE='#' +else + MAINTAINER_MODE_TRUE='#' + MAINTAINER_MODE_FALSE= +fi + + MAINT=$MAINTAINER_MODE_TRUE + + + + ac_config_headers="$ac_config_headers config.h" + + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. +set dummy ${ac_tool_prefix}gcc; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="${ac_tool_prefix}gcc" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + +fi +if test -z "$ac_cv_prog_CC"; then + ac_ct_CC=$CC + # Extract the first word of "gcc", so it can be a program name with args. +set dummy gcc; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_ac_ct_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CC="gcc" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 +echo "${ECHO_T}$ac_ct_CC" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + CC=$ac_ct_CC +else + CC="$ac_cv_prog_CC" +fi + +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. +set dummy ${ac_tool_prefix}cc; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="${ac_tool_prefix}cc" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + +fi +if test -z "$ac_cv_prog_CC"; then + ac_ct_CC=$CC + # Extract the first word of "cc", so it can be a program name with args. +set dummy cc; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_ac_ct_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CC="cc" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 +echo "${ECHO_T}$ac_ct_CC" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + CC=$ac_ct_CC +else + CC="$ac_cv_prog_CC" +fi + +fi +if test -z "$CC"; then + # Extract the first word of "cc", so it can be a program name with args. +set dummy cc; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + ac_prog_rejected=no +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then + ac_prog_rejected=yes + continue + fi + ac_cv_prog_CC="cc" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +if test $ac_prog_rejected = yes; then + # We found a bogon in the path, so make sure we never use it. + set dummy $ac_cv_prog_CC + shift + if test $# != 0; then + # We chose a different compiler from the bogus one. + # However, it has the same basename, so the bogon will be chosen + # first if we set CC to just the basename; use the full file name. + shift + ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" + fi +fi +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + +fi +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + for ac_prog in cl + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="$ac_tool_prefix$ac_prog" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + test -n "$CC" && break + done +fi +if test -z "$CC"; then + ac_ct_CC=$CC + for ac_prog in cl +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_ac_ct_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CC="$ac_prog" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 +echo "${ECHO_T}$ac_ct_CC" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + test -n "$ac_ct_CC" && break +done + + CC=$ac_ct_CC +fi + +fi + + +test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH +See \`config.log' for more details." >&5 +echo "$as_me: error: no acceptable C compiler found in \$PATH +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } + +# Provide some information about the compiler. +echo "$as_me:$LINENO:" \ + "checking for C compiler version" >&5 +ac_compiler=`set X $ac_compile; echo $2` +{ (eval echo "$as_me:$LINENO: \"$ac_compiler --version &5\"") >&5 + (eval $ac_compiler --version &5) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } +{ (eval echo "$as_me:$LINENO: \"$ac_compiler -v &5\"") >&5 + (eval $ac_compiler -v &5) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } +{ (eval echo "$as_me:$LINENO: \"$ac_compiler -V &5\"") >&5 + (eval $ac_compiler -V &5) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } + +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +ac_clean_files_save=$ac_clean_files +ac_clean_files="$ac_clean_files a.out a.exe b.out" +# Try to create an executable without -o first, disregard a.out. +# It will help us diagnose broken compilers, and finding out an intuition +# of exeext. +echo "$as_me:$LINENO: checking for C compiler default output file name" >&5 +echo $ECHO_N "checking for C compiler default output file name... $ECHO_C" >&6 +ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` +if { (eval echo "$as_me:$LINENO: \"$ac_link_default\"") >&5 + (eval $ac_link_default) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + # Find the output, starting from the most likely. This scheme is +# not robust to junk in `.', hence go to wildcards (a.*) only as a last +# resort. + +# Be careful to initialize this variable, since it used to be cached. +# Otherwise an old cache value of `no' led to `EXEEXT = no' in a Makefile. +ac_cv_exeext= +# b.out is created by i960 compilers. +for ac_file in a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out +do + test -f "$ac_file" || continue + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) + ;; + conftest.$ac_ext ) + # This is the source file. + ;; + [ab].out ) + # We found the default executable, but exeext='' is most + # certainly right. + break;; + *.* ) + ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + # FIXME: I believe we export ac_cv_exeext for Libtool, + # but it would be cool to find out if it's true. Does anybody + # maintain Libtool? --akim. + export ac_cv_exeext + break;; + * ) + break;; + esac +done +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +{ { echo "$as_me:$LINENO: error: C compiler cannot create executables +See \`config.log' for more details." >&5 +echo "$as_me: error: C compiler cannot create executables +See \`config.log' for more details." >&2;} + { (exit 77); exit 77; }; } +fi + +ac_exeext=$ac_cv_exeext +echo "$as_me:$LINENO: result: $ac_file" >&5 +echo "${ECHO_T}$ac_file" >&6 + +# Check the compiler produces executables we can run. If not, either +# the compiler is broken, or we cross compile. +echo "$as_me:$LINENO: checking whether the C compiler works" >&5 +echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6 +# FIXME: These cross compiler hacks should be removed for Autoconf 3.0 +# If not cross compiling, check that we can run a simple program. +if test "$cross_compiling" != yes; then + if { ac_try='./$ac_file' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + cross_compiling=no + else + if test "$cross_compiling" = maybe; then + cross_compiling=yes + else + { { echo "$as_me:$LINENO: error: cannot run C compiled programs. +If you meant to cross compile, use \`--host'. +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot run C compiled programs. +If you meant to cross compile, use \`--host'. +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } + fi + fi +fi +echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 + +rm -f a.out a.exe conftest$ac_cv_exeext b.out +ac_clean_files=$ac_clean_files_save +# Check the compiler produces executables we can run. If not, either +# the compiler is broken, or we cross compile. +echo "$as_me:$LINENO: checking whether we are cross compiling" >&5 +echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6 +echo "$as_me:$LINENO: result: $cross_compiling" >&5 +echo "${ECHO_T}$cross_compiling" >&6 + +echo "$as_me:$LINENO: checking for suffix of executables" >&5 +echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6 +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + # If both `conftest.exe' and `conftest' are `present' (well, observable) +# catch `conftest.exe'. For instance with Cygwin, `ls conftest' will +# work properly (i.e., refer to `conftest.exe'), while it won't with +# `rm'. +for ac_file in conftest.exe conftest conftest.*; do + test -f "$ac_file" || continue + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) ;; + *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + export ac_cv_exeext + break;; + * ) break;; + esac +done +else + { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot compute suffix of executables: cannot compile and link +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } +fi + +rm -f conftest$ac_cv_exeext +echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5 +echo "${ECHO_T}$ac_cv_exeext" >&6 + +rm -f conftest.$ac_ext +EXEEXT=$ac_cv_exeext +ac_exeext=$EXEEXT +echo "$as_me:$LINENO: checking for suffix of object files" >&5 +echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6 +if test "${ac_cv_objext+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.o conftest.obj +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg ) ;; + *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` + break;; + esac +done +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +{ { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot compute suffix of object files: cannot compile +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } +fi + +rm -f conftest.$ac_cv_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_objext" >&5 +echo "${ECHO_T}$ac_cv_objext" >&6 +OBJEXT=$ac_cv_objext +ac_objext=$OBJEXT +echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 +echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6 +if test "${ac_cv_c_compiler_gnu+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ +#ifndef __GNUC__ + choke me +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_compiler_gnu=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_compiler_gnu=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +ac_cv_c_compiler_gnu=$ac_compiler_gnu + +fi +echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 +echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6 +GCC=`test $ac_compiler_gnu = yes && echo yes` +ac_test_CFLAGS=${CFLAGS+set} +ac_save_CFLAGS=$CFLAGS +CFLAGS="-g" +echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 +echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6 +if test "${ac_cv_prog_cc_g+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_prog_cc_g=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_prog_cc_g=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 +echo "${ECHO_T}$ac_cv_prog_cc_g" >&6 +if test "$ac_test_CFLAGS" = set; then + CFLAGS=$ac_save_CFLAGS +elif test $ac_cv_prog_cc_g = yes; then + if test "$GCC" = yes; then + CFLAGS="-g -O2" + else + CFLAGS="-g" + fi +else + if test "$GCC" = yes; then + CFLAGS="-O2" + else + CFLAGS= + fi +fi +echo "$as_me:$LINENO: checking for $CC option to accept ANSI C" >&5 +echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6 +if test "${ac_cv_prog_cc_stdc+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_prog_cc_stdc=no +ac_save_CC=$CC +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +#include +#include +#include +/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ +struct buf { int x; }; +FILE * (*rcsopen) (struct buf *, struct stat *, int); +static char *e (p, i) + char **p; + int i; +{ + return p[i]; +} +static char *f (char * (*g) (char **, int), char **p, ...) +{ + char *s; + va_list v; + va_start (v,p); + s = g (p, va_arg (v,int)); + va_end (v); + return s; +} + +/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has + function prototypes and stuff, but not '\xHH' hex character constants. + These don't provoke an error unfortunately, instead are silently treated + as 'x'. The following induces an error, until -std1 is added to get + proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an + array size at least. It's necessary to write '\x00'==0 to get something + that's true only with -std1. */ +int osf4_cc_array ['\x00' == 0 ? 1 : -1]; + +int test (int i, double x); +struct s1 {int (*f) (int a);}; +struct s2 {int (*f) (double a);}; +int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); +int argc; +char **argv; +int +main () +{ +return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; + ; + return 0; +} +_ACEOF +# Don't try gcc -ansi; that turns off useful extensions and +# breaks some systems' header files. +# AIX -qlanglvl=ansi +# Ultrix and OSF/1 -std1 +# HP-UX 10.20 and later -Ae +# HP-UX older versions -Aa -D_HPUX_SOURCE +# SVR4 -Xc -D__EXTENSIONS__ +for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" +do + CC="$ac_save_CC $ac_arg" + rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_prog_cc_stdc=$ac_arg +break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.err conftest.$ac_objext +done +rm -f conftest.$ac_ext conftest.$ac_objext +CC=$ac_save_CC + +fi + +case "x$ac_cv_prog_cc_stdc" in + x|xno) + echo "$as_me:$LINENO: result: none needed" >&5 +echo "${ECHO_T}none needed" >&6 ;; + *) + echo "$as_me:$LINENO: result: $ac_cv_prog_cc_stdc" >&5 +echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6 + CC="$CC $ac_cv_prog_cc_stdc" ;; +esac + +# Some people use a C++ compiler to compile C. Since we use `exit', +# in C++ we need to declare it. In case someone uses the same compiler +# for both compiling C and C++ we need to have the C++ compiler decide +# the declaration of exit, since it's the most demanding environment. +cat >conftest.$ac_ext <<_ACEOF +#ifndef __cplusplus + choke me +#endif +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + for ac_declaration in \ + '' \ + 'extern "C" void std::exit (int) throw (); using std::exit;' \ + 'extern "C" void std::exit (int); using std::exit;' \ + 'extern "C" void exit (int) throw ();' \ + 'extern "C" void exit (int);' \ + 'void exit (int);' +do + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_declaration +#include +int +main () +{ +exit (42); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + : +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +continue +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_declaration +int +main () +{ +exit (42); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +done +rm -f conftest* +if test -n "$ac_declaration"; then + echo '#ifdef __cplusplus' >>confdefs.h + echo $ac_declaration >>confdefs.h + echo '#endif' >>confdefs.h +fi + +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +DEPDIR="${am__leading_dot}deps" + + ac_config_commands="$ac_config_commands depfiles" + + +am_make=${MAKE-make} +cat > confinc << 'END' +am__doit: + @echo done +.PHONY: am__doit +END +# If we don't find an include directive, just comment out the code. +echo "$as_me:$LINENO: checking for style of include used by $am_make" >&5 +echo $ECHO_N "checking for style of include used by $am_make... $ECHO_C" >&6 +am__include="#" +am__quote= +_am_result=none +# First try GNU make style include. +echo "include confinc" > confmf +# We grep out `Entering directory' and `Leaving directory' +# messages which can occur if `w' ends up in MAKEFLAGS. +# In particular we don't look at `^make:' because GNU make might +# be invoked under some other name (usually "gmake"), in which +# case it prints its new name instead of `make'. +if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then + am__include=include + am__quote= + _am_result=GNU +fi +# Now try BSD make style include. +if test "$am__include" = "#"; then + echo '.include "confinc"' > confmf + if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then + am__include=.include + am__quote="\"" + _am_result=BSD + fi +fi + + +echo "$as_me:$LINENO: result: $_am_result" >&5 +echo "${ECHO_T}$_am_result" >&6 +rm -f confinc confmf + +# Check whether --enable-dependency-tracking or --disable-dependency-tracking was given. +if test "${enable_dependency_tracking+set}" = set; then + enableval="$enable_dependency_tracking" + +fi; +if test "x$enable_dependency_tracking" != xno; then + am_depcomp="$ac_aux_dir/depcomp" + AMDEPBACKSLASH='\' +fi + + +if test "x$enable_dependency_tracking" != xno; then + AMDEP_TRUE= + AMDEP_FALSE='#' +else + AMDEP_TRUE='#' + AMDEP_FALSE= +fi + + + + +depcc="$CC" am_compiler_list= + +echo "$as_me:$LINENO: checking dependency style of $depcc" >&5 +echo $ECHO_N "checking dependency style of $depcc... $ECHO_C" >&6 +if test "${am_cv_CC_dependencies_compiler_type+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then + # We make a subdir and do the tests there. Otherwise we can end up + # making bogus files that we don't know about and never remove. For + # instance it was reported that on HP-UX the gcc test will end up + # making a dummy file named `D' -- because `-MD' means `put the output + # in D'. + mkdir conftest.dir + # Copy depcomp to subdir because otherwise we won't find it if we're + # using a relative directory. + cp "$am_depcomp" conftest.dir + cd conftest.dir + # We will build objects and dependencies in a subdirectory because + # it helps to detect inapplicable dependency modes. For instance + # both Tru64's cc and ICC support -MD to output dependencies as a + # side effect of compilation, but ICC will put the dependencies in + # the current directory while Tru64 will put them in the object + # directory. + mkdir sub + + am_cv_CC_dependencies_compiler_type=none + if test "$am_compiler_list" = ""; then + am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` + fi + for depmode in $am_compiler_list; do + # Setup a source with many dependencies, because some compilers + # like to wrap large dependency lists on column 80 (with \), and + # we should not choose a depcomp mode which is confused by this. + # + # We need to recreate these files for each test, as the compiler may + # overwrite some of them when testing with obscure command lines. + # This happens at least with the AIX C compiler. + : > sub/conftest.c + for i in 1 2 3 4 5 6; do + echo '#include "conftst'$i'.h"' >> sub/conftest.c + : > sub/conftst$i.h + done + echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf + + case $depmode in + nosideeffect) + # after this tag, mechanisms are not by side-effect, so they'll + # only be used when explicitly requested + if test "x$enable_dependency_tracking" = xyes; then + continue + else + break + fi + ;; + none) break ;; + esac + # We check with `-c' and `-o' for the sake of the "dashmstdout" + # mode. It turns out that the SunPro C++ compiler does not properly + # handle `-M -o', and we need to detect this. + if depmode=$depmode \ + source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \ + depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ + $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \ + >/dev/null 2>conftest.err && + grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && + grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 && + ${MAKE-make} -s -f confmf > /dev/null 2>&1; then + # icc doesn't choke on unknown options, it will just issue warnings + # (even with -Werror). So we grep stderr for any message + # that says an option was ignored. + if grep 'ignoring option' conftest.err >/dev/null 2>&1; then :; else + am_cv_CC_dependencies_compiler_type=$depmode + break + fi + fi + done + + cd .. + rm -rf conftest.dir +else + am_cv_CC_dependencies_compiler_type=none +fi + +fi +echo "$as_me:$LINENO: result: $am_cv_CC_dependencies_compiler_type" >&5 +echo "${ECHO_T}$am_cv_CC_dependencies_compiler_type" >&6 +CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type + + + +if + test "x$enable_dependency_tracking" != xno \ + && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then + am__fastdepCC_TRUE= + am__fastdepCC_FALSE='#' +else + am__fastdepCC_TRUE='#' + am__fastdepCC_FALSE= +fi + + +# Find a good install program. We prefer a C program (faster), +# so one script is as good as another. But avoid the broken or +# incompatible versions: +# SysV /etc/install, /usr/sbin/install +# SunOS /usr/etc/install +# IRIX /sbin/install +# AIX /bin/install +# AmigaOS /C/install, which installs bootblocks on floppy discs +# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag +# AFS /usr/afsws/bin/install, which mishandles nonexistent args +# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" +# OS/2's system install, which has a completely different semantic +# ./install, which can be erroneously created by make from ./install.sh. +echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5 +echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6 +if test -z "$INSTALL"; then +if test "${ac_cv_path_install+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + # Account for people who put trailing slashes in PATH elements. +case $as_dir/ in + ./ | .// | /cC/* | \ + /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ + ?:\\/os2\\/install\\/* | ?:\\/OS2\\/INSTALL\\/* | \ + /usr/ucb/* ) ;; + *) + # OSF1 and SCO ODT 3.0 have their own names for install. + # Don't use installbsd from OSF since it installs stuff as root + # by default. + for ac_prog in ginstall scoinst install; do + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then + if test $ac_prog = install && + grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + # AIX install. It has an incompatible calling convention. + : + elif test $ac_prog = install && + grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + # program-specific install script used by HP pwplus--don't use. + : + else + ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" + break 3 + fi + fi + done + done + ;; +esac +done + + +fi + if test "${ac_cv_path_install+set}" = set; then + INSTALL=$ac_cv_path_install + else + # As a last resort, use the slow shell script. We don't cache a + # path for INSTALL within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the path is relative. + INSTALL=$ac_install_sh + fi +fi +echo "$as_me:$LINENO: result: $INSTALL" >&5 +echo "${ECHO_T}$INSTALL" >&6 + +# Use test -z because SunOS4 sh mishandles braces in ${var-val}. +# It thinks the first close brace ends the variable substitution. +test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' + +test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' + +test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' + +# Make sure we can run config.sub. +$ac_config_sub sun4 >/dev/null 2>&1 || + { { echo "$as_me:$LINENO: error: cannot run $ac_config_sub" >&5 +echo "$as_me: error: cannot run $ac_config_sub" >&2;} + { (exit 1); exit 1; }; } + +echo "$as_me:$LINENO: checking build system type" >&5 +echo $ECHO_N "checking build system type... $ECHO_C" >&6 +if test "${ac_cv_build+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_build_alias=$build_alias +test -z "$ac_cv_build_alias" && + ac_cv_build_alias=`$ac_config_guess` +test -z "$ac_cv_build_alias" && + { { echo "$as_me:$LINENO: error: cannot guess build type; you must specify one" >&5 +echo "$as_me: error: cannot guess build type; you must specify one" >&2;} + { (exit 1); exit 1; }; } +ac_cv_build=`$ac_config_sub $ac_cv_build_alias` || + { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_build_alias failed" >&5 +echo "$as_me: error: $ac_config_sub $ac_cv_build_alias failed" >&2;} + { (exit 1); exit 1; }; } + +fi +echo "$as_me:$LINENO: result: $ac_cv_build" >&5 +echo "${ECHO_T}$ac_cv_build" >&6 +build=$ac_cv_build +build_cpu=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` +build_vendor=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` +build_os=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` + + +echo "$as_me:$LINENO: checking host system type" >&5 +echo $ECHO_N "checking host system type... $ECHO_C" >&6 +if test "${ac_cv_host+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_host_alias=$host_alias +test -z "$ac_cv_host_alias" && + ac_cv_host_alias=$ac_cv_build_alias +ac_cv_host=`$ac_config_sub $ac_cv_host_alias` || + { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_host_alias failed" >&5 +echo "$as_me: error: $ac_config_sub $ac_cv_host_alias failed" >&2;} + { (exit 1); exit 1; }; } + +fi +echo "$as_me:$LINENO: result: $ac_cv_host" >&5 +echo "${ECHO_T}$ac_cv_host" >&6 +host=$ac_cv_host +host_cpu=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` +host_vendor=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` +host_os=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` + + + +case $host_os in + linux*) + OS_CFLAGS="-D_XOPEN_SOURCE" + ;; + *) + OS_CFLAGS= + ;; +esac + +# Checks for pkg-config packages + + +if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args. +set dummy ${ac_tool_prefix}pkg-config; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_path_PKG_CONFIG+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + case $PKG_CONFIG in + [\\/]* | ?:[\\/]*) + ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + + ;; +esac +fi +PKG_CONFIG=$ac_cv_path_PKG_CONFIG + +if test -n "$PKG_CONFIG"; then + echo "$as_me:$LINENO: result: $PKG_CONFIG" >&5 +echo "${ECHO_T}$PKG_CONFIG" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + +fi +if test -z "$ac_cv_path_PKG_CONFIG"; then + ac_pt_PKG_CONFIG=$PKG_CONFIG + # Extract the first word of "pkg-config", so it can be a program name with args. +set dummy pkg-config; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_path_ac_pt_PKG_CONFIG+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + case $ac_pt_PKG_CONFIG in + [\\/]* | ?:[\\/]*) + ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_ac_pt_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + + ;; +esac +fi +ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG + +if test -n "$ac_pt_PKG_CONFIG"; then + echo "$as_me:$LINENO: result: $ac_pt_PKG_CONFIG" >&5 +echo "${ECHO_T}$ac_pt_PKG_CONFIG" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + PKG_CONFIG=$ac_pt_PKG_CONFIG +else + PKG_CONFIG="$ac_cv_path_PKG_CONFIG" +fi + +fi +if test -n "$PKG_CONFIG"; then + _pkg_min_version=0.9.0 + echo "$as_me:$LINENO: checking pkg-config is at least version $_pkg_min_version" >&5 +echo $ECHO_N "checking pkg-config is at least version $_pkg_min_version... $ECHO_C" >&6 + if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 + else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 + PKG_CONFIG="" + fi + +fi + +pkg_failed=no +echo "$as_me:$LINENO: checking for LBXPROXY" >&5 +echo $ECHO_N "checking for LBXPROXY... $ECHO_C" >&6 + +if test -n "$PKG_CONFIG"; then + if test -n "$LBXPROXY_CFLAGS"; then + pkg_cv_LBXPROXY_CFLAGS="$LBXPROXY_CFLAGS" + else + if test -n "$PKG_CONFIG" && \ + { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"xtrans xext lbxutil x11 ice xproxymngproto bigreqsproto\"") >&5 + ($PKG_CONFIG --exists --print-errors "xtrans xext lbxutil x11 ice xproxymngproto bigreqsproto") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + pkg_cv_LBXPROXY_CFLAGS=`$PKG_CONFIG --cflags "xtrans xext lbxutil x11 ice xproxymngproto bigreqsproto" 2>/dev/null` +else + pkg_failed=yes +fi + fi +else + pkg_failed=untried +fi +if test -n "$PKG_CONFIG"; then + if test -n "$LBXPROXY_LIBS"; then + pkg_cv_LBXPROXY_LIBS="$LBXPROXY_LIBS" + else + if test -n "$PKG_CONFIG" && \ + { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"xtrans xext lbxutil x11 ice xproxymngproto bigreqsproto\"") >&5 + ($PKG_CONFIG --exists --print-errors "xtrans xext lbxutil x11 ice xproxymngproto bigreqsproto") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + pkg_cv_LBXPROXY_LIBS=`$PKG_CONFIG --libs "xtrans xext lbxutil x11 ice xproxymngproto bigreqsproto" 2>/dev/null` +else + pkg_failed=yes +fi + fi +else + pkg_failed=untried +fi + + + +if test $pkg_failed = yes; then + +if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then + _pkg_short_errors_supported=yes +else + _pkg_short_errors_supported=no +fi + if test $_pkg_short_errors_supported = yes; then + LBXPROXY_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "xtrans xext lbxutil x11 ice xproxymngproto bigreqsproto"` + else + LBXPROXY_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "xtrans xext lbxutil x11 ice xproxymngproto bigreqsproto"` + fi + # Put the nasty error message in config.log where it belongs + echo "$LBXPROXY_PKG_ERRORS" >&5 + + { { echo "$as_me:$LINENO: error: Package requirements (xtrans xext lbxutil x11 ice xproxymngproto bigreqsproto) were not met: + +$LBXPROXY_PKG_ERRORS + +Consider adjusting the PKG_CONFIG_PATH environment variable if you +installed software in a non-standard prefix. + +Alternatively, you may set the environment variables LBXPROXY_CFLAGS +and LBXPROXY_LIBS to avoid the need to call pkg-config. +See the pkg-config man page for more details. +" >&5 +echo "$as_me: error: Package requirements (xtrans xext lbxutil x11 ice xproxymngproto bigreqsproto) were not met: + +$LBXPROXY_PKG_ERRORS + +Consider adjusting the PKG_CONFIG_PATH environment variable if you +installed software in a non-standard prefix. + +Alternatively, you may set the environment variables LBXPROXY_CFLAGS +and LBXPROXY_LIBS to avoid the need to call pkg-config. +See the pkg-config man page for more details. +" >&2;} + { (exit 1); exit 1; }; } +elif test $pkg_failed = untried; then + { { echo "$as_me:$LINENO: error: The pkg-config script could not be found or is too old. Make sure it +is in your PATH or set the PKG_CONFIG environment variable to the full +path to pkg-config. + +Alternatively, you may set the environment variables LBXPROXY_CFLAGS +and LBXPROXY_LIBS to avoid the need to call pkg-config. +See the pkg-config man page for more details. + +To get pkg-config, see . +See \`config.log' for more details." >&5 +echo "$as_me: error: The pkg-config script could not be found or is too old. Make sure it +is in your PATH or set the PKG_CONFIG environment variable to the full +path to pkg-config. + +Alternatively, you may set the environment variables LBXPROXY_CFLAGS +and LBXPROXY_LIBS to avoid the need to call pkg-config. +See the pkg-config man page for more details. + +To get pkg-config, see . +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } +else + LBXPROXY_CFLAGS=$pkg_cv_LBXPROXY_CFLAGS + LBXPROXY_LIBS=$pkg_cv_LBXPROXY_LIBS + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 + : +fi +LBXPROXY_CFLAGS="$LBXPROXY_CFLAGS $OS_CFLAGS" + + + +# Transport selection macro from xtrans.m4 + +echo "$as_me:$LINENO: checking return type of signal handlers" >&5 +echo $ECHO_N "checking return type of signal handlers... $ECHO_C" >&6 +if test "${ac_cv_type_signal+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +#include +#ifdef signal +# undef signal +#endif +#ifdef __cplusplus +extern "C" void (*signal (int, void (*)(int)))(int); +#else +void (*signal ()) (); +#endif + +int +main () +{ +int i; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_type_signal=void +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_type_signal=int +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_type_signal" >&5 +echo "${ECHO_T}$ac_cv_type_signal" >&6 + +cat >>confdefs.h <<_ACEOF +#define RETSIGTYPE $ac_cv_type_signal +_ACEOF + + + + # Check whether --enable-unix-transport or --disable-unix-transport was given. +if test "${enable_unix_transport+set}" = set; then + enableval="$enable_unix_transport" + UNIXCONN=$enableval +else + UNIXCONN=yes +fi; + # Check whether --enable-tcp-transport or --disable-tcp-transport was given. +if test "${enable_tcp_transport+set}" = set; then + enableval="$enable_tcp_transport" + TCPCONN=$enableval +else + TCPCONN=yes +fi; + echo "$as_me:$LINENO: checking if Xtrans should support UNIX socket connections" >&5 +echo $ECHO_N "checking if Xtrans should support UNIX socket connections... $ECHO_C" >&6 + if test "$UNIXCONN" = "yes"; then + +cat >>confdefs.h <<\_ACEOF +#define UNIXCONN 1 +_ACEOF + + fi + echo "$as_me:$LINENO: result: $UNIXCONN" >&5 +echo "${ECHO_T}$UNIXCONN" >&6 + echo "$as_me:$LINENO: checking if Xtrans should support TCP socket connections" >&5 +echo $ECHO_N "checking if Xtrans should support TCP socket connections... $ECHO_C" >&6 + echo "$as_me:$LINENO: result: $TCPCONN" >&5 +echo "${ECHO_T}$TCPCONN" >&6 + if test "$TCPCONN" = "yes"; then + +cat >>confdefs.h <<\_ACEOF +#define TCPCONN 1 +_ACEOF + + + # SVR4 hides these in libraries other than libc + echo "$as_me:$LINENO: checking for library containing socket" >&5 +echo $ECHO_N "checking for library containing socket... $ECHO_C" >&6 +if test "${ac_cv_search_socket+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_func_search_save_LIBS=$LIBS +ac_cv_search_socket=no +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char socket (); +int +main () +{ +socket (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_search_socket="none required" +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +if test "$ac_cv_search_socket" = no; then + for ac_lib in socket; do + LIBS="-l$ac_lib $ac_func_search_save_LIBS" + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char socket (); +int +main () +{ +socket (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_search_socket="-l$ac_lib" +break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + done +fi +LIBS=$ac_func_search_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_search_socket" >&5 +echo "${ECHO_T}$ac_cv_search_socket" >&6 +if test "$ac_cv_search_socket" != no; then + test "$ac_cv_search_socket" = "none required" || LIBS="$ac_cv_search_socket $LIBS" + +fi + + echo "$as_me:$LINENO: checking for library containing gethostbyname" >&5 +echo $ECHO_N "checking for library containing gethostbyname... $ECHO_C" >&6 +if test "${ac_cv_search_gethostbyname+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_func_search_save_LIBS=$LIBS +ac_cv_search_gethostbyname=no +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char gethostbyname (); +int +main () +{ +gethostbyname (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_search_gethostbyname="none required" +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +if test "$ac_cv_search_gethostbyname" = no; then + for ac_lib in nsl; do + LIBS="-l$ac_lib $ac_func_search_save_LIBS" + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char gethostbyname (); +int +main () +{ +gethostbyname (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_search_gethostbyname="-l$ac_lib" +break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + done +fi +LIBS=$ac_func_search_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_search_gethostbyname" >&5 +echo "${ECHO_T}$ac_cv_search_gethostbyname" >&6 +if test "$ac_cv_search_gethostbyname" != no; then + test "$ac_cv_search_gethostbyname" = "none required" || LIBS="$ac_cv_search_gethostbyname $LIBS" + +fi + + + # Needs to come after above checks for libsocket & libnsl for SVR4 systems + # Check whether --enable-ipv6 or --disable-ipv6 was given. +if test "${enable_ipv6+set}" = set; then + enableval="$enable_ipv6" + IPV6CONN=$enableval +else + echo "$as_me:$LINENO: checking for getaddrinfo" >&5 +echo $ECHO_N "checking for getaddrinfo... $ECHO_C" >&6 +if test "${ac_cv_func_getaddrinfo+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +/* Define getaddrinfo to an innocuous variant, in case declares getaddrinfo. + For example, HP-UX 11i declares gettimeofday. */ +#define getaddrinfo innocuous_getaddrinfo + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char getaddrinfo (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef getaddrinfo + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +{ +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char getaddrinfo (); +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_getaddrinfo) || defined (__stub___getaddrinfo) +choke me +#else +char (*f) () = getaddrinfo; +#endif +#ifdef __cplusplus +} +#endif + +int +main () +{ +return f != getaddrinfo; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_func_getaddrinfo=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_func_getaddrinfo=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_func_getaddrinfo" >&5 +echo "${ECHO_T}$ac_cv_func_getaddrinfo" >&6 +if test $ac_cv_func_getaddrinfo = yes; then + IPV6CONN=yes +else + IPV6CONN=no +fi + +fi; + echo "$as_me:$LINENO: checking if IPv6 support should be built" >&5 +echo $ECHO_N "checking if IPv6 support should be built... $ECHO_C" >&6 + if test "$IPV6CONN" = "yes"; then + +cat >>confdefs.h <<\_ACEOF +#define IPv6 1 +_ACEOF + + fi + echo "$as_me:$LINENO: result: $IPV6CONN" >&5 +echo "${ECHO_T}$IPV6CONN" >&6 + + # 4.3BSD-Reno added a new member to struct sockaddr_in + echo "$as_me:$LINENO: checking for struct sockaddr_in.sin_len" >&5 +echo $ECHO_N "checking for struct sockaddr_in.sin_len... $ECHO_C" >&6 +if test "${ac_cv_member_struct_sockaddr_in_sin_len+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +#include +#include +#include + + +int +main () +{ +static struct sockaddr_in ac_aggr; +if (ac_aggr.sin_len) +return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_member_struct_sockaddr_in_sin_len=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +#include +#include +#include + + +int +main () +{ +static struct sockaddr_in ac_aggr; +if (sizeof ac_aggr.sin_len) +return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_member_struct_sockaddr_in_sin_len=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_member_struct_sockaddr_in_sin_len=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_member_struct_sockaddr_in_sin_len" >&5 +echo "${ECHO_T}$ac_cv_member_struct_sockaddr_in_sin_len" >&6 +if test $ac_cv_member_struct_sockaddr_in_sin_len = yes; then + +cat >>confdefs.h <<\_ACEOF +#define BSD44SOCKETS 1 +_ACEOF + +fi + + + fi + + + +echo "$as_me:$LINENO: checking for deflate in -lz" >&5 +echo $ECHO_N "checking for deflate in -lz... $ECHO_C" >&6 +if test "${ac_cv_lib_z_deflate+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lz $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char deflate (); +int +main () +{ +deflate (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_z_deflate=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_z_deflate=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_lib_z_deflate" >&5 +echo "${ECHO_T}$ac_cv_lib_z_deflate" >&6 +if test $ac_cv_lib_z_deflate = yes; then + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBZ 1 +_ACEOF + + LIBS="-lz $LIBS" + +fi + + + + + +if test x$APP_MAN_SUFFIX = x ; then + case $host_os in + linux*) APP_MAN_SUFFIX=1x ;; + *) APP_MAN_SUFFIX=1 ;; + esac +fi +if test x$APP_MAN_DIR = x ; then + case $host_os in + linux*) APP_MAN_DIR='$(mandir)/man1' ;; + *) APP_MAN_DIR='$(mandir)/man$(APP_MAN_SUFFIX)' ;; + esac +fi + +if test x$LIB_MAN_SUFFIX = x ; then + case $host_os in + linux*) LIB_MAN_SUFFIX=3x ;; + *) LIB_MAN_SUFFIX=3 ;; + esac +fi +if test x$LIB_MAN_DIR = x ; then + case $host_os in + linux*) LIB_MAN_DIR='$(mandir)/man3' ;; + *) LIB_MAN_DIR='$(mandir)/man$(LIB_MAN_SUFFIX)' ;; + esac +fi + +if test x$FILE_MAN_SUFFIX = x ; then + case $host_os in + linux*) FILE_MAN_SUFFIX=5x ;; + solaris*) FILE_MAN_SUFFIX=4 ;; + *) FILE_MAN_SUFFIX=5 ;; + esac +fi +if test x$FILE_MAN_DIR = x ; then + case $host_os in + linux*) FILE_MAN_DIR='$(mandir)/man5' ;; + *) FILE_MAN_DIR='$(mandir)/man$(FILE_MAN_SUFFIX)' ;; + esac +fi + +# In Imake's linux.cf, the misc man suffix & dir was only changed for +# LinuxDebian, not other Linuxes, so we leave it unchanged here +if test x$MISC_MAN_SUFFIX = x ; then + case $host_os in +# linux*) MISC_MAN_SUFFIX=7x ;; + solaris*) MISC_MAN_SUFFIX=5 ;; + *) MISC_MAN_SUFFIX=7 ;; + esac +fi +if test x$MISC_MAN_DIR = x ; then + case $host_os in +# linux*) MISC_MAN_DIR='$(mandir)/man7' ;; + *) MISC_MAN_DIR='$(mandir)/man$(MISC_MAN_SUFFIX)' ;; + esac +fi + +# In Imake's linux.cf, the driver man suffix & dir was only changed for +# LinuxDebian, not other Linuxes, so we leave it unchanged here +if test x$DRIVER_MAN_SUFFIX = x ; then + case $host_os in +# linux*) DRIVER_MAN_SUFFIX=4x ;; + solaris*) DRIVER_MAN_SUFFIX=7 ;; + *) DRIVER_MAN_SUFFIX=4 ;; + esac +fi +if test x$DRIVER_MAN_DIR = x ; then + case $host_os in +# linux*) DRIVER_MAN_DIR='$(mandir)/man4' ;; + *) DRIVER_MAN_DIR='$(mandir)/man$(DRIVER_MAN_SUFFIX)' ;; + esac +fi + +if test x$ADMIN_MAN_SUFFIX = x ; then + case $host_os in + solaris*) ADMIN_MAN_SUFFIX=1m ;; + *) ADMIN_MAN_SUFFIX=8 ;; + esac +fi +if test x$ADMIN_MAN_DIR = x ; then + ADMIN_MAN_DIR='$(mandir)/man$(ADMIN_MAN_SUFFIX)' +fi + + + + + + + + + + + + + + + + + +# Check whether --with-release-version or --without-release-version was given. +if test "${with_release_version+set}" = set; then + withval="$with_release_version" + RELEASE_VERSION="$withval" +else + RELEASE_VERSION="" +fi; + if test "x$RELEASE_VERSION" != "x"; then + PACKAGE="$PACKAGE-$RELEASE_VERSION" + PACKAGE_TARNAME="$PACKAGE_TARNAME-$RELEASE_VERSION" + { echo "$as_me:$LINENO: Building with package name set to $PACKAGE" >&5 +echo "$as_me: Building with package name set to $PACKAGE" >&6;} + fi + + + ac_config_files="$ac_config_files Makefile" +cat >confcache <<\_ACEOF +# This file is a shell script that caches the results of configure +# tests run on this system so they can be shared between configure +# scripts and configure runs, see configure's option --config-cache. +# It is not useful on other systems. If it contains results you don't +# want to keep, you may remove or edit it. +# +# config.status only pays attention to the cache file if you give it +# the --recheck option to rerun configure. +# +# `ac_cv_env_foo' variables (set or unset) will be overridden when +# loading this file, other *unset* `ac_cv_foo' will be assigned the +# following values. + +_ACEOF + +# The following way of writing the cache mishandles newlines in values, +# but we know of no workaround that is simple, portable, and efficient. +# So, don't put newlines in cache variables' values. +# Ultrix sh set writes to stderr and can't be redirected directly, +# and sets the high bit in the cache file unless we assign to the vars. +{ + (set) 2>&1 | + case `(ac_space=' '; set | grep ac_space) 2>&1` in + *ac_space=\ *) + # `set' does not quote correctly, so add quotes (double-quote + # substitution turns \\\\ into \\, and sed turns \\ into \). + sed -n \ + "s/'/'\\\\''/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" + ;; + *) + # `set' quotes correctly as required by POSIX, so do not add quotes. + sed -n \ + "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" + ;; + esac; +} | + sed ' + t clear + : clear + s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ + t end + /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ + : end' >>confcache +if diff $cache_file confcache >/dev/null 2>&1; then :; else + if test -w $cache_file; then + test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file" + cat confcache >$cache_file + else + echo "not updating unwritable cache $cache_file" + fi +fi +rm -f confcache + +test "x$prefix" = xNONE && prefix=$ac_default_prefix +# Let make expand exec_prefix. +test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' + +# VPATH may cause trouble with some makes, so we remove $(srcdir), +# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and +# trailing colons and then remove the whole line if VPATH becomes empty +# (actually we leave an empty line to preserve line numbers). +if test "x$srcdir" = x.; then + ac_vpsub='/^[ ]*VPATH[ ]*=/{ +s/:*\$(srcdir):*/:/; +s/:*\${srcdir}:*/:/; +s/:*@srcdir@:*/:/; +s/^\([^=]*=[ ]*\):*/\1/; +s/:*$//; +s/^[^=]*=[ ]*$//; +}' +fi + +DEFS=-DHAVE_CONFIG_H + +ac_libobjs= +ac_ltlibobjs= +for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue + # 1. Remove the extension, and $U if already installed. + ac_i=`echo "$ac_i" | + sed 's/\$U\././;s/\.o$//;s/\.obj$//'` + # 2. Add them. + ac_libobjs="$ac_libobjs $ac_i\$U.$ac_objext" + ac_ltlibobjs="$ac_ltlibobjs $ac_i"'$U.lo' +done +LIBOBJS=$ac_libobjs + +LTLIBOBJS=$ac_ltlibobjs + + +if test -z "${MAINTAINER_MODE_TRUE}" && test -z "${MAINTAINER_MODE_FALSE}"; then + { { echo "$as_me:$LINENO: error: conditional \"MAINTAINER_MODE\" was never defined. +Usually this means the macro was only invoked conditionally." >&5 +echo "$as_me: error: conditional \"MAINTAINER_MODE\" was never defined. +Usually this means the macro was only invoked conditionally." >&2;} + { (exit 1); exit 1; }; } +fi +if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then + { { echo "$as_me:$LINENO: error: conditional \"AMDEP\" was never defined. +Usually this means the macro was only invoked conditionally." >&5 +echo "$as_me: error: conditional \"AMDEP\" was never defined. +Usually this means the macro was only invoked conditionally." >&2;} + { (exit 1); exit 1; }; } +fi +if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then + { { echo "$as_me:$LINENO: error: conditional \"am__fastdepCC\" was never defined. +Usually this means the macro was only invoked conditionally." >&5 +echo "$as_me: error: conditional \"am__fastdepCC\" was never defined. +Usually this means the macro was only invoked conditionally." >&2;} + { (exit 1); exit 1; }; } +fi + +: ${CONFIG_STATUS=./config.status} +ac_clean_files_save=$ac_clean_files +ac_clean_files="$ac_clean_files $CONFIG_STATUS" +{ echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5 +echo "$as_me: creating $CONFIG_STATUS" >&6;} +cat >$CONFIG_STATUS <<_ACEOF +#! $SHELL +# Generated by $as_me. +# Run this file to recreate the current configuration. +# Compiler output produced by configure, useful for debugging +# configure, is in config.log if it exists. + +debug=false +ac_cs_recheck=false +ac_cs_silent=false +SHELL=\${CONFIG_SHELL-$SHELL} +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF +## --------------------- ## +## M4sh Initialization. ## +## --------------------- ## + +# Be Bourne compatible +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then + emulate sh + NULLCMD=: + # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' +elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then + set -o posix +fi +DUALCASE=1; export DUALCASE # for MKS sh + +# Support unset when possible. +if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then + as_unset=unset +else + as_unset=false +fi + + +# Work around bugs in pre-3.0 UWIN ksh. +$as_unset ENV MAIL MAILPATH +PS1='$ ' +PS2='> ' +PS4='+ ' + +# NLS nuisances. +for as_var in \ + LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ + LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ + LC_TELEPHONE LC_TIME +do + if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then + eval $as_var=C; export $as_var + else + $as_unset $as_var + fi +done + +# Required to use basename. +if expr a : '\(a\)' >/dev/null 2>&1; then + as_expr=expr +else + as_expr=false +fi + +if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then + as_basename=basename +else + as_basename=false +fi + + +# Name of the executable. +as_me=`$as_basename "$0" || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)$' \| \ + . : '\(.\)' 2>/dev/null || +echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; } + /^X\/\(\/\/\)$/{ s//\1/; q; } + /^X\/\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + + +# PATH needs CR, and LINENO needs CR and PATH. +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + echo "#! /bin/sh" >conf$$.sh + echo "exit 0" >>conf$$.sh + chmod +x conf$$.sh + if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then + PATH_SEPARATOR=';' + else + PATH_SEPARATOR=: + fi + rm -f conf$$.sh +fi + + + as_lineno_1=$LINENO + as_lineno_2=$LINENO + as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` + test "x$as_lineno_1" != "x$as_lineno_2" && + test "x$as_lineno_3" = "x$as_lineno_2" || { + # Find who we are. Look in the path if we contain no path at all + # relative or not. + case $0 in + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break +done + + ;; + esac + # We did not find ourselves, most probably we were run as `sh COMMAND' + # in which case we are not to be found in the path. + if test "x$as_myself" = x; then + as_myself=$0 + fi + if test ! -f "$as_myself"; then + { { echo "$as_me:$LINENO: error: cannot find myself; rerun with an absolute path" >&5 +echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2;} + { (exit 1); exit 1; }; } + fi + case $CONFIG_SHELL in + '') + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for as_base in sh bash ksh sh5; do + case $as_dir in + /*) + if ("$as_dir/$as_base" -c ' + as_lineno_1=$LINENO + as_lineno_2=$LINENO + as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` + test "x$as_lineno_1" != "x$as_lineno_2" && + test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then + $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; } + $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; } + CONFIG_SHELL=$as_dir/$as_base + export CONFIG_SHELL + exec "$CONFIG_SHELL" "$0" ${1+"$@"} + fi;; + esac + done +done +;; + esac + + # Create $as_me.lineno as a copy of $as_myself, but with $LINENO + # uniformly replaced by the line number. The first 'sed' inserts a + # line-number line before each line; the second 'sed' does the real + # work. The second script uses 'N' to pair each line-number line + # with the numbered line, and appends trailing '-' during + # substitution so that $LINENO is not a special case at line end. + # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the + # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-) + sed '=' <$as_myself | + sed ' + N + s,$,-, + : loop + s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3, + t loop + s,-$,, + s,^['$as_cr_digits']*\n,, + ' >$as_me.lineno && + chmod +x $as_me.lineno || + { { echo "$as_me:$LINENO: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&5 +echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2;} + { (exit 1); exit 1; }; } + + # Don't try to exec as it changes $[0], causing all sort of problems + # (the dirname of $[0] is not the place where we might find the + # original and so on. Autoconf is especially sensible to this). + . ./$as_me.lineno + # Exit status is that of the last command. + exit +} + + +case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in + *c*,-n*) ECHO_N= ECHO_C=' +' ECHO_T=' ' ;; + *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; + *) ECHO_N= ECHO_C='\c' ECHO_T= ;; +esac + +if expr a : '\(a\)' >/dev/null 2>&1; then + as_expr=expr +else + as_expr=false +fi + +rm -f conf$$ conf$$.exe conf$$.file +echo >conf$$.file +if ln -s conf$$.file conf$$ 2>/dev/null; then + # We could just check for DJGPP; but this test a) works b) is more generic + # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). + if test -f conf$$.exe; then + # Don't use ln at all; we don't have any links + as_ln_s='cp -p' + else + as_ln_s='ln -s' + fi +elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln +else + as_ln_s='cp -p' +fi +rm -f conf$$ conf$$.exe conf$$.file + +if mkdir -p . 2>/dev/null; then + as_mkdir_p=: +else + test -d ./-p && rmdir ./-p + as_mkdir_p=false +fi + +as_executable_p="test -f" + +# Sed expression to map a string onto a valid CPP name. +as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" + +# Sed expression to map a string onto a valid variable name. +as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" + + +# IFS +# We need space, tab and new line, in precisely that order. +as_nl=' +' +IFS=" $as_nl" + +# CDPATH. +$as_unset CDPATH + +exec 6>&1 + +# Open the log real soon, to keep \$[0] and so on meaningful, and to +# report actual input values of CONFIG_FILES etc. instead of their +# values after options handling. Logging --version etc. is OK. +exec 5>>config.log +{ + echo + sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX +## Running $as_me. ## +_ASBOX +} >&5 +cat >&5 <<_CSEOF + +This file was extended by lbxproxy $as_me 1.0.1, which was +generated by GNU Autoconf 2.59. Invocation command line was + + CONFIG_FILES = $CONFIG_FILES + CONFIG_HEADERS = $CONFIG_HEADERS + CONFIG_LINKS = $CONFIG_LINKS + CONFIG_COMMANDS = $CONFIG_COMMANDS + $ $0 $@ + +_CSEOF +echo "on `(hostname || uname -n) 2>/dev/null | sed 1q`" >&5 +echo >&5 +_ACEOF + +# Files that config.status was made for. +if test -n "$ac_config_files"; then + echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS +fi + +if test -n "$ac_config_headers"; then + echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS +fi + +if test -n "$ac_config_links"; then + echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS +fi + +if test -n "$ac_config_commands"; then + echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS +fi + +cat >>$CONFIG_STATUS <<\_ACEOF + +ac_cs_usage="\ +\`$as_me' instantiates files from templates according to the +current configuration. + +Usage: $0 [OPTIONS] [FILE]... + + -h, --help print this help, then exit + -V, --version print version number, then exit + -q, --quiet do not print progress messages + -d, --debug don't remove temporary files + --recheck update $as_me by reconfiguring in the same conditions + --file=FILE[:TEMPLATE] + instantiate the configuration file FILE + --header=FILE[:TEMPLATE] + instantiate the configuration header FILE + +Configuration files: +$config_files + +Configuration headers: +$config_headers + +Configuration commands: +$config_commands + +Report bugs to ." +_ACEOF + +cat >>$CONFIG_STATUS <<_ACEOF +ac_cs_version="\\ +lbxproxy config.status 1.0.1 +configured by $0, generated by GNU Autoconf 2.59, + with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\" + +Copyright (C) 2003 Free Software Foundation, Inc. +This config.status script is free software; the Free Software Foundation +gives unlimited permission to copy, distribute and modify it." +srcdir=$srcdir +INSTALL="$INSTALL" +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF +# If no file are specified by the user, then we need to provide default +# value. By we need to know if files were specified by the user. +ac_need_defaults=: +while test $# != 0 +do + case $1 in + --*=*) + ac_option=`expr "x$1" : 'x\([^=]*\)='` + ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'` + ac_shift=: + ;; + -*) + ac_option=$1 + ac_optarg=$2 + ac_shift=shift + ;; + *) # This is not an option, so the user has probably given explicit + # arguments. + ac_option=$1 + ac_need_defaults=false;; + esac + + case $ac_option in + # Handling of the options. +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF + -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) + ac_cs_recheck=: ;; + --version | --vers* | -V ) + echo "$ac_cs_version"; exit 0 ;; + --he | --h) + # Conflict between --help and --header + { { echo "$as_me:$LINENO: error: ambiguous option: $1 +Try \`$0 --help' for more information." >&5 +echo "$as_me: error: ambiguous option: $1 +Try \`$0 --help' for more information." >&2;} + { (exit 1); exit 1; }; };; + --help | --hel | -h ) + echo "$ac_cs_usage"; exit 0 ;; + --debug | --d* | -d ) + debug=: ;; + --file | --fil | --fi | --f ) + $ac_shift + CONFIG_FILES="$CONFIG_FILES $ac_optarg" + ac_need_defaults=false;; + --header | --heade | --head | --hea ) + $ac_shift + CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg" + ac_need_defaults=false;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil | --si | --s) + ac_cs_silent=: ;; + + # This is an error. + -*) { { echo "$as_me:$LINENO: error: unrecognized option: $1 +Try \`$0 --help' for more information." >&5 +echo "$as_me: error: unrecognized option: $1 +Try \`$0 --help' for more information." >&2;} + { (exit 1); exit 1; }; } ;; + + *) ac_config_targets="$ac_config_targets $1" ;; + + esac + shift +done + +ac_configure_extra_args= + +if $ac_cs_silent; then + exec 6>/dev/null + ac_configure_extra_args="$ac_configure_extra_args --silent" +fi + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF +if \$ac_cs_recheck; then + echo "running $SHELL $0 " $ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6 + exec $SHELL $0 $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion +fi + +_ACEOF + +cat >>$CONFIG_STATUS <<_ACEOF +# +# INIT-COMMANDS section. +# + +AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir" + +_ACEOF + + + +cat >>$CONFIG_STATUS <<\_ACEOF +for ac_config_target in $ac_config_targets +do + case "$ac_config_target" in + # Handling of arguments. + "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;; + "depfiles" ) CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; + "config.h" ) CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;; + *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 +echo "$as_me: error: invalid argument: $ac_config_target" >&2;} + { (exit 1); exit 1; }; };; + esac +done + +# If the user did not use the arguments to specify the items to instantiate, +# then the envvar interface is used. Set only those that are not. +# We use the long form for the default assignment because of an extremely +# bizarre bug on SunOS 4.1.3. +if $ac_need_defaults; then + test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files + test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers + test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands +fi + +# Have a temporary directory for convenience. Make it in the build tree +# simply because there is no reason to put it here, and in addition, +# creating and moving files from /tmp can sometimes cause problems. +# Create a temporary directory, and hook for its removal unless debugging. +$debug || +{ + trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0 + trap '{ (exit 1); exit 1; }' 1 2 13 15 +} + +# Create a (secure) tmp directory for tmp files. + +{ + tmp=`(umask 077 && mktemp -d -q "./confstatXXXXXX") 2>/dev/null` && + test -n "$tmp" && test -d "$tmp" +} || +{ + tmp=./confstat$$-$RANDOM + (umask 077 && mkdir $tmp) +} || +{ + echo "$me: cannot create a temporary directory in ." >&2 + { (exit 1); exit 1; } +} + +_ACEOF + +cat >>$CONFIG_STATUS <<_ACEOF + +# +# CONFIG_FILES section. +# + +# No need to generate the scripts if there are no CONFIG_FILES. +# This happens for instance when ./config.status config.h +if test -n "\$CONFIG_FILES"; then + # Protect against being on the right side of a sed subst in config.status. + sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g; + s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF +s,@SHELL@,$SHELL,;t t +s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t +s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t +s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t +s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t +s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t +s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t +s,@exec_prefix@,$exec_prefix,;t t +s,@prefix@,$prefix,;t t +s,@program_transform_name@,$program_transform_name,;t t +s,@bindir@,$bindir,;t t +s,@sbindir@,$sbindir,;t t +s,@libexecdir@,$libexecdir,;t t +s,@datadir@,$datadir,;t t +s,@sysconfdir@,$sysconfdir,;t t +s,@sharedstatedir@,$sharedstatedir,;t t +s,@localstatedir@,$localstatedir,;t t +s,@libdir@,$libdir,;t t +s,@includedir@,$includedir,;t t +s,@oldincludedir@,$oldincludedir,;t t +s,@infodir@,$infodir,;t t +s,@mandir@,$mandir,;t t +s,@build_alias@,$build_alias,;t t +s,@host_alias@,$host_alias,;t t +s,@target_alias@,$target_alias,;t t +s,@DEFS@,$DEFS,;t t +s,@ECHO_C@,$ECHO_C,;t t +s,@ECHO_N@,$ECHO_N,;t t +s,@ECHO_T@,$ECHO_T,;t t +s,@LIBS@,$LIBS,;t t +s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t +s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t +s,@INSTALL_DATA@,$INSTALL_DATA,;t t +s,@CYGPATH_W@,$CYGPATH_W,;t t +s,@PACKAGE@,$PACKAGE,;t t +s,@VERSION@,$VERSION,;t t +s,@ACLOCAL@,$ACLOCAL,;t t +s,@AUTOCONF@,$AUTOCONF,;t t +s,@AUTOMAKE@,$AUTOMAKE,;t t +s,@AUTOHEADER@,$AUTOHEADER,;t t +s,@MAKEINFO@,$MAKEINFO,;t t +s,@AMTAR@,$AMTAR,;t t +s,@install_sh@,$install_sh,;t t +s,@STRIP@,$STRIP,;t t +s,@ac_ct_STRIP@,$ac_ct_STRIP,;t t +s,@INSTALL_STRIP_PROGRAM@,$INSTALL_STRIP_PROGRAM,;t t +s,@AWK@,$AWK,;t t +s,@SET_MAKE@,$SET_MAKE,;t t +s,@am__leading_dot@,$am__leading_dot,;t t +s,@MAINTAINER_MODE_TRUE@,$MAINTAINER_MODE_TRUE,;t t +s,@MAINTAINER_MODE_FALSE@,$MAINTAINER_MODE_FALSE,;t t +s,@MAINT@,$MAINT,;t t +s,@CC@,$CC,;t t +s,@CFLAGS@,$CFLAGS,;t t +s,@LDFLAGS@,$LDFLAGS,;t t +s,@CPPFLAGS@,$CPPFLAGS,;t t +s,@ac_ct_CC@,$ac_ct_CC,;t t +s,@EXEEXT@,$EXEEXT,;t t +s,@OBJEXT@,$OBJEXT,;t t +s,@DEPDIR@,$DEPDIR,;t t +s,@am__include@,$am__include,;t t +s,@am__quote@,$am__quote,;t t +s,@AMDEP_TRUE@,$AMDEP_TRUE,;t t +s,@AMDEP_FALSE@,$AMDEP_FALSE,;t t +s,@AMDEPBACKSLASH@,$AMDEPBACKSLASH,;t t +s,@CCDEPMODE@,$CCDEPMODE,;t t +s,@am__fastdepCC_TRUE@,$am__fastdepCC_TRUE,;t t +s,@am__fastdepCC_FALSE@,$am__fastdepCC_FALSE,;t t +s,@build@,$build,;t t +s,@build_cpu@,$build_cpu,;t t +s,@build_vendor@,$build_vendor,;t t +s,@build_os@,$build_os,;t t +s,@host@,$host,;t t +s,@host_cpu@,$host_cpu,;t t +s,@host_vendor@,$host_vendor,;t t +s,@host_os@,$host_os,;t t +s,@PKG_CONFIG@,$PKG_CONFIG,;t t +s,@ac_pt_PKG_CONFIG@,$ac_pt_PKG_CONFIG,;t t +s,@LBXPROXY_CFLAGS@,$LBXPROXY_CFLAGS,;t t +s,@LBXPROXY_LIBS@,$LBXPROXY_LIBS,;t t +s,@APP_MAN_SUFFIX@,$APP_MAN_SUFFIX,;t t +s,@LIB_MAN_SUFFIX@,$LIB_MAN_SUFFIX,;t t +s,@FILE_MAN_SUFFIX@,$FILE_MAN_SUFFIX,;t t +s,@MISC_MAN_SUFFIX@,$MISC_MAN_SUFFIX,;t t +s,@DRIVER_MAN_SUFFIX@,$DRIVER_MAN_SUFFIX,;t t +s,@ADMIN_MAN_SUFFIX@,$ADMIN_MAN_SUFFIX,;t t +s,@APP_MAN_DIR@,$APP_MAN_DIR,;t t +s,@LIB_MAN_DIR@,$LIB_MAN_DIR,;t t +s,@FILE_MAN_DIR@,$FILE_MAN_DIR,;t t +s,@MISC_MAN_DIR@,$MISC_MAN_DIR,;t t +s,@DRIVER_MAN_DIR@,$DRIVER_MAN_DIR,;t t +s,@ADMIN_MAN_DIR@,$ADMIN_MAN_DIR,;t t +s,@LIBOBJS@,$LIBOBJS,;t t +s,@LTLIBOBJS@,$LTLIBOBJS,;t t +CEOF + +_ACEOF + + cat >>$CONFIG_STATUS <<\_ACEOF + # Split the substitutions into bite-sized pieces for seds with + # small command number limits, like on Digital OSF/1 and HP-UX. + ac_max_sed_lines=48 + ac_sed_frag=1 # Number of current file. + ac_beg=1 # First line for current file. + ac_end=$ac_max_sed_lines # Line after last line for current file. + ac_more_lines=: + ac_sed_cmds= + while $ac_more_lines; do + if test $ac_beg -gt 1; then + sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag + else + sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag + fi + if test ! -s $tmp/subs.frag; then + ac_more_lines=false + else + # The purpose of the label and of the branching condition is to + # speed up the sed processing (if there are no `@' at all, there + # is no need to browse any of the substitutions). + # These are the two extra sed commands mentioned above. + (echo ':t + /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed + if test -z "$ac_sed_cmds"; then + ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed" + else + ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed" + fi + ac_sed_frag=`expr $ac_sed_frag + 1` + ac_beg=$ac_end + ac_end=`expr $ac_end + $ac_max_sed_lines` + fi + done + if test -z "$ac_sed_cmds"; then + ac_sed_cmds=cat + fi +fi # test -n "$CONFIG_FILES" + +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF +for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue + # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". + case $ac_file in + - | *:- | *:-:* ) # input from stdin + cat >$tmp/stdin + ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` + ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; + *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` + ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; + * ) ac_file_in=$ac_file.in ;; + esac + + # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories. + ac_dir=`(dirname "$ac_file") 2>/dev/null || +$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$ac_file" : 'X\(//\)[^/]' \| \ + X"$ac_file" : 'X\(//\)$' \| \ + X"$ac_file" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$ac_file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + { if $as_mkdir_p; then + mkdir -p "$ac_dir" + else + as_dir="$ac_dir" + as_dirs= + while test ! -d "$as_dir"; do + as_dirs="$as_dir $as_dirs" + as_dir=`(dirname "$as_dir") 2>/dev/null || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + done + test ! -n "$as_dirs" || mkdir $as_dirs + fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5 +echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;} + { (exit 1); exit 1; }; }; } + + ac_builddir=. + +if test "$ac_dir" != .; then + ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` + # A "../" for each directory in $ac_dir_suffix. + ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` +else + ac_dir_suffix= ac_top_builddir= +fi + +case $srcdir in + .) # No --srcdir option. We are building in place. + ac_srcdir=. + if test -z "$ac_top_builddir"; then + ac_top_srcdir=. + else + ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` + fi ;; + [\\/]* | ?:[\\/]* ) # Absolute path. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir ;; + *) # Relative path. + ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_builddir$srcdir ;; +esac + +# Do not use `cd foo && pwd` to compute absolute paths, because +# the directories may not exist. +case `pwd` in +.) ac_abs_builddir="$ac_dir";; +*) + case "$ac_dir" in + .) ac_abs_builddir=`pwd`;; + [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";; + *) ac_abs_builddir=`pwd`/"$ac_dir";; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_top_builddir=${ac_top_builddir}.;; +*) + case ${ac_top_builddir}. in + .) ac_abs_top_builddir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;; + *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_srcdir=$ac_srcdir;; +*) + case $ac_srcdir in + .) ac_abs_srcdir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;; + *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_top_srcdir=$ac_top_srcdir;; +*) + case $ac_top_srcdir in + .) ac_abs_top_srcdir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;; + *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;; + esac;; +esac + + + case $INSTALL in + [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; + *) ac_INSTALL=$ac_top_builddir$INSTALL ;; + esac + + if test x"$ac_file" != x-; then + { echo "$as_me:$LINENO: creating $ac_file" >&5 +echo "$as_me: creating $ac_file" >&6;} + rm -f "$ac_file" + fi + # Let's still pretend it is `configure' which instantiates (i.e., don't + # use $as_me), people would be surprised to read: + # /* config.h. Generated by config.status. */ + if test x"$ac_file" = x-; then + configure_input= + else + configure_input="$ac_file. " + fi + configure_input=$configure_input"Generated from `echo $ac_file_in | + sed 's,.*/,,'` by configure." + + # First look for the input files in the build tree, otherwise in the + # src tree. + ac_file_inputs=`IFS=: + for f in $ac_file_in; do + case $f in + -) echo $tmp/stdin ;; + [\\/$]*) + # Absolute (can't be DOS-style, as IFS=:) + test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 +echo "$as_me: error: cannot find input file: $f" >&2;} + { (exit 1); exit 1; }; } + echo "$f";; + *) # Relative + if test -f "$f"; then + # Build tree + echo "$f" + elif test -f "$srcdir/$f"; then + # Source tree + echo "$srcdir/$f" + else + # /dev/null tree + { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 +echo "$as_me: error: cannot find input file: $f" >&2;} + { (exit 1); exit 1; }; } + fi;; + esac + done` || { (exit 1); exit 1; } +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF + sed "$ac_vpsub +$extrasub +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF +:t +/@[a-zA-Z_][a-zA-Z_0-9]*@/!b +s,@configure_input@,$configure_input,;t t +s,@srcdir@,$ac_srcdir,;t t +s,@abs_srcdir@,$ac_abs_srcdir,;t t +s,@top_srcdir@,$ac_top_srcdir,;t t +s,@abs_top_srcdir@,$ac_abs_top_srcdir,;t t +s,@builddir@,$ac_builddir,;t t +s,@abs_builddir@,$ac_abs_builddir,;t t +s,@top_builddir@,$ac_top_builddir,;t t +s,@abs_top_builddir@,$ac_abs_top_builddir,;t t +s,@INSTALL@,$ac_INSTALL,;t t +" $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out + rm -f $tmp/stdin + if test x"$ac_file" != x-; then + mv $tmp/out $ac_file + else + cat $tmp/out + rm -f $tmp/out + fi + +done +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF + +# +# CONFIG_HEADER section. +# + +# These sed commands are passed to sed as "A NAME B NAME C VALUE D", where +# NAME is the cpp macro being defined and VALUE is the value it is being given. +# +# ac_d sets the value in "#define NAME VALUE" lines. +ac_dA='s,^\([ ]*\)#\([ ]*define[ ][ ]*\)' +ac_dB='[ ].*$,\1#\2' +ac_dC=' ' +ac_dD=',;t' +# ac_u turns "#undef NAME" without trailing blanks into "#define NAME VALUE". +ac_uA='s,^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)' +ac_uB='$,\1#\2define\3' +ac_uC=' ' +ac_uD=',;t' + +for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue + # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". + case $ac_file in + - | *:- | *:-:* ) # input from stdin + cat >$tmp/stdin + ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` + ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; + *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` + ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; + * ) ac_file_in=$ac_file.in ;; + esac + + test x"$ac_file" != x- && { echo "$as_me:$LINENO: creating $ac_file" >&5 +echo "$as_me: creating $ac_file" >&6;} + + # First look for the input files in the build tree, otherwise in the + # src tree. + ac_file_inputs=`IFS=: + for f in $ac_file_in; do + case $f in + -) echo $tmp/stdin ;; + [\\/$]*) + # Absolute (can't be DOS-style, as IFS=:) + test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 +echo "$as_me: error: cannot find input file: $f" >&2;} + { (exit 1); exit 1; }; } + # Do quote $f, to prevent DOS paths from being IFS'd. + echo "$f";; + *) # Relative + if test -f "$f"; then + # Build tree + echo "$f" + elif test -f "$srcdir/$f"; then + # Source tree + echo "$srcdir/$f" + else + # /dev/null tree + { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 +echo "$as_me: error: cannot find input file: $f" >&2;} + { (exit 1); exit 1; }; } + fi;; + esac + done` || { (exit 1); exit 1; } + # Remove the trailing spaces. + sed 's/[ ]*$//' $ac_file_inputs >$tmp/in + +_ACEOF + +# Transform confdefs.h into two sed scripts, `conftest.defines' and +# `conftest.undefs', that substitutes the proper values into +# config.h.in to produce config.h. The first handles `#define' +# templates, and the second `#undef' templates. +# And first: Protect against being on the right side of a sed subst in +# config.status. Protect against being in an unquoted here document +# in config.status. +rm -f conftest.defines conftest.undefs +# Using a here document instead of a string reduces the quoting nightmare. +# Putting comments in sed scripts is not portable. +# +# `end' is used to avoid that the second main sed command (meant for +# 0-ary CPP macros) applies to n-ary macro definitions. +# See the Autoconf documentation for `clear'. +cat >confdef2sed.sed <<\_ACEOF +s/[\\&,]/\\&/g +s,[\\$`],\\&,g +t clear +: clear +s,^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*\)\(([^)]*)\)[ ]*\(.*\)$,${ac_dA}\1${ac_dB}\1\2${ac_dC}\3${ac_dD},gp +t end +s,^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)$,${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD},gp +: end +_ACEOF +# If some macros were called several times there might be several times +# the same #defines, which is useless. Nevertheless, we may not want to +# sort them, since we want the *last* AC-DEFINE to be honored. +uniq confdefs.h | sed -n -f confdef2sed.sed >conftest.defines +sed 's/ac_d/ac_u/g' conftest.defines >conftest.undefs +rm -f confdef2sed.sed + +# This sed command replaces #undef with comments. This is necessary, for +# example, in the case of _POSIX_SOURCE, which is predefined and required +# on some systems where configure will not decide to define it. +cat >>conftest.undefs <<\_ACEOF +s,^[ ]*#[ ]*undef[ ][ ]*[a-zA-Z_][a-zA-Z_0-9]*,/* & */, +_ACEOF + +# Break up conftest.defines because some shells have a limit on the size +# of here documents, and old seds have small limits too (100 cmds). +echo ' # Handle all the #define templates only if necessary.' >>$CONFIG_STATUS +echo ' if grep "^[ ]*#[ ]*define" $tmp/in >/dev/null; then' >>$CONFIG_STATUS +echo ' # If there are no defines, we may have an empty if/fi' >>$CONFIG_STATUS +echo ' :' >>$CONFIG_STATUS +rm -f conftest.tail +while grep . conftest.defines >/dev/null +do + # Write a limited-size here document to $tmp/defines.sed. + echo ' cat >$tmp/defines.sed <>$CONFIG_STATUS + # Speed up: don't consider the non `#define' lines. + echo '/^[ ]*#[ ]*define/!b' >>$CONFIG_STATUS + # Work around the forget-to-reset-the-flag bug. + echo 't clr' >>$CONFIG_STATUS + echo ': clr' >>$CONFIG_STATUS + sed ${ac_max_here_lines}q conftest.defines >>$CONFIG_STATUS + echo 'CEOF + sed -f $tmp/defines.sed $tmp/in >$tmp/out + rm -f $tmp/in + mv $tmp/out $tmp/in +' >>$CONFIG_STATUS + sed 1,${ac_max_here_lines}d conftest.defines >conftest.tail + rm -f conftest.defines + mv conftest.tail conftest.defines +done +rm -f conftest.defines +echo ' fi # grep' >>$CONFIG_STATUS +echo >>$CONFIG_STATUS + +# Break up conftest.undefs because some shells have a limit on the size +# of here documents, and old seds have small limits too (100 cmds). +echo ' # Handle all the #undef templates' >>$CONFIG_STATUS +rm -f conftest.tail +while grep . conftest.undefs >/dev/null +do + # Write a limited-size here document to $tmp/undefs.sed. + echo ' cat >$tmp/undefs.sed <>$CONFIG_STATUS + # Speed up: don't consider the non `#undef' + echo '/^[ ]*#[ ]*undef/!b' >>$CONFIG_STATUS + # Work around the forget-to-reset-the-flag bug. + echo 't clr' >>$CONFIG_STATUS + echo ': clr' >>$CONFIG_STATUS + sed ${ac_max_here_lines}q conftest.undefs >>$CONFIG_STATUS + echo 'CEOF + sed -f $tmp/undefs.sed $tmp/in >$tmp/out + rm -f $tmp/in + mv $tmp/out $tmp/in +' >>$CONFIG_STATUS + sed 1,${ac_max_here_lines}d conftest.undefs >conftest.tail + rm -f conftest.undefs + mv conftest.tail conftest.undefs +done +rm -f conftest.undefs + +cat >>$CONFIG_STATUS <<\_ACEOF + # Let's still pretend it is `configure' which instantiates (i.e., don't + # use $as_me), people would be surprised to read: + # /* config.h. Generated by config.status. */ + if test x"$ac_file" = x-; then + echo "/* Generated by configure. */" >$tmp/config.h + else + echo "/* $ac_file. Generated by configure. */" >$tmp/config.h + fi + cat $tmp/in >>$tmp/config.h + rm -f $tmp/in + if test x"$ac_file" != x-; then + if diff $ac_file $tmp/config.h >/dev/null 2>&1; then + { echo "$as_me:$LINENO: $ac_file is unchanged" >&5 +echo "$as_me: $ac_file is unchanged" >&6;} + else + ac_dir=`(dirname "$ac_file") 2>/dev/null || +$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$ac_file" : 'X\(//\)[^/]' \| \ + X"$ac_file" : 'X\(//\)$' \| \ + X"$ac_file" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$ac_file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + { if $as_mkdir_p; then + mkdir -p "$ac_dir" + else + as_dir="$ac_dir" + as_dirs= + while test ! -d "$as_dir"; do + as_dirs="$as_dir $as_dirs" + as_dir=`(dirname "$as_dir") 2>/dev/null || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + done + test ! -n "$as_dirs" || mkdir $as_dirs + fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5 +echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;} + { (exit 1); exit 1; }; }; } + + rm -f $ac_file + mv $tmp/config.h $ac_file + fi + else + cat $tmp/config.h + rm -f $tmp/config.h + fi +# Compute $ac_file's index in $config_headers. +_am_stamp_count=1 +for _am_header in $config_headers :; do + case $_am_header in + $ac_file | $ac_file:* ) + break ;; + * ) + _am_stamp_count=`expr $_am_stamp_count + 1` ;; + esac +done +echo "timestamp for $ac_file" >`(dirname $ac_file) 2>/dev/null || +$as_expr X$ac_file : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X$ac_file : 'X\(//\)[^/]' \| \ + X$ac_file : 'X\(//\)$' \| \ + X$ac_file : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X$ac_file | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'`/stamp-h$_am_stamp_count +done +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF + +# +# CONFIG_COMMANDS section. +# +for ac_file in : $CONFIG_COMMANDS; do test "x$ac_file" = x: && continue + ac_dest=`echo "$ac_file" | sed 's,:.*,,'` + ac_source=`echo "$ac_file" | sed 's,[^:]*:,,'` + ac_dir=`(dirname "$ac_dest") 2>/dev/null || +$as_expr X"$ac_dest" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$ac_dest" : 'X\(//\)[^/]' \| \ + X"$ac_dest" : 'X\(//\)$' \| \ + X"$ac_dest" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$ac_dest" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + { if $as_mkdir_p; then + mkdir -p "$ac_dir" + else + as_dir="$ac_dir" + as_dirs= + while test ! -d "$as_dir"; do + as_dirs="$as_dir $as_dirs" + as_dir=`(dirname "$as_dir") 2>/dev/null || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + done + test ! -n "$as_dirs" || mkdir $as_dirs + fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5 +echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;} + { (exit 1); exit 1; }; }; } + + ac_builddir=. + +if test "$ac_dir" != .; then + ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` + # A "../" for each directory in $ac_dir_suffix. + ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` +else + ac_dir_suffix= ac_top_builddir= +fi + +case $srcdir in + .) # No --srcdir option. We are building in place. + ac_srcdir=. + if test -z "$ac_top_builddir"; then + ac_top_srcdir=. + else + ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` + fi ;; + [\\/]* | ?:[\\/]* ) # Absolute path. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir ;; + *) # Relative path. + ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_builddir$srcdir ;; +esac + +# Do not use `cd foo && pwd` to compute absolute paths, because +# the directories may not exist. +case `pwd` in +.) ac_abs_builddir="$ac_dir";; +*) + case "$ac_dir" in + .) ac_abs_builddir=`pwd`;; + [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";; + *) ac_abs_builddir=`pwd`/"$ac_dir";; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_top_builddir=${ac_top_builddir}.;; +*) + case ${ac_top_builddir}. in + .) ac_abs_top_builddir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;; + *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_srcdir=$ac_srcdir;; +*) + case $ac_srcdir in + .) ac_abs_srcdir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;; + *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_top_srcdir=$ac_top_srcdir;; +*) + case $ac_top_srcdir in + .) ac_abs_top_srcdir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;; + *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;; + esac;; +esac + + + { echo "$as_me:$LINENO: executing $ac_dest commands" >&5 +echo "$as_me: executing $ac_dest commands" >&6;} + case $ac_dest in + depfiles ) test x"$AMDEP_TRUE" != x"" || for mf in $CONFIG_FILES; do + # Strip MF so we end up with the name of the file. + mf=`echo "$mf" | sed -e 's/:.*$//'` + # Check whether this is an Automake generated Makefile or not. + # We used to match only the files named `Makefile.in', but + # some people rename them; so instead we look at the file content. + # Grep'ing the first line is not enough: some people post-process + # each Makefile.in and add a new line on top of each file to say so. + # So let's grep whole file. + if grep '^#.*generated by automake' $mf > /dev/null 2>&1; then + dirpart=`(dirname "$mf") 2>/dev/null || +$as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$mf" : 'X\(//\)[^/]' \| \ + X"$mf" : 'X\(//\)$' \| \ + X"$mf" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$mf" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + else + continue + fi + grep '^DEP_FILES *= *[^ #]' < "$mf" > /dev/null || continue + # Extract the definition of DEP_FILES from the Makefile without + # running `make'. + DEPDIR=`sed -n -e '/^DEPDIR = / s///p' < "$mf"` + test -z "$DEPDIR" && continue + # When using ansi2knr, U may be empty or an underscore; expand it + U=`sed -n -e '/^U = / s///p' < "$mf"` + test -d "$dirpart/$DEPDIR" || mkdir "$dirpart/$DEPDIR" + # We invoke sed twice because it is the simplest approach to + # changing $(DEPDIR) to its actual value in the expansion. + for file in `sed -n -e ' + /^DEP_FILES = .*\\\\$/ { + s/^DEP_FILES = // + :loop + s/\\\\$// + p + n + /\\\\$/ b loop + p + } + /^DEP_FILES = / s/^DEP_FILES = //p' < "$mf" | \ + sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do + # Make sure the directory exists. + test -f "$dirpart/$file" && continue + fdir=`(dirname "$file") 2>/dev/null || +$as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$file" : 'X\(//\)[^/]' \| \ + X"$file" : 'X\(//\)$' \| \ + X"$file" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + { if $as_mkdir_p; then + mkdir -p $dirpart/$fdir + else + as_dir=$dirpart/$fdir + as_dirs= + while test ! -d "$as_dir"; do + as_dirs="$as_dir $as_dirs" + as_dir=`(dirname "$as_dir") 2>/dev/null || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + done + test ! -n "$as_dirs" || mkdir $as_dirs + fi || { { echo "$as_me:$LINENO: error: cannot create directory $dirpart/$fdir" >&5 +echo "$as_me: error: cannot create directory $dirpart/$fdir" >&2;} + { (exit 1); exit 1; }; }; } + + # echo "creating $dirpart/$file" + echo '# dummy' > "$dirpart/$file" + done +done + ;; + esac +done +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF + +{ (exit 0); exit 0; } +_ACEOF +chmod +x $CONFIG_STATUS +ac_clean_files=$ac_clean_files_save + + +# configure is writing to config.log, and then calls config.status. +# config.status does its own redirection, appending to config.log. +# Unfortunately, on DOS this fails, as config.log is still kept open +# by configure, so config.status won't be able to write to it; its +# output is simply discarded. So we exec the FD to /dev/null, +# effectively closing config.log, so it can be properly (re)opened and +# appended to by config.status. When coming back to configure, we +# need to make the FD available again. +if test "$no_create" != yes; then + ac_cs_success=: + ac_config_status_args= + test "$silent" = yes && + ac_config_status_args="$ac_config_status_args --quiet" + exec 5>/dev/null + $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false + exec 5>>config.log + # Use ||, not &&, to avoid exiting from the if with $? = 1, which + # would make configure fail if this is the last instruction. + $ac_cs_success || { (exit 1); exit 1; } +fi + diff --git a/app/lbxproxy/configure.ac b/app/lbxproxy/configure.ac new file mode 100644 index 000000000..cb3d28684 --- /dev/null +++ b/app/lbxproxy/configure.ac @@ -0,0 +1,58 @@ + +dnl Copyright 2005 Red Hat, Inc. +dnl +dnl Permission to use, copy, modify, distribute, and sell this software and its +dnl documentation for any purpose is hereby granted without fee, provided that +dnl the above copyright notice appear in all copies and that both that +dnl copyright notice and this permission notice appear in supporting +dnl documentation, and that the name of Red Hat not be used in +dnl advertising or publicity pertaining to distribution of the software without +dnl specific, written prior permission. Red Hat makes no +dnl representations about the suitability of this software for any purpose. It +dnl is provided "as is" without express or implied warranty. +dnl +dnl RED HAT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, +dnl INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO +dnl EVENT SHALL RED HAT BE LIABLE FOR ANY SPECIAL, INDIRECT OR +dnl CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, +dnl DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER +dnl TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +dnl PERFORMANCE OF THIS SOFTWARE. +dnl +dnl Process this file with autoconf to create configure. + +AC_PREREQ([2.57]) +AC_INIT(lbxproxy,[1.0.1], [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg],lbxproxy) +AM_INIT_AUTOMAKE([dist-bzip2]) +AM_MAINTAINER_MODE + +AM_CONFIG_HEADER(config.h) + +AC_PROG_CC +AC_PROG_INSTALL +AC_CANONICAL_HOST + +case $host_os in + linux*) + OS_CFLAGS="-D_XOPEN_SOURCE" + ;; + *) + OS_CFLAGS= + ;; +esac + +# Checks for pkg-config packages +PKG_CHECK_MODULES(LBXPROXY, xtrans xext lbxutil x11 ice xproxymngproto bigreqsproto) +LBXPROXY_CFLAGS="$LBXPROXY_CFLAGS $OS_CFLAGS" +AC_SUBST(LBXPROXY_CFLAGS) +AC_SUBST(LBXPROXY_LIBS) + +# Transport selection macro from xtrans.m4 +XTRANS_CONNECTION_FLAGS + +AC_CHECK_LIB(z,deflate) + +XORG_MANPAGE_SECTIONS +XORG_RELEASE_VERSION + +AC_OUTPUT([Makefile]) diff --git a/app/lbxproxy/depcomp b/app/lbxproxy/depcomp new file mode 100644 index 000000000..edb5d38ef --- /dev/null +++ b/app/lbxproxy/depcomp @@ -0,0 +1,479 @@ +#! /bin/sh + +# depcomp - compile a program generating dependencies as side-effects +# Copyright 1999, 2000, 2003 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +# 02111-1307, USA. + +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +# Originally written by Alexandre Oliva . + +if test -z "$depmode" || test -z "$source" || test -z "$object"; then + echo "depcomp: Variables source, object and depmode must be set" 1>&2 + exit 1 +fi +# `libtool' can also be set to `yes' or `no'. + +if test -z "$depfile"; then + base=`echo "$object" | sed -e 's,^.*/,,' -e 's,\.\([^.]*\)$,.P\1,'` + dir=`echo "$object" | sed 's,/.*$,/,'` + if test "$dir" = "$object"; then + dir= + fi + # FIXME: should be _deps on DOS. + depfile="$dir.deps/$base" +fi + +tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`} + +rm -f "$tmpdepfile" + +# Some modes work just like other modes, but use different flags. We +# parameterize here, but still list the modes in the big case below, +# to make depend.m4 easier to write. Note that we *cannot* use a case +# here, because this file can only contain one case statement. +if test "$depmode" = hp; then + # HP compiler uses -M and no extra arg. + gccflag=-M + depmode=gcc +fi + +if test "$depmode" = dashXmstdout; then + # This is just like dashmstdout with a different argument. + dashmflag=-xM + depmode=dashmstdout +fi + +case "$depmode" in +gcc3) +## gcc 3 implements dependency tracking that does exactly what +## we want. Yay! Note: for some reason libtool 1.4 doesn't like +## it if -MD -MP comes after the -MF stuff. Hmm. + "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" + stat=$? + if test $stat -eq 0; then : + else + rm -f "$tmpdepfile" + exit $stat + fi + mv "$tmpdepfile" "$depfile" + ;; + +gcc) +## There are various ways to get dependency output from gcc. Here's +## why we pick this rather obscure method: +## - Don't want to use -MD because we'd like the dependencies to end +## up in a subdir. Having to rename by hand is ugly. +## (We might end up doing this anyway to support other compilers.) +## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like +## -MM, not -M (despite what the docs say). +## - Using -M directly means running the compiler twice (even worse +## than renaming). + if test -z "$gccflag"; then + gccflag=-MD, + fi + "$@" -Wp,"$gccflag$tmpdepfile" + stat=$? + if test $stat -eq 0; then : + else + rm -f "$tmpdepfile" + exit $stat + fi + rm -f "$depfile" + echo "$object : \\" > "$depfile" + alpha=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz +## The second -e expression handles DOS-style file names with drive letters. + sed -e 's/^[^:]*: / /' \ + -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile" +## This next piece of magic avoids the `deleted header file' problem. +## The problem is that when a header file which appears in a .P file +## is deleted, the dependency causes make to die (because there is +## typically no way to rebuild the header). We avoid this by adding +## dummy dependencies for each header file. Too bad gcc doesn't do +## this for us directly. + tr ' ' ' +' < "$tmpdepfile" | +## Some versions of gcc put a space before the `:'. On the theory +## that the space means something, we add a space to the output as +## well. +## Some versions of the HPUX 10.20 sed can't process this invocation +## correctly. Breaking it into two sed invocations is a workaround. + sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +hp) + # This case exists only to let depend.m4 do its work. It works by + # looking at the text of this script. This case will never be run, + # since it is checked for above. + exit 1 + ;; + +sgi) + if test "$libtool" = yes; then + "$@" "-Wp,-MDupdate,$tmpdepfile" + else + "$@" -MDupdate "$tmpdepfile" + fi + stat=$? + if test $stat -eq 0; then : + else + rm -f "$tmpdepfile" + exit $stat + fi + rm -f "$depfile" + + if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files + echo "$object : \\" > "$depfile" + + # Clip off the initial element (the dependent). Don't try to be + # clever and replace this with sed code, as IRIX sed won't handle + # lines with more than a fixed number of characters (4096 in + # IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines; + # the IRIX cc adds comments like `#:fec' to the end of the + # dependency line. + tr ' ' ' +' < "$tmpdepfile" \ + | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \ + tr ' +' ' ' >> $depfile + echo >> $depfile + + # The second pass generates a dummy entry for each header file. + tr ' ' ' +' < "$tmpdepfile" \ + | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \ + >> $depfile + else + # The sourcefile does not contain any dependencies, so just + # store a dummy comment line, to avoid errors with the Makefile + # "include basename.Plo" scheme. + echo "#dummy" > "$depfile" + fi + rm -f "$tmpdepfile" + ;; + +aix) + # The C for AIX Compiler uses -M and outputs the dependencies + # in a .u file. In older versions, this file always lives in the + # current directory. Also, the AIX compiler puts `$object:' at the + # start of each line; $object doesn't have directory information. + # Version 6 uses the directory in both cases. + stripped=`echo "$object" | sed 's/\(.*\)\..*$/\1/'` + tmpdepfile="$stripped.u" + if test "$libtool" = yes; then + "$@" -Wc,-M + else + "$@" -M + fi + stat=$? + + if test -f "$tmpdepfile"; then : + else + stripped=`echo "$stripped" | sed 's,^.*/,,'` + tmpdepfile="$stripped.u" + fi + + if test $stat -eq 0; then : + else + rm -f "$tmpdepfile" + exit $stat + fi + + if test -f "$tmpdepfile"; then + outname="$stripped.o" + # Each line is of the form `foo.o: dependent.h'. + # Do two passes, one to just change these to + # `$object: dependent.h' and one to simply `dependent.h:'. + sed -e "s,^$outname:,$object :," < "$tmpdepfile" > "$depfile" + sed -e "s,^$outname: \(.*\)$,\1:," < "$tmpdepfile" >> "$depfile" + else + # The sourcefile does not contain any dependencies, so just + # store a dummy comment line, to avoid errors with the Makefile + # "include basename.Plo" scheme. + echo "#dummy" > "$depfile" + fi + rm -f "$tmpdepfile" + ;; + +icc) + # Intel's C compiler understands `-MD -MF file'. However on + # icc -MD -MF foo.d -c -o sub/foo.o sub/foo.c + # ICC 7.0 will fill foo.d with something like + # foo.o: sub/foo.c + # foo.o: sub/foo.h + # which is wrong. We want: + # sub/foo.o: sub/foo.c + # sub/foo.o: sub/foo.h + # sub/foo.c: + # sub/foo.h: + # ICC 7.1 will output + # foo.o: sub/foo.c sub/foo.h + # and will wrap long lines using \ : + # foo.o: sub/foo.c ... \ + # sub/foo.h ... \ + # ... + + "$@" -MD -MF "$tmpdepfile" + stat=$? + if test $stat -eq 0; then : + else + rm -f "$tmpdepfile" + exit $stat + fi + rm -f "$depfile" + # Each line is of the form `foo.o: dependent.h', + # or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'. + # Do two passes, one to just change these to + # `$object: dependent.h' and one to simply `dependent.h:'. + sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile" + # Some versions of the HPUX 10.20 sed can't process this invocation + # correctly. Breaking it into two sed invocations is a workaround. + sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" | + sed -e 's/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +tru64) + # The Tru64 compiler uses -MD to generate dependencies as a side + # effect. `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'. + # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put + # dependencies in `foo.d' instead, so we check for that too. + # Subdirectories are respected. + dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` + test "x$dir" = "x$object" && dir= + base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` + + if test "$libtool" = yes; then + tmpdepfile1="$dir.libs/$base.lo.d" + tmpdepfile2="$dir.libs/$base.d" + "$@" -Wc,-MD + else + tmpdepfile1="$dir$base.o.d" + tmpdepfile2="$dir$base.d" + "$@" -MD + fi + + stat=$? + if test $stat -eq 0; then : + else + rm -f "$tmpdepfile1" "$tmpdepfile2" + exit $stat + fi + + if test -f "$tmpdepfile1"; then + tmpdepfile="$tmpdepfile1" + else + tmpdepfile="$tmpdepfile2" + fi + if test -f "$tmpdepfile"; then + sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile" + # That's a tab and a space in the []. + sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile" + else + echo "#dummy" > "$depfile" + fi + rm -f "$tmpdepfile" + ;; + +#nosideeffect) + # This comment above is used by automake to tell side-effect + # dependency tracking mechanisms from slower ones. + +dashmstdout) + # Important note: in order to support this mode, a compiler *must* + # always write the preprocessed file to stdout, regardless of -o. + "$@" || exit $? + + # Remove the call to Libtool. + if test "$libtool" = yes; then + while test $1 != '--mode=compile'; do + shift + done + shift + fi + + # Remove `-o $object'. + IFS=" " + for arg + do + case $arg in + -o) + shift + ;; + $object) + shift + ;; + *) + set fnord "$@" "$arg" + shift # fnord + shift # $arg + ;; + esac + done + + test -z "$dashmflag" && dashmflag=-M + # Require at least two characters before searching for `:' + # in the target name. This is to cope with DOS-style filenames: + # a dependency such as `c:/foo/bar' could be seen as target `c' otherwise. + "$@" $dashmflag | + sed 's:^[ ]*[^: ][^:][^:]*\:[ ]*:'"$object"'\: :' > "$tmpdepfile" + rm -f "$depfile" + cat < "$tmpdepfile" > "$depfile" + tr ' ' ' +' < "$tmpdepfile" | \ +## Some versions of the HPUX 10.20 sed can't process this invocation +## correctly. Breaking it into two sed invocations is a workaround. + sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +dashXmstdout) + # This case only exists to satisfy depend.m4. It is never actually + # run, as this mode is specially recognized in the preamble. + exit 1 + ;; + +makedepend) + "$@" || exit $? + # Remove any Libtool call + if test "$libtool" = yes; then + while test $1 != '--mode=compile'; do + shift + done + shift + fi + # X makedepend + shift + cleared=no + for arg in "$@"; do + case $cleared in + no) + set ""; shift + cleared=yes ;; + esac + case "$arg" in + -D*|-I*) + set fnord "$@" "$arg"; shift ;; + # Strip any option that makedepend may not understand. Remove + # the object too, otherwise makedepend will parse it as a source file. + -*|$object) + ;; + *) + set fnord "$@" "$arg"; shift ;; + esac + done + obj_suffix="`echo $object | sed 's/^.*\././'`" + touch "$tmpdepfile" + ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@" + rm -f "$depfile" + cat < "$tmpdepfile" > "$depfile" + sed '1,2d' "$tmpdepfile" | tr ' ' ' +' | \ +## Some versions of the HPUX 10.20 sed can't process this invocation +## correctly. Breaking it into two sed invocations is a workaround. + sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" "$tmpdepfile".bak + ;; + +cpp) + # Important note: in order to support this mode, a compiler *must* + # always write the preprocessed file to stdout. + "$@" || exit $? + + # Remove the call to Libtool. + if test "$libtool" = yes; then + while test $1 != '--mode=compile'; do + shift + done + shift + fi + + # Remove `-o $object'. + IFS=" " + for arg + do + case $arg in + -o) + shift + ;; + $object) + shift + ;; + *) + set fnord "$@" "$arg" + shift # fnord + shift # $arg + ;; + esac + done + + "$@" -E | + sed -n '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' | + sed '$ s: \\$::' > "$tmpdepfile" + rm -f "$depfile" + echo "$object : \\" > "$depfile" + cat < "$tmpdepfile" >> "$depfile" + sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +msvisualcpp) + # Important note: in order to support this mode, a compiler *must* + # always write the preprocessed file to stdout, regardless of -o, + # because we must use -o when running libtool. + "$@" || exit $? + IFS=" " + for arg + do + case "$arg" in + "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI") + set fnord "$@" + shift + shift + ;; + *) + set fnord "$@" "$arg" + shift + shift + ;; + esac + done + "$@" -E | + sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::echo "`cygpath -u \\"\1\\"`":p' | sort | uniq > "$tmpdepfile" + rm -f "$depfile" + echo "$object : \\" > "$depfile" + . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s:: \1 \\:p' >> "$depfile" + echo " " >> "$depfile" + . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s::\1\::p' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +none) + exec "$@" + ;; + +*) + echo "Unknown depmode $depmode" 1>&2 + exit 1 + ;; +esac + +exit 0 diff --git a/app/lbxproxy/design b/app/lbxproxy/design new file mode 100644 index 000000000..c76a7da95 --- /dev/null +++ b/app/lbxproxy/design @@ -0,0 +1,266 @@ + LBX design notes + ---------------- + +Much of LBX is implemented as an extension. Some modifications have +been made to the Xserver OS layer to support its requirements, but +the only other impact LBX has on the core server are some hooks for +supporting tags. + +Flow control + + LBX multiplexes the data streams of all its clients into one, and then + splits them apart again when they are received. The X_LbxSwitch message + is used to tell each end which client is using the wire at the time. + +Swapping + + Swapping is handled as with any X extension, with one caveat. + Since a proxy can be supporting clients with different byte orders, + and they all share the same wire, all length fields are converted + to be sent in the proxy byte order. This prevents any problems with + length computation that may occur when clients are switched. + +Tags + + Tags are used to support large data items that are expected to be + queried multiple times. Such things as the keyboard map and font + metrics are often requested by multiple clients. Rather than send the + data each time, the first time the data is sent it includes a tag. + The proxy saves this data, so that subsequent requests can send + only the tag. The proxy then pulls up its local copy of the data + and sends it on to its clients. + + To support this, the Xserver keeps track of what tags are known to + the proxy. The proxy can send InvalidateTag messages if it doesn't + store the tagged data. The server also sends InvalidateTag messages + when the data changes, to allow the proxy to clean out obsolete data. + + If the server & proxy get out of sync, and the proxy receives a + tag which is cannot resolve, it can send a QueryTag message and the + server will respond with the requested data. + + Property data makes special use of tags. A common use of properties + is for inter-client communication. If both clients use the proxy, + its wasteful to send the data to the server and then back, when + the server may never need it. X_LbxChangeProperty does the + same work as X_ChangeProperty, but it does not send the data. + X_LbxChangeProperty replies with a tag which points to the data. + If the property information is used locally, the server responds to + X_LbxGetProperty with a tag, and the property data need never be + sent to the server. If the server does require the data, it can + issue a QueryTag message. The proxy can also send the data on at + any time if it thinks its appropriate (ie, wire goes idle). + + The heuristics of property handling can be complex. Because + X_LbxChangeProperty is a round-trip, it can take longer to use it + than X_ChangeProperty for some wires, especially if the amount of + property data is small. Using X_LbxChangeProperty can also be + a mistake for ICCCM properties, if the window manager is not a + proxy client. + +Tag caching + + The proxy contains a tag caching system that allows it to store a + controlled amount of tag data. Limited proxy hosts may wish to use + small caches or none at all. When the cache becomes full, it will + throw out the oldest data (and send the appropriate InvalidateTag + message to the Xserver). + + Currently two tag caches are used, one for properties and another + for other data types. This may want to be modified to separate + out font metrics. + + All tagged data is stored in the proxy byte order. + +Short-circuiting + + Short-circuiting is used to handle 'constant' data. This includes + atoms, colorname/RGB mappings, and AllocColor calls. Atoms and + colorname/RGB mappings stay constant for the life of the server. + AllocColor replies are constant for each colormap. Short-circuiting + replaces round-trip requests with one-way requests, and can sometimes + use one in place of many. + + Atoms are used heavily for ICCCM communication. Once the proxy knows + the string<->atom mapping, it has no need to send the request on to + the server. + + Colorname/RGB mappings are constant, so once the proxy sees the + response from X_LookupColor, it need not forward any subsequent + requests. + + Clients often use the same color cells, so once a read-only color + allocation has occurred, the proxy knows what RGB values should + be returned to the client. The proxy doesn't need to forward any + AllocColor requests it can resolve, but it must tell the server to + modify the color cell's reference count. X_LbxIncrementPixel is + used to support this. + + For all three classes of short-circuiting, the server must still + tell the server a request has occured, so that the request sequence + numbers stay in sync. This is done with X_LbxModifySequence. + + Sequence numbers cause the major complication with short-circuiting. + X guarantees that any replies, events or errors generated by a + previous request will be sent before those of a later request. + This means that any requests that can be handled by the proxy must + have their reply sent after any previous events or errors. + + There are 3 possible ways to support short-circuiting: + + - fully correct protocol, which ensures that nothing can be out + of order + - mostly correct protocol, where only errors can be out of order + - poor protocol, where events & errors can be out of order. + + A smart client or test suite could send a request it knows will + generate an event or error, followed by an InternAtom request, + and get the InternAtom reply before it gets the event. + + Xlib hides this problem from most applications, so the 'poor' + protocol can be sufficient. For a fully safe environment, the proxy + can be compiled to use any of the three forms (or no short-circuiting + at all). In no case do we allow replies to come back out of order. + The proxy knows what can come back from all the core requests -- + for any extensions it assumes the worst case and expects a reply. + +Reply matching + + LBX needs to store information about certain requests to support both + tags and short-circuiting. To do this, it creates a Reply record for + each request that can return a reply. Most of these are only used + as place holders, but for special requests data is stashed in them + (eg, InternAtom needs to save the atom name, so it can store it with + the returned Atom.) + + Using the core protocol and Xlib, there is usually only one + pending Reply record per client. One common exception is caused by + XGetWIndowAttributes(), which sends two roundtrip requests and then + collects the results from both. + + Test suites and interfaces other than Xlib may not follow this + convention, and could result in a number of pending Reply records. + + The worst case are extensions. If the proxy doesn't know about + them, it must assume the worst case, and create a Reply record for + each extension request. These cannot be cleaned out until data + comes back from the server (event, error or reply), which allows + the proxy to flush any Reply records with older sequence numbers. + This has the potential to eat a huge amount of proxy memory, if an + extension issues a huge number of one-way requests. + +Motion events + + To prevent clogging the wire with MotionNotify events, the server and + proxy work together to minimize the number of events on the wire. + This is done with X_LbxAllowMotion. The proxy determines how many + events 'fill' the wire (currently hardcoded -- should be computed) and + 'allows' that many events. When the server generates a MotionEvent + for a proxy client, it decrements the allowed number, throwing away + any after the wire is full. When the proxy receives a MotionNotify, + it sends an X_LbxAllowMotion to the server. + +Delta cache + + LBX takes advantage of the fact that an X message may be very similar + to one that has been previously sent. For example, a KeyPress event + may differ from a previous KeyPress event in just a few bytes. By + sending just the bytes that differ (or "deltas"), the number of bytes + sent over the wire can be substantially reduced. Delta compaction is + used on requests being sent by the proxy as well as on replies and + events being sent by the server. + + Both the server and the proxy keep a cache of the N (currently + defaulted to 16) X messages sent and received. Only messages + smaller than a fixed maximum (currently defaulted to 64) are + saved in the delta cache. + + Whenever the server has a message to send, and the message is of + appropriate length, the message is compared to any same-length messages + in its send cache. The message with the fewest number of differing + bytes is selected. If the number of differences is small enough and + the resulting X_LbxDelta message would not be longer than the original + message, the X_LbxDelta message is sent in place of the original. + The original message must also be place in the send cache. The proxy + uses the same algorithm when it has a message to send to the server. + +Compression + Before being passed down to the transport layer, all messages are + passed through a general purpose data compressor (currently only LZW is + supported). The LZW compressor is presented with a simple byte stream - + the X and LBX message boundaries are not apparent. The data is + broken up into fixed sized blocks. Each block is compressed, then a two + byte header is prepended, and then the entire packet is transmitted. + (NOTE: LBX is designed to allow other compression algorithms to be used + instead of LZW. However, there is no requirement that the packet format + used for LZW be used for implementations involving other compression + algorithms.) The LZW compressor also provides for the ability to transmit + data uncompressed. This is useful when the data has already been + compressed by some other means (eg. a bitmap may be compressed using a + FAX G4 encoding) and further compression would not be effective. + + The LZW compressor attempts to buffer up enough raw data to fill out a + complete block before actually compressing the data. This improves + compression efficiency. However, the LZW buffers are always flushed + before the server/proxy goes to sleep to await more data. + +Master Client + When the initial X connection between the proxy and the server is + converted to LBX mode, the proxy itself becomes the "master" client. + New client requests and some tags related messages are sent in the + context of the master client. + +Server Grabs + The master client must be grab-proof because the server may need to + retrieve tagged data from the proxy at any time. Since the master client + is multiplexed onto the same connection as other clients, the other + clients effectively become grab-proof as well. While the server is + grabbed, messages for non-master clients can be buffered. However, it's + possible for some client to eat up a large amount of buffer space before + the server is ungrabbed. In order to counteract this, when the server + is grabbed, an X_LbxListenToOne message will be sent to the proxy. If + the client grabbing the server belongs to the proxy, then only master + client and grabbing client messages will be transmitted to the server. + If the grabbing client does not belong to the proxy, then only master + client messages will be transmitted. The server will transmit an + X_LbxListenToAll to the proxy when the server is ungrabbed. + +Graphics Re-encoding + + The LBX proxy attempts to reencode X_PolyPoint, X_PolyLine, X_PolySegment, + X_PolyRectangle, X_PolyArc, X_FillPoly, X_PolyFillRectangle, and + X_PolyFillArc requests. If the request can be reencoded, it is + replaced by an equivalent LBX form of the request. The requests + are reencoded by attempting to reduce all 2-byte coordinate, length, + width and angle fields to 1 byte. Where applicable, the coordinate mode + is also converted to "previous" to improve the compressibility of the + resulting data. + +Data Flow + + The LBX data stream goes through a number of layers, all of which + should be negotiable: + + 0. client requests + + 1. read by LBX proxy + 2. potential byte-swapping + 3. requests-specific processing and reencoding + 4. potential byte swapping + 5. delta replacement + 6. stream (LZW) compression + + transport + + 5. stream decompression + 4. delta substitution + 3. potential byte swapping + 2. re-encoding + 1. request processing + + The reverse process occurs with X server replies/events/errors. + + +-------- +$NCDXorg: @(#)design,v 1.4 1994/04/11 18:17:03 lemke Exp $ +$Xorg: design,v 1.3 2000/08/17 19:53:53 cpqbld Exp $ diff --git a/app/lbxproxy/di/atomcache.c b/app/lbxproxy/di/atomcache.c new file mode 100644 index 000000000..5cb214c20 --- /dev/null +++ b/app/lbxproxy/di/atomcache.c @@ -0,0 +1,286 @@ +/* $Xorg: atomcache.c,v 1.4 2001/02/09 02:05:31 xorgcvs Exp $ */ +/* + +Copyright 1998 The Open Group + +Permission to use, copy, modify, distribute, and sell this software and its +documentation for any purpose is hereby granted without fee, provided that +the above copyright notice appear in all copies and that both that +copyright notice and this permission notice appear in supporting +documentation. + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the name of The Open Group shall not be +used in advertising or otherwise to promote the sale, use or other dealings +in this Software without prior written authorization from The Open Group. + +*/ +/* + * Copyright 1994 Network Computing Devices, Inc. + * + * Permission to use, copy, modify, distribute, and sell this software and + * its documentation for any purpose is hereby granted without fee, provided + * that the above copyright notice appear in all copies and that both that + * copyright notice and this permission notice appear in supporting + * documentation, and that the name Network Computing Devices, Inc. not be + * used in advertising or publicity pertaining to distribution of this + * software without specific, written prior permission. + * + * THIS SOFTWARE IS PROVIDED `AS-IS'. NETWORK COMPUTING DEVICES, INC., + * DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING WITHOUT + * LIMITATION ALL IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A + * PARTICULAR PURPOSE, OR NONINFRINGEMENT. IN NO EVENT SHALL NETWORK + * COMPUTING DEVICES, INC., BE LIABLE FOR ANY DAMAGES WHATSOEVER, INCLUDING + * SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES, INCLUDING LOSS OF USE, DATA, + * OR PROFITS, EVEN IF ADVISED OF THE POSSIBILITY THEREOF, AND REGARDLESS OF + * WHETHER IN AN ACTION IN CONTRACT, TORT OR NEGLIGENCE, ARISING OUT OF OR IN + * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + * + */ +/* $XFree86: xc/programs/lbxproxy/di/atomcache.c,v 1.6 2001/12/14 20:00:50 dawes Exp $ */ + +/* + * atom cache for LBX + * + * real close to standard atom code, but with a slight twist. + * LBX doesn't want to invent the Atom associated with a string, + * but insert it itself. only LbxMakeAtom() ends up being modified. + * + * the end result is a (probably) sparse array of atoms. + * + * when a client does a GetAtomName(), we use NameForAtom() + * - if it works, great, return the value. + * - if its doesn't, send it on to the server, and when the answer + * comes back, call LbxMakeAtom() + * + * when a client does InternAtom(), LbxMakeAtom() is called. + * if its already there (or only-if-exists is true) we return + * the appropriate value. if not, we send it on to the server, + * and call LbxMakeAtom() with the answer. + */ + + +#include "misc.h" +#include "util.h" +#include "wire.h" +#include "atomcache.h" + +static int +Hash(string, len) + char *string; + int len; +{ + int h; + + h = 0; + while (len--) + h = (h << 3) ^ *string++; + if (h < 0) + return -h; + return h; +} + +static Bool +ResizeHashTable(server) + XServerPtr server; +{ + int newHashSize; + int newHashMask; + AtomListPtr *newHashTable; + int i; + int h; + int newRehash; + int r; + + if (server->hashSize == 0) + newHashSize = 1024; + else + newHashSize = server->hashSize * 2; + newHashTable = (AtomListPtr *) xalloc(newHashSize * sizeof(AtomListPtr)); + if (!newHashTable) + return FALSE; + bzero((char *) newHashTable, newHashSize * sizeof(AtomListPtr)); + newHashMask = newHashSize - 1; + newRehash = (newHashMask - 2); + for (i = 0; i < server->hashSize; i++) { + if (server->hashTable[i]) { + h = (server->hashTable[i]->hash) & newHashMask; + if (newHashTable[h]) { + r = server->hashTable[i]->hash % newRehash | 1; + do { + h += r; + if (h >= newHashSize) + h -= newHashSize; + } while (newHashTable[h]); + } + newHashTable[h] = server->hashTable[i]; + } + } + xfree(server->hashTable); + server->hashTable = newHashTable; + server->hashSize = newHashSize; + server->hashMask = newHashMask; + server->rehash = newRehash; + return TRUE; +} + +static Bool +ResizeReverseMap(server, atom) + XServerPtr server; + Atom atom; +{ + int oldMapSize = 0; + + /* has the map already been initialized? */ + if (server->reverseMapSize <= 0) + server->reverseMapSize = 1000; + else + /* keep track of the map size before we resize it */ + oldMapSize = server->reverseMapSize; + + /* grow the map until it is big enough */ + while (server->reverseMapSize < atom) + server->reverseMapSize *= 2; + + /* resize the map */ + server->reverseMap = (AtomListPtr *) xrealloc(server->reverseMap, + server->reverseMapSize * sizeof(AtomListPtr)); + + if (!server->reverseMap) + /* memory allocation problem */ + return FALSE; + + /* zero out the new portion of the map */ + bzero((char *) (server->reverseMap + oldMapSize), + ((server->reverseMapSize - oldMapSize) * sizeof(AtomListPtr))); + + return TRUE; +} + +Atom +LbxMakeAtom(server, string, len, atom, makeit) + XServerPtr server; + char *string; + Atom atom; + unsigned len; + int makeit; +{ + AtomListPtr a; + int hash; + int h = 0; + int r; + + hash = Hash(string, len); + if (server->hashTable) { + h = hash & server->hashMask; + if (server->hashTable[h]) { + if (server->hashTable[h]->hash == hash && + server->hashTable[h]->len == len && + !strncmp(server->hashTable[h]->name, string, len)) { + return server->hashTable[h]->atom; + } + r = (hash % server->rehash) | 1; + for (;;) { + h += r; + if (h >= server->hashSize) + h -= server->hashSize; + if (!server->hashTable[h]) + break; + if (server->hashTable[h]->hash == hash && + server->hashTable[h]->len == len && + !strncmp(server->hashTable[h]->name, string, len)) { + return server->hashTable[h]->atom; + } + } + } + } + if (!makeit) + return None; + a = (AtomListPtr) xalloc(sizeof(AtomListRec) + len + 1); + a->name = (char *) (a + 1); + a->len = len; + strncpy(a->name, string, len); + a->name[len] = '\0'; + a->atom = atom; + if (atom > server->lastAtom) + server->lastAtom = atom; + a->hash = hash; + if (server->hashUsed >= server->hashSize / 2) { + ResizeHashTable(server); + h = hash & server->hashMask; + if (server->hashTable[h]) { + r = (hash % server->rehash) | 1; + do { + h += r; + if (h >= server->hashSize) + h -= server->hashSize; + } while (server->hashTable[h]); + } + } + server->hashTable[h] = a; + server->hashUsed++; + a->flags = 0; + for (r = 0; r < server->atom_control_count; r++) { + if (a->len == server->atom_control[r].len && + !strncmp(a->name, server->atom_control[r].name, a->len)) { + a->flags = server->atom_control[r].flags; + break; + } + } + if (server->reverseMapSize <= a->atom) + ResizeReverseMap(server, a->atom); + server->reverseMap[a->atom] = a; + return a->atom; +} + +char * +NameForAtom(server, atom) + XServerPtr server; + Atom atom; +{ + if (atom != None && atom <= server->lastAtom && server->reverseMap[atom]) + return server->reverseMap[atom]->name; + return 0; +} + +unsigned +FlagsForAtom(server, atom) + XServerPtr server; + Atom atom; +{ + if (atom != None && atom <= server->lastAtom && server->reverseMap[atom]) + return server->reverseMap[atom]->flags; + return 0; +} + +void +FreeAtoms() +{ + int i; + + for (i=0; i < lbxMaxServers; i++) { + if (servers[i]) { + if (servers[i]->reverseMap) { + for (i = 0; i <= servers[i]->lastAtom; i++) + xfree(servers[i]->reverseMap[i]); + xfree(servers[i]->reverseMap); + } + xfree(servers[i]->hashTable); + servers[i]->reverseMapSize = 0; + servers[i]->reverseMap = NULL; + servers[i]->hashTable = NULL; + servers[i]->lastAtom = 0; + servers[i]->hashSize = 0; + servers[i]->hashUsed = 0; + } + } +} diff --git a/app/lbxproxy/di/cache.c b/app/lbxproxy/di/cache.c new file mode 100644 index 000000000..c3a3a4fdc --- /dev/null +++ b/app/lbxproxy/di/cache.c @@ -0,0 +1,352 @@ +/* $Xorg: cache.c,v 1.5 2001/02/09 02:05:31 xorgcvs Exp $ */ +/* +Copyright 1994, 1998 The Open Group + +Permission to use, copy, modify, distribute, and sell this software and its +documentation for any purpose is hereby granted without fee, provided that +the above copyright notice appear in all copies and that both that +copyright notice and this permission notice appear in supporting +documentation. + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the name of The Open Group shall not be +used in advertising or otherwise to promote the sale, use or other dealings +in this Software without prior written authorization from The Open Group. + + * Copyright 1990, 1991 Network Computing Devices; + * Portions Copyright 1987 by Digital Equipment Corporation + * + * Permission to use, copy, modify, distribute, and sell this software and its + * documentation for any purpose is hereby granted without fee, provided that + * the above copyright notice appear in all copies and that both that + * copyright notice and this permission notice appear in supporting + * documentation, and that the names of Network Computing Devices, + * or Digital not be used in advertising or + * publicity pertaining to distribution of the software without specific, + * written prior permission. Network Computing Devices, or Digital + * make no representations about the + * suitability of this software for any purpose. It is provided "as is" + * without express or implied warranty. + * + * NETWORK COMPUTING DEVICES, AND DIGITAL DISCLAIM ALL WARRANTIES WITH + * REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY + * AND FITNESS, IN NO EVENT SHALL NETWORK COMPUTING DEVICES, OR DIGITAL BE + * LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION + * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN + * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + * + */ +/* $XFree86: xc/programs/lbxproxy/di/cache.c,v 1.6tsi Exp $ */ +#include "misc.h" +#include "util.h" +#include "cache.h" +#include "wire.h" + +#define INITBUCKETS 64 +#define INITHASHSIZE 6 +#define MAXHASHSIZE 11 + + +#define ENTRYOFFSET 22 +#define CACHE_ENTRY_MASK 0x3FFFFF +#define CACHE_ENTRY_BITS(id) ((id) & 0x1fc00000) +#define CACHE_ID(id) ((int)(CACHE_ENTRY_BITS(id) >> ENTRYOFFSET)) + +typedef struct _cache_entry { + pointer data; + unsigned long timestamp; + CacheID id; + unsigned long size; + CacheFree free_func; + ClientPtr client; /* for a server's serverClient */ + struct _cache_entry *next; +} CacheEntryRec, *CacheEntryPtr; + +typedef struct _cache { + Cache id; + CacheEntryPtr *entries; + int elements; + int buckets; + int hashsize; + CacheID nextid; + unsigned long maxsize; + unsigned long cursize; +} CacheRec; + + +/*- + * Notes on cache implementation + * + * This is basically the X11 resource code, with some modifications + * to handle aging. + * + * Its currently optimized for lookup & store. Flushing old stuff + * is a lot slower than it should probably be, but there's tradeoffs + * in tuning. + */ + +Cache +CacheInit(server, maxsize) + XServerPtr server; + unsigned long maxsize; +{ + Cache id; + CachePtr cache; + + cache = (CachePtr) xalloc(sizeof(CacheRec)); + if (!cache) + return (Cache) 0; + cache->entries = (CacheEntryPtr *) + xalloc(INITBUCKETS * sizeof(CacheEntryPtr)); + if (!cache->entries) { + xfree(cache); + return (Cache) 0; + } + bzero((char *) cache->entries, (INITBUCKETS * sizeof(CacheEntryPtr))); + id = (Cache) ++server->num_caches; + server->caches[id] = cache; + cache->elements = 0; + cache->buckets = INITBUCKETS; + cache->hashsize = INITHASHSIZE; + cache->maxsize = maxsize; + cache->cursize = 0; + cache->nextid = id << ENTRYOFFSET; + cache->id = id; + return id; +} + +void +CacheFreeCache(server, cid) + XServerPtr server; + Cache cid; +{ + CachePtr cache = server->caches[cid]; + int i; + CacheEntryPtr cp; + + for (i = 0; i < cache->buckets; i++) { + while ((cp = cache->entries[i])) { + cache->entries[i] = cp->next; + (*cp->free_func) (cp->id, cp->client, cp->data, CacheWasReset); + xfree(cp); + } + } + server->caches[cid] = NULL; + server->num_caches = 0; + server->seed = 0; + + xfree(cache->entries); + xfree(cache); +} + +static int +hash(server, cid, id) + XServerPtr server; + Cache cid; + CacheID id; +{ + CachePtr cache = server->caches[cid]; + + switch (cache->hashsize) { +#if INITHASHSIZE < 6 + case 2: + return ((int) (0x03 & (id ^ (id >> 2) ^ (id >> 8)))); + case 3: + return ((int) (0x07 & (id ^ (id >> 3) ^ (id >> 9)))); + case 4: + return ((int) (0x0F & (id ^ (id >> 4) ^ (id >> 10)))); + case 5: + return ((int) (0x01F & (id ^ (id >> 5) ^ (id >> 11)))); +#endif + case 6: + return ((int) (0x03F & (id ^ (id >> 6) ^ (id >> 12)))); + case 7: + return ((int) (0x07F & (id ^ (id >> 7) ^ (id >> 13)))); + case 8: + return ((int) (0x0FF & (id ^ (id >> 8) ^ (id >> 16)))); + case 9: + return ((int) (0x1FF & (id ^ (id >> 9)))); + case 10: + return ((int) (0x3FF & (id ^ (id >> 10)))); + case 11: + return ((int) (0x7FF & (id ^ (id >> 11)))); + } + return -1; +} + +static void +rebuild_cache(server, cache) + XServerPtr server; + CachePtr cache; +{ + int j; + CacheEntryPtr cp, next, **tails, *entries, **tptr, *cptr; + + j = cache->buckets << 1; + tails = (CacheEntryPtr **) ALLOCATE_LOCAL(j * sizeof(CacheEntryPtr *)); + if (!tails) + return; + entries = (CacheEntryPtr *) xalloc(j * sizeof(CacheEntryPtr)); + if (!entries) { + DEALLOCATE_LOCAL(tails); + return; + } + for (cptr = entries, tptr = tails; --j >= 0; cptr++, tptr++) { + *cptr = NULL; + *tptr = cptr; + } + cache->hashsize++; + for (j = cache->buckets, cptr = cache->entries; --j >= 0; cptr++) { + for (cp = *cptr; cp; cp = next) { + next = cp->next; + cp->next = NULL; + tptr = &tails[hash(server, cache->id, cp->id)]; + **tptr = cp; + *tptr = &cp->next; + } + } + DEALLOCATE_LOCAL(tails); + cache->buckets <<= 1; + xfree(cache->entries); + cache->entries = entries; +} + +static void +flush_cache(CachePtr cache, unsigned long needed) +{ + CacheEntryPtr cp, *prev, oldest, *oldprev = NULL; + int i; + + while ((cache->cursize + needed) > cache->maxsize) { + oldest = NULL; + /* find oldest */ + for (i = 0; i < cache->buckets; i++) { + for (prev = &cache->entries[i]; (cp = *prev); prev = &cp->next) { + if (!oldest || (cp->timestamp < oldest->timestamp)) { + oldest = cp; + oldprev = prev; + } + } + } + if (!oldest) + break; + /* clobber it */ + cache->elements--; + cache->cursize -= oldest->size; + *oldprev = oldest->next; + (*oldest->free_func) (oldest->id, oldest->client, oldest->data, CacheEntryOld); + xfree(oldest); + } +} + +Bool +CacheTrimNeeded(server, cid) + XServerPtr server; + Cache cid; +{ + CachePtr cache = server->caches[cid]; + + return cache->cursize > cache->maxsize; +} + +void +CacheTrim(server, cid) + XServerPtr server; + Cache cid; +{ + flush_cache(server->caches[cid], 0); +} + +Bool +CacheStoreMemory(server, cid, id, data, size, free_func, can_flush) + XServerPtr server; + Cache cid; + CacheID id; + pointer data; + unsigned long size; + CacheFree free_func; + Bool can_flush; +{ + CacheEntryPtr cp, *head; + CachePtr cache = server->caches[cid]; + + if (can_flush && (size > cache->maxsize)) /* beyond cache limits */ + return FALSE; + cp = (CacheEntryPtr) xalloc(sizeof(CacheEntryRec)); + if (!cp) + return FALSE; + if (can_flush && ((cache->cursize + size) > cache->maxsize)) + flush_cache(cache, size); + if ((cache->elements >= (cache->buckets << 2)) && + (cache->hashsize < MAXHASHSIZE)) + rebuild_cache(server, cache); + head = &cache->entries[hash(server, cid, id)]; + cp->next = *head; + cp->id = id; + cp->timestamp = ++server->seed; + cp->free_func = free_func; + cp->size = size; + cp->data = data; + cp->client = server->serverClient; + cache->cursize += size; + cache->elements++; + *head = cp; + return TRUE; +} + +pointer +CacheFetchMemory(server, cid, id, update) + XServerPtr server; + Cache cid; + CacheID id; + Bool update; +{ + CachePtr cache = server->caches[cid]; + CacheEntryPtr cp, + *head; + + head = &cache->entries[hash(server, cid, id)]; + for (cp = *head; cp; cp = cp->next) { + if (cp->id == id) { + if (update) + cp->timestamp = ++server->seed; + return cp->data; + } + } + return NULL; +} + +void +CacheFreeMemory(server, cacheid, cid, notify) + XServerPtr server; + Cache cacheid; + CacheID cid; + Bool notify; +{ + CachePtr cache = server->caches[cacheid]; + CacheEntryPtr cp, *prev; + + for (prev = &cache->entries[hash(server, cacheid, cid)]; + (cp = *prev); + prev = &cp->next) { + if (cp->id == cid) { + *prev = cp->next; + cache->elements--; + cache->cursize -= cp->size; + if (notify) + (*cp->free_func)(cid, cp->client, cp->data, CacheEntryFreed); + xfree(cp); + break; + } + } +} diff --git a/app/lbxproxy/di/cmap.c b/app/lbxproxy/di/cmap.c new file mode 100644 index 000000000..1102ab5b8 --- /dev/null +++ b/app/lbxproxy/di/cmap.c @@ -0,0 +1,1771 @@ +/* $Xorg: cmap.c,v 1.5 2001/02/09 02:05:31 xorgcvs Exp $ */ +/* $XdotOrg: $ */ + +/* +Copyright 1996, 1998 The Open Group + +Permission to use, copy, modify, distribute, and sell this software and its +documentation for any purpose is hereby granted without fee, provided that +the above copyright notice appear in all copies and that both that +copyright notice and this permission notice appear in supporting +documentation. + +The above copyright notice and this permission notice shall be included +in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR +OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the name of The Open Group shall +not be used in advertising or otherwise to promote the sale, use or +other dealings in this Software without prior written authorization +from The Open Group. +*/ + +/* + * Copyright 1994 Network Computing Devices, Inc. + * + * Permission to use, copy, modify, distribute, and sell this software and + * its documentation for any purpose is hereby granted without fee, provided + * that the above copyright notice appear in all copies and that both that + * copyright notice and this permission notice appear in supporting + * documentation, and that the name Network Computing Devices, Inc. not be + * used in advertising or publicity pertaining to distribution of this + * software without specific, written prior permission. + * + * THIS SOFTWARE IS PROVIDED `AS-IS'. NETWORK COMPUTING DEVICES, INC., + * DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING WITHOUT + * LIMITATION ALL IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A + * PARTICULAR PURPOSE, OR NONINFRINGEMENT. IN NO EVENT SHALL NETWORK + * COMPUTING DEVICES, INC., BE LIABLE FOR ANY DAMAGES WHATSOEVER, INCLUDING + * SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES, INCLUDING LOSS OF USE, DATA, + * OR PROFITS, EVEN IF ADVISED OF THE POSSIBILITY THEREOF, AND REGARDLESS OF + * WHETHER IN AN ACTION IN CONTRACT, TORT OR NEGLIGENCE, ARISING OUT OF OR IN + * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + * + */ +/* $XFree86: xc/programs/lbxproxy/di/cmap.c,v 1.6 2001/12/14 20:00:50 dawes Exp $ */ + +#include +#include "assert.h" +#include "misc.h" +#include "lbx.h" +#include "atomcache.h" +#include "util.h" +#include "tags.h" +#include "colormap.h" +#include "resource.h" +#include "wire.h" +#include "swap.h" +#include "reqtype.h" +#include "lbxext.h" + +static void LocalAllocColor (); +static void FoundPixel (); +static Bool grab_cmap_reply(); +static Bool alloc_named_color_reply(); +static Bool alloc_color_cells_reply(); +static Bool alloc_color_planes_reply(); +static Bool lookup_color_reply(); + +/* ------------------------------------------------------------------------- */ + +/* + * ResolveColor scales down an rgb to the specified number of bits. + */ + +void +ResolveColor (pVisual, red, green, blue) + LbxVisualPtr pVisual; + CARD16 *red, *green, *blue; +{ + int shift = 16 - pVisual->bitsPerRGB; + unsigned lim = (1 << pVisual->bitsPerRGB) - 1; + unsigned limr, limg, limb; + + switch (pVisual->class) { + case PseudoColor: + case DirectColor: + case StaticColor: + /* rescale to rgb bits */ + *red = ((*red >> shift) * 65535) / lim; + *green = ((*green >> shift) * 65535) / lim; + *blue = ((*blue >> shift) * 65535) / lim; + break; + case GrayScale: + /* rescale to gray then rgb bits */ + *red = (30L * *red + 59L * *green + 11L * *blue) / 100; + *blue = *green = *red = ((*red >> shift) * 65535) / lim; + break; + case StaticGray: + limg = pVisual->colormapEntries - 1; + /* rescale to gray then [0..limg] then [0..65535] then rgb bits */ + *red = (30L * *red + 59L * *green + 11L * *blue) / 100; + *red = ((((*red * (limg + 1))) >> 16) * 65535) / limg; + *blue = *green = *red = ((*red >> shift) * 65535) / lim; + break; + case TrueColor: + limr = NUMRED(pVisual) - 1; + limg = NUMGREEN(pVisual) - 1; + limb = NUMBLUE(pVisual) - 1; + /* rescale to [0..limN] then [0..65535] then rgb bits */ + *red = ((((((*red * (limr + 1)) >> 16) * + 65535) / limr) >> shift) * 65535) / lim; + *green = ((((((*green * (limg + 1)) >> 16) * + 65535) / limg) >> shift) * 65535) / lim; + *blue = ((((((*blue * (limb + 1)) >> 16) * + 65535) / limb) >> shift) * 65535) / lim; + break; + } +} + +void (* LbxResolveColor)( + LbxVisualPtr /* pVisual */, + CARD16* /* red */, + CARD16* /* green */, + CARD16* /* blue */ +) = ResolveColor; + +static Pixel +find_cell(pent, num, rgb, channel) + Entry *pent; + int num; + CARD32 rgb; + int channel; +{ + Pixel pixel, freep; + + freep = ~((Pixel)0); + for (pixel = 0; pixel < num; pixel++, pent++) { + if (pent->status == PIXEL_SHARED) { + switch (channel) { + case DoRed: + if (pent->red == rgb) + return pixel; + break; + case DoGreen: + if (pent->green == rgb) + return pixel; + break; + case DoBlue: + if (pent->blue == rgb) + return pixel; + break; + } + } + if (pent->status == PIXEL_FREE && freep == ~((Pixel)0)) + freep = pixel; + } + return freep; +} + +/* + * Find a free pixel in the colormap. + */ + +Pixel +FindFreePixel (pmap, red, green, blue) + ColormapPtr pmap; + CARD32 red, green, blue; +{ + Entry *pent; + Pixel pixel, p; + + if (pmap->pVisual->class != DirectColor) { + for (pixel = 0, pent = pmap->red; + pixel < pmap->pVisual->colormapEntries; + pixel++, pent++) + { + if (pent->status == PIXEL_FREE) + return pixel; + } + return ~((Pixel)0); + } + p = find_cell(pmap->red, NUMRED(pmap->pVisual), red, DoRed); + if (p == ~((Pixel)0)) + return p; + pixel = p << pmap->pVisual->offsetRed; + p = find_cell(pmap->green, NUMGREEN(pmap->pVisual), green, DoGreen); + if (p == ~((Pixel)0)) + return p; + pixel |= p << pmap->pVisual->offsetGreen; + p = find_cell(pmap->blue, NUMBLUE(pmap->pVisual), blue, DoBlue); + if (p == ~((Pixel)0)) + return p; + pixel |= p << pmap->pVisual->offsetBlue; + return pixel; +} + +Pixel (* LbxFindFreePixel)( + ColormapPtr /* pmap */, + CARD32 /* red */, + CARD32 /* green */, + CARD32 /* blue */ +) = FindFreePixel; + +typedef unsigned short BigNumUpper; +typedef unsigned long BigNumLower; + +#define BIGNUMLOWERBITS 24 +#define BIGNUMUPPERBITS 16 +#define BIGNUMLOWER (1 << BIGNUMLOWERBITS) +#define BIGNUMUPPER (1 << BIGNUMUPPERBITS) +#define UPPERPART(i) ((i) >> BIGNUMLOWERBITS) +#define LOWERPART(i) ((i) & (BIGNUMLOWER - 1)) + +typedef struct _bignum { + BigNumUpper upper; + BigNumLower lower; +} BigNumRec, *BigNumPtr; + +#define BigNumGreater(x,y) (((x)->upper > (y)->upper) ||\ + (((x)->upper == (y)->upper) &&\ + ((x)->lower > (y)->lower))) + +#define UnsignedToBigNum(u,r) (((r)->upper = UPPERPART(u)), \ + ((r)->lower = LOWERPART(u))) + +#define MaxBigNum(r) (((r)->upper = BIGNUMUPPER-1), \ + ((r)->lower = BIGNUMLOWER-1)) + +static void +BigNumAdd (x, y, r) + BigNumPtr x, y, r; +{ + BigNumLower lower, carry = 0; + + lower = x->lower + y->lower; + if (lower >= BIGNUMLOWER) { + lower -= BIGNUMLOWER; + carry = 1; + } + r->lower = lower; + r->upper = x->upper + y->upper + carry; +} + +Entry * +FindBestPixel(pmap, red, green, blue, channels) + ColormapPtr pmap; + CARD32 red, + green, + blue; + int channels; +{ + Entry *pent; + int num; + Entry *final; + Pixel pixel; + long dr, dg, db; + unsigned long sq; + BigNumRec minval, sum, temp; + + switch(channels) + { + case DoRed: + pent = pmap->red; + num = NUMRED(pmap->pVisual); + break; + case DoGreen: + pent = pmap->green; + num = NUMGREEN(pmap->pVisual); + break; + case DoBlue: + pent = pmap->blue; + num = NUMBLUE(pmap->pVisual); + break; + default: + pent = pmap->red; + num = pmap->pVisual->colormapEntries; + break; + } + final = pent; + MaxBigNum(&minval); + /* look for the minimal difference */ + for (pixel = 0; pixel < num; pent++, pixel++) + { + dr = dg = db = 0; + switch(channels) { + case DoRed: + dr = pent->red - red; + break; + case DoGreen: + dg = pent->green - green; + break; + case DoBlue: + db = pent->blue - blue; + break; + default: + dr = pent->red - red; + dg = pent->green - green; + db = pent->blue - blue; + break; + } + sq = dr * dr; + UnsignedToBigNum (sq, &sum); + sq = dg * dg; + UnsignedToBigNum (sq, &temp); + BigNumAdd (&sum, &temp, &sum); + sq = db * db; + UnsignedToBigNum (sq, &temp); + BigNumAdd (&sum, &temp, &sum); + if (BigNumGreater (&minval, &sum)) + { + final = pent; + minval = sum; + } + } + return final; +} + +Entry * (* LbxFindBestPixel)( + ColormapPtr /* pmap */, + CARD32 /* red */, + CARD32 /* green */, + CARD32 /* blue */, + int /* channels */ +) = FindBestPixel; + + +/* ------------------------------------------------------------------------- */ + +#define PIX_IN(ptr,is2,dst) \ + if (is2) { \ + dst = *ptr++ << 8; dst |= *ptr++; \ + } else \ + dst = *ptr++ + +#define RGB_IN(ptr,is2,lim,dst) \ + if (is2) { \ + dst = *ptr++ << 8; dst |= *ptr++; \ + } else \ + dst = (*ptr++ * 65535) / lim + +static CARD8 * +DecodeChannel(pmap, pent, flags, channels, data) + ColormapPtr pmap; + Entry *pent; + CARD8 flags; + CARD8 channels; + CARD8 *data; +{ + Bool px2; + Bool rgb2; + CARD16 pixel1, pixel2; + int i; + int lim; + CARD8 code; + + px2 = (flags & LBX_2BYTE_PIXELS) != 0; + rgb2 = (flags & LBX_RGB_BITS_MASK) > 7; + lim = (1 << ((flags & LBX_RGB_BITS_MASK) + 1)) - 1; + /* + * All pixels other than the ones specified in the GrabCmap reply + * are implied to be free. Mark all the cells free now, and then + * mark the cells specified in the GrabCmap reply either: + * + * PIXEL_PRIVATE - a read/write cell - proxy can't do local alloc + * in this cell. We don't care about the contents. + * PIXEL_SHARED - a read only cell that can be shared. + */ + + for (i = 0; i < pmap->pVisual->colormapEntries; i++) + { + if ((pent[i].status == PIXEL_SHARED && pent[i].refcnt == 0) || + (pent[i].status == PIXEL_PRIVATE && pent[i].server_ref)) + pent[i].status = PIXEL_FREE; + } + + while ((code = *data++)) + { + if (code == LBX_PIXEL_PRIVATE) + { + PIX_IN(data, px2, pixel1); + + pent[pixel1].pixel = pixel1; + if (pent[pixel1].status != PIXEL_PRIVATE) + pent[pixel1].server_ref = 1; + pent[pixel1].status = PIXEL_PRIVATE; + +#ifdef COLOR_DEBUG + fprintf (stderr, "Got PIXEL_PRIVATE, pixel = %d\n", pixel1); +#endif + } + else if (code == LBX_PIXEL_RANGE_PRIVATE) + { + PIX_IN(data, px2, pixel1); + PIX_IN(data, px2, pixel2); + + for (i = pixel1; i <= pixel2; i++) + { + pent[i].pixel = i; + if (pent[i].status != PIXEL_PRIVATE) + pent[i].server_ref = 1; + pent[i].status = PIXEL_PRIVATE; + } + +#ifdef COLOR_DEBUG + fprintf (stderr, "Got PIXEL_RANGE_PRIVATE, pixels = %d...%d\n", + pixel1, pixel2); +#endif + } + else if (code == LBX_PIXEL_SHARED) + { + PIX_IN(data, px2, pixel1); + + pent[pixel1].pixel = pixel1; + if (pent[pixel1].status != PIXEL_SHARED) + pent[pixel1].refcnt = 0; + pent[pixel1].status = PIXEL_SHARED; + pent[pixel1].server_ref = 1; + if (channels & DoRed) { + RGB_IN(data, rgb2, lim, pent[pixel1].red); + } + if (channels & DoGreen) { + RGB_IN(data, rgb2, lim, pent[pixel1].green); + } + if (channels & DoBlue) { + RGB_IN(data, rgb2, lim, pent[pixel1].blue); + } + +#ifdef COLOR_DEBUG + fprintf (stderr, + "Got PIXEL_SHARED, pixel = %d, rgb = (%d,%d,%d)\n", + pixel1, pent[pixel1].red, pent[pixel1].green, + pent[pixel1].blue); +#endif + } + else if (code == LBX_PIXEL_RANGE_SHARED) + { + PIX_IN(data, px2, pixel1); + PIX_IN(data, px2, pixel2); + +#ifdef COLOR_DEBUG + fprintf (stderr, "Got PIXEL_RANGE_SHARED, pixels = %d...%d\n", + pixel1, pixel2); +#endif + + for (i = pixel1; i <= pixel2; i++) + { + pent[i].pixel = i; + if (pent[i].status != PIXEL_SHARED) + pent[i].refcnt = 0; + pent[i].status = PIXEL_SHARED; + pent[i].server_ref = 1; + if (channels & DoRed) { + RGB_IN(data, rgb2, lim, pent[i].red); + } + if (channels & DoGreen) { + RGB_IN(data, rgb2, lim, pent[i].green); + } + if (channels & DoBlue) { + RGB_IN(data, rgb2, lim, pent[i].blue); + } + +#ifdef COLOR_DEBUG + fprintf (stderr, " pixel = %d, rgb = (%d,%d,%d)\n", + i, pent[i].red, pent[i].green, pent[i].blue); +#endif + } + } + else + break; + } + return data; +} + +static void +GotColormapGrab (pmap, flags, data) + ColormapPtr pmap; + CARD8 flags; + CARD8 *data; +{ + + pmap->grab_status = CMAP_GRABBED; + + if (flags & LBX_SMART_GRAB) + { + /* + * We have a SMART GRAB : since this proxy last ungrabbed the + * colormap, no color cell was alloc'd by an entity other than + * this proxy (this includes other proxies as well as clients + * directly connected to the X server without a proxy). + * + * We want to optimize this special case because a proxy may give + * up a grab because it got a request that it could not handle + * (e.g. AllocNamedColor or LookupColor). When it asks back for + * the grab, there is no need for the server to send the colormap + * state, because the proxy is already up to date on the state of + * the colormap. + * + * In order for this to work, the following assumptions are made + * about the proxy: + * + * - the proxy is kept up to date on all cell allocations made on its + * behalf resulting from the following requests: AllocNamedColor, + * AllocColorCells, AllocColorPlanes + * - the proxy is kept up to date on all cells freed by any client + * via the LbxFreeCell event. + */ + + return; + } + + if ((pmap->pVisual->class | DynamicClass) != DirectColor) + DecodeChannel(pmap, pmap->red, flags, DoRed|DoGreen|DoBlue, data); + else { + data = DecodeChannel(pmap, pmap->red, flags, DoRed, data); + data = DecodeChannel(pmap, pmap->green, flags, DoGreen, data); + DecodeChannel(pmap, pmap->blue, flags, DoBlue, data); + } +} + +static void +GrabCmap (client, pmap, red, green, blue, alloc_named, xred, xgreen, xblue) + ClientPtr client; + ColormapPtr pmap; + CARD16 red, green, blue; + Bool alloc_named; + CARD16 xred, xgreen, xblue; +{ + xLbxGrabCmapReq req; + ReplyStuffPtr nr; + +#ifdef COLOR_DEBUG + fprintf (stderr, "LbxGrabCmapReq: cmap = 0x%x, seq = 0x%x\n", + pmap->id, LBXSequenceNumber(client)); + fprintf (stderr, "suspending %s (%d, %d, %d)\n", + alloc_named ? "AllocNamedColor" : "AllocColor", + red, green, blue); +#endif + + nr = NewReply(client, client->server->lbxReq, X_LbxGrabCmap, + grab_cmap_reply); + if (nr) + { + --nr->sequenceNumber; + nr->request_info.lbxgrabcmap.pmap = pmap; + nr->request_info.lbxgrabcmap.alloc_named = alloc_named; + nr->request_info.lbxgrabcmap.vred = red; + nr->request_info.lbxgrabcmap.vgreen = green; + nr->request_info.lbxgrabcmap.vblue = blue; + nr->request_info.lbxgrabcmap.xred = xred; + nr->request_info.lbxgrabcmap.xgreen = xgreen; + nr->request_info.lbxgrabcmap.xblue = xblue; + } + + req.reqType = client->server->lbxReq; + req.lbxReqType = X_LbxGrabCmap; + req.length = sz_xLbxGrabCmapReq >> 2; + req.cmap = pmap->id; + + if (client->swapped) + SwapGrabCmap (&req); + + WriteReqToServer (client, sz_xLbxGrabCmapReq, (char *) &req, TRUE); + + pmap->grab_status = CMAP_GRAB_REQUESTED; +} + +static Bool +grab_cmap_reply(client, nr, data) + ClientPtr client; + ReplyStuffPtr nr; + char *data; +{ + xLbxGrabCmapReply *reply; + Entry *pent; + + reply = (xLbxGrabCmapReply *) data; + +#ifdef COLOR_DEBUG + fprintf (stderr, "LbxGrabCmapReply: cmap = 0x%x, seq = 0x%x, ", + nr->request_info.lbxgrabcmap.pmap->id, reply->sequenceNumber); + fprintf (stderr, "flags = %x\n", reply->flags); + fprintf (stderr, "resuming %s (%d, %d, %d)\n", + nr->request_info.lbxgrabcmap.alloc_named ? + "AllocNamedColor" : "AllocColor", + nr->request_info.lbxgrabcmap.vred, + nr->request_info.lbxgrabcmap.vgreen, + nr->request_info.lbxgrabcmap.vblue); +#endif + + GotColormapGrab (nr->request_info.lbxgrabcmap.pmap, reply->flags, + (CARD8 *) reply + sz_xLbxGrabCmapReplyHdr); + + /* + * We suspended an AllocColor request so we could grab the colormap. + * Now that the colormap is grabbed we resume handling the AllocColor. + * We first check to see if the color is already allocated. + */ + + FindPixel (client, + nr->request_info.lbxgrabcmap.pmap, + nr->request_info.lbxgrabcmap.vred, + nr->request_info.lbxgrabcmap.vgreen, + nr->request_info.lbxgrabcmap.vblue, + &pent); + + if (pent) + { + /* + * We found the pixel in the proxy's colormap. We can + * immediately short circuit this AllocColor. + */ + + FoundPixel (client, TRUE, nr->request_info.lbxgrabcmap.pmap, pent, + nr->request_info.lbxgrabcmap.alloc_named, + nr->request_info.lbxgrabcmap.xred, + nr->request_info.lbxgrabcmap.xgreen, + nr->request_info.lbxgrabcmap.xblue); + } + else + { + /* + * We didn't find the pixel, but we just grabbed the color map, + * so we can handle the color allocation locally now, then do + * the short circuit. + */ + + LocalAllocColor (client, TRUE, + nr->request_info.lbxgrabcmap.pmap, + nr->request_info.lbxgrabcmap.vred, + nr->request_info.lbxgrabcmap.vgreen, + nr->request_info.lbxgrabcmap.vblue, + nr->request_info.lbxgrabcmap.alloc_named, + nr->request_info.lbxgrabcmap.xred, + nr->request_info.lbxgrabcmap.xgreen, + nr->request_info.lbxgrabcmap.xblue); + } + + return TRUE; +} + + +/* + * Release the colormap currently grabbed by the proxy. + */ + +void +ReleaseCmap (client, pmap) + ClientPtr client; + ColormapPtr pmap; +{ + xLbxReleaseCmapReq req; + + pmap->grab_status = CMAP_NOT_GRABBED; + + req.reqType = client->server->lbxReq; + req.lbxReqType = X_LbxReleaseCmap; + req.length = sz_xLbxReleaseCmapReq >> 2; + req.cmap = pmap->id; + + /* write the request on the proxy control connection */ + + WriteReqToServer (client->server->serverClient, + sz_xLbxReleaseCmapReq, + (char *) &req, + FALSE); +} + +/* ------------------------------------------------------------------------- */ + +static void +DoAllocColorReply (client, in_reply, red, green, blue, pixel) + ClientPtr client; + Bool in_reply; + CARD16 red, green, blue; + Pixel pixel; +{ + /* + * Prepare the AllocColor reply for the client. + */ + + xAllocColorReply reply; + + reply.type = X_Reply; + reply.length = 0; + reply.sequenceNumber = LBXSequenceNumber(client); + + reply.red = red; + reply.green = green; + reply.blue = blue; + reply.pixel = pixel; + + if (client->swapped) + SwapAllocColorReply (&reply); + + if (LBXCacheSafe (client)) + { + /* + * We can write the AllocColor reply now. + */ + + if (!in_reply) + FinishLBXRequest(client, REQ_REPLACE); + + WriteToClient (client, sizeof (xAllocColorReply), &reply); + +#ifdef LBX_STATS + ac_good++; +#endif + } + else + { + /* + * We can't write the AllocColor reply now, we must first sync. + */ + + if (!LBXCanDelayReply(client)) + SendLbxSync (client); + if (!in_reply) + FinishLBXRequest(client, REQ_REPLACELATE); + + /* + * Save the AllocColor reply. We will write it when the + * LbxSync reply comes back. + */ + + SaveReplyData (client, (xReply *) & reply, 0, NULL); + } +} + +static void +DoAllocNamedColorReply (client, in_reply, red, green, blue, pixel, + xred, xgreen, xblue) + ClientPtr client; + Bool in_reply; + CARD16 red, green, blue; + Pixel pixel; + CARD16 xred, xgreen, xblue; +{ + /* + * Prepare the AllocNamedColor reply for the client. + */ + + xAllocNamedColorReply reply; + + reply.type = X_Reply; + reply.length = 0; + reply.sequenceNumber = LBXSequenceNumber(client); + + reply.exactRed = xred; + reply.exactGreen = xgreen; + reply.exactBlue = xblue; + reply.screenRed = red; + reply.screenGreen = green; + reply.screenBlue = blue; + reply.pixel = pixel; + + if (client->swapped) + SwapAllocNamedColorReply (&reply); + + if (LBXCacheSafe (client)) + { + /* + * We can write the AllocColor reply now. + */ + + if (!in_reply) + FinishLBXRequest(client, REQ_REPLACE); + + WriteToClient (client, sizeof (xAllocNamedColorReply), &reply); + +#ifdef LBX_STATS + anc_good++; +#endif + } + else + { + /* + * We can't write the AllocColor reply now, we must first sync. + */ + + if (!LBXCanDelayReply(client)) + SendLbxSync (client); + if (!in_reply) + FinishLBXRequest(client, REQ_REPLACELATE); + + /* + * We can't write the AllocNamedColor reply now, we must first + * sync. You might ask why we didn't just send the AllocNamedColor + * request to the server? The answer is that if the colormap is + * grabbed, we don't want to send the AllocNamedColor to the server + * because that would force the proxy to give up control over the + * colormap. So the proxy generates the reply on its own, but must + * force a round trip sync before the reply is written. + */ + + SaveReplyData (client, (xReply *) & reply, 0, NULL); + +#ifdef LBX_STATS + anc_miss++; +#endif + } +} + +/* + * LocalAllocColor is called when the specified color is not already + * allocated in the colormap, and the proxy has the colormap grabbed. + * The proxy handles the AllocColor locally, and tells the server + * what allocation it made. + * + * (red, green, blue) are actual rgb values, not requested ones - + * they have already been put through ResolveColor. + */ + +static void +LocalAllocColor (client, in_reply, pmap, red, green, blue, alloc_named, + xred, xgreen, xblue) + ClientPtr client; + Bool in_reply; + ColormapPtr pmap; + CARD16 red, green, blue; + Bool alloc_named; + CARD16 xred, xgreen, xblue; +{ + Pixel pixel; + + /* + * First find a free cell. + */ + + pixel = (*LbxFindFreePixel) (pmap, red, green, blue); + + if (pixel == ~((Pixel)0)) + { +#ifdef COLOR_DEBUG + fprintf(stderr, "alloc failed: (%d, %d, %d)\n", red, green, blue); +#endif + if (in_reply) + WriteError(client, + alloc_named ? X_AllocNamedColor : X_AllocColor, + 0, pmap->id, BadAlloc); + else + SendErrorToClient(client, + alloc_named ? X_AllocNamedColor : X_AllocColor, + 0, pmap->id, BadAlloc); + return; + } + +#ifdef COLOR_DEBUG + if (LBXCacheSafe (client)) + fprintf (stderr, + "X %s: short circuiting (allocating color locally):\n", + alloc_named ? "AllocNamedColor" : "AllocColor"); + else + fprintf (stderr, + "X %s: allocating color locally, but need Sync:\n", + alloc_named ? "AllocNamedColor" : "AllocColor"); + + fprintf (stderr, + " seq = 0x%x, cmap = 0x%x, pixel = %d, rgb = (%d,%d,%d)\n", + LBXSequenceNumber(client), pmap->id, pixel, red, green, blue); +#endif + + /* + * Now handle the X AllocColor reply to the client. + */ + + if (alloc_named) + DoAllocNamedColorReply (client, in_reply, red, green, blue, pixel, + xred, xgreen, xblue); + else + DoAllocColorReply (client, in_reply, red, green, blue, pixel); + + /* + * Store the rgb in the cell. + */ + + StorePixel (client, pmap, red, green, blue, pixel, FALSE); +} + + +static void +FoundPixel (client, in_reply, pmap, pent, alloc_named, xred, xgreen, xblue) + ClientPtr client; + Bool in_reply; + ColormapPtr pmap; + Entry *pent; + Bool alloc_named; + CARD16 xred, xgreen, xblue; +{ +#ifdef COLOR_DEBUG + if (LBXCacheSafe (client)) + fprintf (stderr, + "X %s: short circuiting (color already exists):\n", + alloc_named ? "AllocNamedColor" : "AllocColor"); + else + { + fprintf (stderr, + "X %s: color already exists locally, but need Sync:\n", + alloc_named ? "AllocNamedColor" : "AllocColor"); + } + + fprintf (stderr, + " seq = 0x%x, cmap = 0x%x, pixel = %d, rgb = (%d,%d,%d)\n", + LBXSequenceNumber(client), pmap->id, pent->pixel, + pent->red, pent->green, pent->blue); +#endif + + /* + * Now handle the X AllocColor reply to the client. + */ + + if (alloc_named) + DoAllocNamedColorReply (client, in_reply, + pent->red, pent->green, pent->blue, + pent->pixel, xred, xgreen, xblue); + else + DoAllocColorReply (client, in_reply, + pent->red, pent->green, pent->blue, pent->pixel); + + /* + * We found a match. Increment our ref count and tell the + * server to bump up its own ref count. + */ + + IncrementPixel (client, pmap, pent, FALSE); +} + + +/* ------------------------------------------------------------------------- */ + +int +ProcLBXCreateColormap(client) + ClientPtr client; +{ + REQUEST(xCreateColormapReq); + Colormap cmap; + VisualID vis; + char n; + + /* AllocAll are read/write, so ignore */ + if (stuff->alloc) { + cmap = stuff->mid; + vis = stuff->visual; + if (client->swapped) { + swapl(&cmap, n); + swapl(&vis, n); + } + CreateColormap(client, cmap, vis); + } + + return ProcStandardRequest(client); +} + +static ColormapPtr +create_colormap(cmap, visual) + Colormap cmap; + VisualID visual; +{ + ColormapPtr pmap; + LbxVisualPtr pvis; + int tsize, csize; + Pixel **pptr; + + pvis = GetVisual(visual); + if (!pvis) + return ((ColormapPtr) NULL); + csize = pvis->colormapEntries; + tsize = (csize * sizeof(Entry)) + (MAXCLIENTS * sizeof(Pixel *)) + + (MAXCLIENTS * sizeof(int)); + if ((pvis->class | DynamicClass) == DirectColor) + tsize *= 3; + tsize += sizeof(ColormapRec); + pmap = (ColormapPtr) xalloc(tsize); + if (!pmap) + return pmap; + bzero((char *) pmap, tsize); + pmap->id = cmap; + pmap->pVisual = pvis; + pmap->grab_status = CMAP_NOT_GRABBED; + pmap->red = (Entry *) ((char *) pmap + sizeof(ColormapRec)); + pmap->clientPixelsRed = (Pixel **) + ((char *) pmap->red + (csize * sizeof(Entry))); + pmap->numPixelsRed = (int *) ((char *) pmap->clientPixelsRed + + (MAXCLIENTS * sizeof(Pixel *))); + bzero((char *) pmap->red, (csize * sizeof(Entry))); + bzero((char *) pmap->numPixelsRed, (MAXCLIENTS * sizeof(int))); + for (pptr = &pmap->clientPixelsRed[MAXCLIENTS]; + --pptr >= pmap->clientPixelsRed; ) + *pptr = (Pixel *) NULL; + if ((pvis->class | DynamicClass) != DirectColor) { + pmap->green = NULL; + pmap->numPixelsGreen = NULL; + pmap->clientPixelsGreen = NULL; + pmap->blue = NULL; + pmap->numPixelsBlue = NULL; + pmap->clientPixelsBlue = NULL; + return pmap; + } + pmap->green = (Entry *) ((char *) pmap->numPixelsRed + + (MAXCLIENTS * sizeof(int))); + pmap->clientPixelsGreen = (Pixel **) + ((char *) pmap->green + (csize * sizeof(Entry))); + pmap->numPixelsGreen = (int *) ((char *) pmap->clientPixelsGreen + + (MAXCLIENTS * sizeof(Pixel *))); + bzero((char *) pmap->green, (csize * sizeof(Entry))); + bzero((char *) pmap->numPixelsGreen, (MAXCLIENTS * sizeof(int))); + for (pptr = &pmap->clientPixelsGreen[MAXCLIENTS]; + --pptr >= pmap->clientPixelsGreen; ) + *pptr = (Pixel *) NULL; + pmap->blue = (Entry *) ((char *) pmap->numPixelsGreen + + (MAXCLIENTS * sizeof(int))); + pmap->clientPixelsBlue = (Pixel **) + ((char *) pmap->blue + (csize * sizeof(Entry))); + pmap->numPixelsBlue = (int *) ((char *) pmap->clientPixelsBlue + + (MAXCLIENTS * sizeof(Pixel *))); + bzero((char *) pmap->blue, (csize * sizeof(Entry))); + bzero((char *) pmap->numPixelsBlue, (MAXCLIENTS * sizeof(int))); + for (pptr = &pmap->clientPixelsBlue[MAXCLIENTS]; + --pptr >= pmap->clientPixelsBlue; ) + *pptr = (Pixel *) NULL; + return pmap; +} + +/* ARGSUSED */ +Bool +CreateColormap(client, cmap, visual) + ClientPtr client; + Colormap cmap; + VisualID visual; +{ + ColormapPtr pmap; + + pmap = create_colormap(cmap, visual); + if (!pmap) + return FALSE; + return AddResource(client, cmap, RT_COLORMAP, (pointer) pmap); +} + +/* ------------------------------------------------------------------------- */ + + +int +ProcLBXFreeColormap(client) + ClientPtr client; +{ + REQUEST(xResourceReq); + Colormap cmap; + char n; + + cmap = stuff->id; + if (client->swapped) { + swapl(&cmap, n); + } + FreeColormap(client, cmap); + + return ProcStandardRequest(client); +} + +/* ARGSUSED */ +Bool +FreeColormap(client, cmap) + ClientPtr client; + Colormap cmap; +{ + ColormapPtr pmap; + + pmap = (ColormapPtr) LookupIDByType(client, cmap, RT_COLORMAP); + if (!pmap) + return FALSE; + FreeResource(client, cmap, RT_NONE); + return TRUE; +} + +/* ------------------------------------------------------------------------- */ + +/* + * cop out: don't try to track the new colormap + */ +int +ProcLBXCopyColormapAndFree(client) + ClientPtr client; +{ + REQUEST(xCopyColormapAndFreeReq); + Colormap srcmap; + ColormapPtr pmap; + char n; + + srcmap = stuff->srcCmap; + if (client->swapped) { + swapl(&srcmap, n); + } + pmap = (ColormapPtr) LookupIDByType(client, srcmap, RT_COLORMAP); + if (pmap) + FreeAllClientPixels(pmap, client->index); + + return ProcStandardRequest(client); +} + +/* ------------------------------------------------------------------------- */ + +int +ProcLBXFreeColors(client) + ClientPtr client; +{ + REQUEST(xFreeColorsReq); + int num; + Pixel *pixels; + CARD32 mask; + Colormap cmap; + Bool freepix = FALSE; + int n; + CARD16 len; + ColormapPtr pmap; + + mask = stuff->planeMask; + cmap = stuff->cmap; + len = stuff->length; + + if (client->swapped) { + swapl(&cmap, n); + swapl(&mask, n); + swaps(&len, n); + } + pmap = (ColormapPtr) LookupIDByType(client, cmap, RT_COLORMAP); + if (!pmap) + return ProcStandardRequest(client); + + num = ((len << 2) - sizeof(xFreeColorsReq)) >> 2; + + if (client->swapped) { + pixels = (Pixel *) ALLOCATE_LOCAL(num * sizeof(Pixel)); + if (pixels) { + memcpy((char *) pixels, (char *) &stuff[1], (num * sizeof(Pixel))); + SwapLongs((CARD32 *) pixels, num); + } + freepix = TRUE; + } else + pixels = (Pixel *) &stuff[1]; + +#ifdef COLOR_DEBUG + fprintf(stderr, "freeing on cmap 0x%x mask: %d pixels:", cmap, mask); + for (n = 0; n < num; n++) + fprintf(stderr, " %d", pixels[n]); + fprintf(stderr, "\n"); +#endif + FreePixels(client, pmap, num, pixels, mask); + + if (freepix) + DEALLOCATE_LOCAL(pixels); + + return ProcStandardRequest(client); +} + +/* ------------------------------------------------------------------------- */ + +int +ProcLBXAllocColor(client) + ClientPtr client; +{ + REQUEST(xAllocColorReq); + Entry *pent; + Colormap cmap; + ColormapPtr pmap; + CARD16 red, green, blue; + char n; + + cmap = stuff->cmap; + + if (client->swapped) + swapl(&cmap, n); + + pmap = (ColormapPtr) LookupIDByType (client, cmap, RT_COLORMAP); + + if (!pmap) + return ProcStandardRequest(client); + + red = stuff->red; + green = stuff->green; + blue = stuff->blue; + + if (client->swapped) + { + swaps(&red, n); + swaps(&green, n); + swaps(&blue, n); + } + + + /* + * Resolve the color (requested rgb -> actual rgb) + */ + + (*LbxResolveColor)(pmap->pVisual, &red, &green, &blue); + + + /* + * Search for the pixel in the proxy's colormap. + */ + + FindPixel (client, pmap, red, green, blue, &pent); + + if (pent && (pent->refcnt || pmap->grab_status == CMAP_GRABBED)) + { + /* + * We found the pixel in the proxy's colormap. We can + * short circuit this AllocColor. + */ + + FoundPixel (client, FALSE, pmap, pent, FALSE, 0, 0, 0); + } + else if (pmap->grab_status == CMAP_GRABBED) + { + /* + * The color map is already grabbed by the proxy, so we + * can handle the AllocColor locally now. + */ + + LocalAllocColor(client, FALSE, pmap, red, green, blue, FALSE, 0, 0, 0); + } + else + { + /* + * The proxy must first grab the color map. Then it can + * handle the AllocColor. + */ + + FinishLBXRequest(client, REQ_REPLACELATE); + + GrabCmap(client, pmap, red, green, blue, FALSE, 0, 0, 0); + } + return Success; +} + +/* ------------------------------------------------------------------------- */ + +int +ProcLBXAllocNamedColor(client) + ClientPtr client; +{ + REQUEST(xAllocNamedColorReq); + Entry *pent; + RGBEntryPtr rgbe; + ReplyStuffPtr nr; + CARD16 nbytes; + Colormap cmap; + ColormapPtr pmap; + char n; + + cmap = stuff->cmap; + nbytes = stuff->nbytes; + + if (client->swapped) { + swapl(&cmap, n); + swaps(&nbytes, n); + } + + pmap = (ColormapPtr) LookupIDByType (client, cmap, RT_COLORMAP); + + if (nbytes > MAX_COLORNAME_LENGTH || !pmap) + return ProcStandardRequest(client); + + pent = NULL; + rgbe = FindColorName(client->server, (char *) &stuff[1], nbytes, + pmap->pVisual); + if (rgbe) { +#ifdef COLOR_DEBUG + fprintf(stderr, "looking for %.*s = (%d,%d,%d)\n", nbytes, + (char *)&stuff[1], rgbe->vred, rgbe->vgreen, rgbe->vblue); +#endif + FindPixel (client, pmap, rgbe->vred, rgbe->vgreen, rgbe->vblue, &pent); + } + if (pent && (pent->refcnt || pmap->grab_status == CMAP_GRABBED)) { + FoundPixel (client, FALSE, pmap, pent, TRUE, + rgbe->xred, rgbe->xgreen, rgbe->xblue); + } else if (rgbe) { + if (pmap->grab_status == CMAP_GRABBED) { + /* + * The color map is already grabbed by the proxy, so we + * can handle the AllocNamedColor locally now. + */ + + LocalAllocColor (client, FALSE, pmap, + rgbe->vred, rgbe->vgreen, rgbe->vblue, + TRUE, + rgbe->xred, rgbe->xgreen, rgbe->xblue); + } else { + FinishLBXRequest(client, REQ_REPLACELATE); + GrabCmap(client, pmap, + rgbe->vred, rgbe->vgreen, rgbe->vblue, + TRUE, rgbe->xred, rgbe->xgreen, rgbe->xblue); + } + } else { + + /* + * We can't short circuit the AllocNamedColor request. + * The proxy will need control over the colormap to handle + * this request, so rather than wait for the server to ask + * the proxy to release the colormap, we release it now. + */ + + if (pmap->grab_status == CMAP_GRABBED && + (pmap->pVisual->class & DynamicClass)) + ReleaseCmap (client, pmap); + + + /* + * We need to catch the AllocNamedColor reply so we can cache + * the results for future short circuiting. + */ + + nr = NewReply(client, X_AllocNamedColor, 0, alloc_named_color_reply); + if (!nr) + return ProcStandardRequest(client); + nr->request_info.xallocnamedcolor.pmap = pmap; + strncpy(nr->request_info.xallocnamedcolor.name, (char *) &stuff[1], + nbytes); + nr->request_info.xallocnamedcolor.namelen = nbytes; + +#ifdef COLOR_DEBUG + fprintf (stderr, "X AllocNamedColor: could not short circuit\n"); + fprintf (stderr, " seq = 0x%x, cmap = 0x%x\n", + LBXSequenceNumber(client), cmap); +#endif + +#ifdef LBX_STATS + anc_miss++; +#endif + return ProcStandardRequest(client); + } + return Success; +} + +static Bool +alloc_named_color_reply(client, nr, data) + ClientPtr client; + ReplyStuffPtr nr; + char *data; +{ + xAllocNamedColorReply *reply; + Pixel pixel; + char n; + RGBEntryRec rgbe; + + reply = (xAllocNamedColorReply *) data; + + rgbe.xred = reply->exactRed; + rgbe.xgreen = reply->exactGreen; + rgbe.xblue = reply->exactBlue; + rgbe.vred = reply->screenRed; + rgbe.vgreen = reply->screenGreen; + rgbe.vblue = reply->screenBlue; + pixel = reply->pixel; + + if (client->swapped) { + swapl(&pixel, n); + swaps(&rgbe.xred, n); + swaps(&rgbe.xgreen, n); + swaps(&rgbe.xblue, n); + swaps(&rgbe.vred, n); + swaps(&rgbe.vgreen, n); + swaps(&rgbe.vblue, n); + } + +#ifdef COLOR_DEBUG + fprintf (stderr, + "X AllocNamedColorReply: caching results\n"); + fprintf (stderr, "pixel = %d, rgb = (%d,%d,%d)\n", + pixel, rgbe.vred, rgbe.vgreen, rgbe.vblue); +#endif + + AddColorName(client->server, + nr->request_info.xallocnamedcolor.name, + nr->request_info.xallocnamedcolor.namelen, + &rgbe); + + return StorePixel(client, nr->request_info.xallocnamedcolor.pmap, + rgbe.vred, rgbe.vgreen, rgbe.vblue, pixel, TRUE); +} + +/* ------------------------------------------------------------------------- */ + +int +ProcLBXAllocColorCells(client) + ClientPtr client; +{ + REQUEST(xAllocColorCellsReq); + ReplyStuffPtr nr; + Colormap cmap; + ColormapPtr pmap; + char n; + + cmap = stuff->cmap; + if (client->swapped) + swapl(&cmap, n); + + pmap = (ColormapPtr) LookupIDByType (client, cmap, RT_COLORMAP); + + if (!pmap) + return ProcStandardRequest(client); + if (!(pmap->pVisual->class & DynamicClass)) + return BadAlloc; + + /* + * We don't short circuit AllocColorCells requests. + * The server will need control over the colormap to handle + * this request, so rather than wait for the server to ask + * the proxy to release the colormap, we release it now. + */ + + if (pmap->grab_status == CMAP_GRABBED) + ReleaseCmap (client, pmap); + + + /* + * The proxy needs to keep track of all read/write cells allocated + * for its own clients. By doing this, we can optimize the special + * case of GrabCmapReply with smartGrab = TRUE. This means + * that the proxy asked back for a grab that it temporarily gave up + * to the server, and no other client or proxy did a color allocation + * in the colormap. + */ + + nr = NewReply(client, X_AllocColorCells, 0, alloc_color_cells_reply); + + if (nr) + nr->request_info.xalloccolorcells.pmap = pmap; + + return ProcStandardRequest(client); +} + +static Bool +alloc_color_cells_reply(client, nr, data) + ClientPtr client; + ReplyStuffPtr nr; + char *data; +{ + xAllocColorCellsReply *reply; + CARD16 nPixels, nMasks; + CARD32 *pixels, *masks; + ColormapPtr pmap; + int i, j, k; + char n; + + reply = (xAllocColorCellsReply *) data; + + pmap = nr->request_info.xalloccolorcells.pmap; + +#ifdef COLOR_DEBUG + fprintf (stderr, "AllocColorCells on cmap 0x%x:", + nr->request_info.xalloccolorcells.pmap->id); +#endif + + nPixels = reply->nPixels; + nMasks = reply->nMasks; + + if (client->swapped) + { + swaps(&nPixels, n); + swaps(&nMasks, n); + + pixels = (CARD32 *) xalloc (nPixels * sizeof (CARD32)); + masks = (CARD32 *) xalloc (nMasks * sizeof (CARD32)); + + memcpy (pixels, (char *) (reply + 1), nPixels * sizeof (CARD32)); + memcpy (masks, ((char *) (reply + 1)) + nPixels * sizeof (CARD32), + nMasks * sizeof (CARD32)); + + for (i = 0; i < nPixels; i++) + swapl (&pixels[i], n); + for (i = 0; i < nMasks; i++) + swapl (&masks[i], n); + } + else + { + pixels = (CARD32 *) (reply + 1); + masks = pixels + nPixels; + } + + for (i = 0; i < nPixels; i++) + for (j = 0; j < (1 << nMasks); j++) + { + CARD32 pixel, plane_mask = 0; + int bits = j; + + for (k = 0; k < nMasks; k++) + { + if (bits & 1) + plane_mask |= masks[k]; + bits >>= 1; + } + + pixel = pixels[i] | plane_mask; + + AllocCell(client, pmap, pixel); + +#ifdef COLOR_DEBUG + fprintf (stderr, " %d", pixel); +#endif + } + +#ifdef COLOR_DEBUG + fprintf (stderr, "\n"); +#endif + if (client->swapped) + { + xfree (pixels); + xfree (masks); + } + + return TRUE; +} + +/* ------------------------------------------------------------------------- */ + +int +ProcLBXAllocColorPlanes(client) + ClientPtr client; +{ + REQUEST(xAllocColorPlanesReq); + ReplyStuffPtr nr; + Colormap cmap; + ColormapPtr pmap; + char n; + + cmap = stuff->cmap; + if (client->swapped) + swapl(&cmap, n); + + pmap = (ColormapPtr) LookupIDByType (client, cmap, RT_COLORMAP); + + if (!pmap) + return ProcStandardRequest(client); + if (!(pmap->pVisual->class & DynamicClass)) + return BadAlloc; + + /* + * We don't short circuit AllocColorPlanes requests. + * The server will need control over the colormap to handle + * this request, so rather than wait for the server to ask + * the proxy to release the colormap, we release it now. + */ + + if (pmap->grab_status == CMAP_GRABBED) + ReleaseCmap (client, pmap); + + + /* + * The proxy needs to keep track of all read/write cells allocated + * for its own clients. By doing this, we can optimize the special + * case of GrabCmapReply with smartGrab = TRUE. This means + * that the proxy asked back for a grab that it temporarily gave up + * to the server, and no other client or proxy did a color allocation + * in the colormap. + */ + + nr = NewReply(client, X_AllocColorPlanes, 0, alloc_color_planes_reply); + + if (nr) + nr->request_info.xalloccolorplanes.pmap = pmap; + + return ProcStandardRequest(client); +} + +static Bool +alloc_color_planes_reply(client, nr, data) + ClientPtr client; + ReplyStuffPtr nr; + char *data; +{ + xAllocColorPlanesReply *reply; + CARD32 redMask, greenMask, blueMask, mask; + CARD16 nPixels; + CARD32 *pixels; + ColormapPtr pmap; + int i; + char n; + + reply = (xAllocColorPlanesReply *) data; + + pmap = nr->request_info.xalloccolorplanes.pmap; + + nPixels = reply->nPixels; + redMask = reply->redMask; + greenMask = reply->greenMask; + blueMask = reply->blueMask; + + if (client->swapped) + { + swaps(&nPixels, n); + swapl(&redMask, n); + swapl(&greenMask, n); + swapl(&blueMask, n); + + pixels = (CARD32 *) xalloc (nPixels * sizeof (CARD32)); + + memcpy (pixels, (char *) (reply + 1), nPixels * sizeof (CARD32)); + + for (i = 0; i < nPixels; i++) + swapl (&pixels[i], n); + + } + else + { + pixels = (CARD32 *) (reply + 1); + } + +#ifdef COLOR_DEBUG + fprintf (stderr, "AllocColorPlanes on cmap 0x%x:", + nr->request_info.xalloccolorplanes.pmap->id); +#endif + + mask = redMask | greenMask | blueMask; + + for (i = 0; i < nPixels; i++) + { + Pixel pixel, x = 0; + + do + { + x = (x + ~mask + 1) & mask; + + pixel = x | pixels[i]; + + AllocCell(client, pmap, pixel); + +#ifdef COLOR_DEBUG + fprintf(stderr, " %d", pixel); +#endif + } while (x); + } + +#ifdef COLOR_DEBUG + fprintf(stderr, "\n"); +#endif + if (client->swapped) + { + xfree (pixels); + } + + return TRUE; +} + +/* ------------------------------------------------------------------------- */ + +int +ProcLBXLookupColor(client) + ClientPtr client; +{ + REQUEST(xLookupColorReq); + xLookupColorReply reply; + ReplyStuffPtr nr; + RGBEntryPtr rgbe; + int len; + char n; + Colormap cmap; + ColormapPtr pmap; + + len = stuff->nbytes; + cmap = stuff->cmap; + + if (client->swapped) { + swapl(&cmap, n); + swaps(&len, n); + } + + pmap = (ColormapPtr) LookupIDByType (client, cmap, RT_COLORMAP); + + if (len > MAX_COLORNAME_LENGTH || !pmap) + return ProcStandardRequest(client); + + rgbe = FindColorName(client->server, (char *) &stuff[1], len, + pmap->pVisual); + + if (rgbe) { /* found the value */ + reply.type = X_Reply; + reply.length = 0; + reply.sequenceNumber = LBXSequenceNumber(client); + + reply.exactRed = rgbe->xred; + reply.exactBlue = rgbe->xblue; + reply.exactGreen = rgbe->xgreen; + + reply.screenRed = rgbe->vred; + reply.screenBlue = rgbe->vblue; + reply.screenGreen = rgbe->vgreen; + +#ifdef COLOR_DEBUG + if (LBXCacheSafe (client)) + fprintf(stderr, "X LookupColor: short circuiting:\n"); + else + fprintf(stderr, + "X LookupColor: short circuiting, but need Sync:\n"); + fprintf (stderr, " seq = 0x%x, name = %.*s\n", + LBXSequenceNumber(client), len, (char *)&stuff[1]); +#endif + + if (client->swapped) + SwapLookupColorReply(&reply); + if (LBXCacheSafe(client)) { + FinishLBXRequest(client, REQ_YANK); + WriteToClient(client, sizeof(xLookupColorReply), &reply); + } else { + if (!LBXCanDelayReply(client)) + SendLbxSync(client); + FinishLBXRequest(client, REQ_YANKLATE); + SaveReplyData(client, (xReply *) & reply, 0, NULL); + } + +#ifdef LBX_STATS + luc_good++; +#endif + + return Success; + } else { + nr = NewReply(client, X_LookupColor, 0, lookup_color_reply); + if (!nr) + return ProcStandardRequest(client); + strncpy(nr->request_info.xlookupcolor.name, + (char *) &stuff[1], len); + nr->request_info.xlookupcolor.namelen = len; + nr->request_info.xlookupcolor.visual = pmap->pVisual->id; + +#ifdef LBX_STATS + luc_miss++; +#endif + return ProcStandardRequest(client); + } +} + + +static Bool +lookup_color_reply(client, nr, data) + ClientPtr client; + ReplyStuffPtr nr; + char *data; +{ + xLookupColorReply *reply; + RGBEntryRec rgbe; + char n; + + reply = (xLookupColorReply *) data; + + rgbe.xred = reply->exactRed; + rgbe.xblue = reply->exactBlue; + rgbe.xgreen = reply->exactGreen; + rgbe.vred = reply->screenRed; + rgbe.vgreen = reply->screenGreen; + rgbe.vblue = reply->screenBlue; + + rgbe.visual = nr->request_info.xlookupcolor.visual; + if (client->swapped) { + swaps(&rgbe.xred, n); + swaps(&rgbe.xgreen, n); + swaps(&rgbe.xblue, n); + swaps(&rgbe.vred, n); + swaps(&rgbe.vgreen, n); + swaps(&rgbe.vblue, n); + } + AddColorName(client->server, + nr->request_info.xlookupcolor.name, + nr->request_info.xlookupcolor.namelen, + &rgbe); + return TRUE; +} diff --git a/app/lbxproxy/di/cmaputil.c b/app/lbxproxy/di/cmaputil.c new file mode 100644 index 000000000..a932c2b83 --- /dev/null +++ b/app/lbxproxy/di/cmaputil.c @@ -0,0 +1,980 @@ +/* $Xorg: cmaputil.c,v 1.5 2001/02/09 02:05:31 xorgcvs Exp $ */ + +/* +Copyright 1996, 1998 The Open Group + +Permission to use, copy, modify, distribute, and sell this software and its +documentation for any purpose is hereby granted without fee, provided that +the above copyright notice appear in all copies and that both that +copyright notice and this permission notice appear in supporting +documentation. + +The above copyright notice and this permission notice shall be included +in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR +OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the name of The Open Group shall +not be used in advertising or otherwise to promote the sale, use or +other dealings in this Software without prior written authorization +from The Open Group. +*/ + +/* + * Copyright 1994 Network Computing Devices, Inc. + * + * Permission to use, copy, modify, distribute, and sell this software and + * its documentation for any purpose is hereby granted without fee, provided + * that the above copyright notice appear in all copies and that both that + * copyright notice and this permission notice appear in supporting + * documentation, and that the name Network Computing Devices, Inc. not be + * used in advertising or publicity pertaining to distribution of this + * software without specific, written prior permission. + * + * THIS SOFTWARE IS PROVIDED `AS-IS'. NETWORK COMPUTING DEVICES, INC., + * DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING WITHOUT + * LIMITATION ALL IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A + * PARTICULAR PURPOSE, OR NONINFRINGEMENT. IN NO EVENT SHALL NETWORK + * COMPUTING DEVICES, INC., BE LIABLE FOR ANY DAMAGES WHATSOEVER, INCLUDING + * SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES, INCLUDING LOSS OF USE, DATA, + * OR PROFITS, EVEN IF ADVISED OF THE POSSIBILITY THEREOF, AND REGARDLESS OF + * WHETHER IN AN ACTION IN CONTRACT, TORT OR NEGLIGENCE, ARISING OUT OF OR IN + * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + * + */ +/* $XFree86: xc/programs/lbxproxy/di/cmaputil.c,v 1.11tsi Exp $ */ + +#include +#include "misc.h" +#include "lbx.h" +#include "assert.h" +#include "colormap.h" +#include "util.h" +#include "resource.h" +#include "wire.h" +#define XK_LATIN1 +#include + +typedef struct { + Colormap mid; +} colorResource; + + +static int num_visuals = 0; + +LbxVisualPtr *visuals; + + +int +CreateVisual(depth, vis) + int depth; + xVisualType *vis; +{ + LbxVisualPtr pvis; + + pvis = (LbxVisualPtr) xalloc(sizeof(LbxVisualRec)); + if (!pvis) + return 0; + pvis->id = vis->visualID; + pvis->class = vis->class; + pvis->depth = depth; + pvis->bitsPerRGB = vis->bitsPerRGB; + pvis->colormapEntries = vis->colormapEntries; + pvis->redMask = vis->redMask; + pvis->greenMask = vis->greenMask; + pvis->blueMask = vis->blueMask; + if ((pvis->class | DynamicClass) == DirectColor) { + pvis->offsetRed = 0; + while (pvis->redMask && !((pvis->redMask >> pvis->offsetRed) & 1)) + pvis->offsetRed++; + pvis->offsetGreen = 0; + while (pvis->greenMask && !((pvis->greenMask >> pvis->offsetGreen) & 1)) + pvis->offsetGreen++; + pvis->offsetBlue = 0; + while (pvis->blueMask && !((pvis->blueMask >> pvis->offsetBlue) & 1)) + pvis->offsetBlue++; + } + visuals = (LbxVisualPtr *) xrealloc(visuals, + (num_visuals + 1) * sizeof(LbxVisualPtr)); + if (!visuals) { + xfree(pvis); + return 0; + } + visuals[num_visuals++] = pvis; + + return 1; +} + +LbxVisualPtr +GetVisual(vid) + VisualID vid; +{ + LbxVisualPtr pvis; + int i; + + for (i = 0; i < num_visuals; i++) { + pvis = visuals[i]; + if (pvis->id == vid) + return pvis; + } + assert(0); + return (LbxVisualPtr) 0; +} + + +/* + * ISO Latin-1 case conversion routine + * + * this routine always null-terminates the result, so + * beware of too-small buffers + */ + +static void +CopyISOLatin1Lowered(dest, source, length) + register unsigned char *dest, *source; + int length; +{ + register int i; + + for (i = 0; i < length; i++, source++, dest++) + { + if ((*source >= XK_A) && (*source <= XK_Z)) + *dest = *source + (XK_a - XK_A); + else if ((*source >= XK_Agrave) && (*source <= XK_Odiaeresis)) + *dest = *source + (XK_agrave - XK_Agrave); + else if ((*source >= XK_Ooblique) && (*source <= XK_Thorn)) + *dest = *source + (XK_oslash - XK_Ooblique); + else + *dest = *source; + } + *dest = '\0'; +} + + +/* + * colormap cache code + * + * handles RGB database and AllocColor + * + */ + + +/* + * The dbm routines are a porting hassle. This implementation will do + * the same thing by reading the rgb.txt file directly, which is much + * more portable. + */ + +#define HASHSIZE 511 + +typedef struct _dbEntry * dbEntryPtr; +typedef struct _dbEntry { + dbEntryPtr link; + unsigned short red; + unsigned short green; + unsigned short blue; + char name[1]; /* some compilers complain if [0] */ +} dbEntry; + + +static dbEntryPtr hashTab[HASHSIZE]; + +static dbEntryPtr +lookup(char *name, int len, Bool create) +{ + unsigned int h = 0, g; + dbEntryPtr entry, *prev = NULL; + char *str = name; + + if (!(name = (char*)ALLOCATE_LOCAL(len +1))) return NULL; + CopyISOLatin1Lowered((unsigned char *)name, (unsigned char *)str, len); + name[len] = '\0'; + + for(str = name; *str; str++) { + h = (h << 4) + *str; + if ((g = h) & 0xf0000000) h ^= (g >> 24); + h &= g; + } + h %= HASHSIZE; + + if (( entry = hashTab[h] )) + { + for( ; entry; prev = (dbEntryPtr*)entry, entry = entry->link ) + if (! strcmp(name, entry->name) ) break; + } + else + prev = &(hashTab[h]); + + if (!entry && create && (entry = (dbEntryPtr)xalloc(sizeof(dbEntry) +len))) + { + *prev = entry; + entry->link = NULL; + strcpy( entry->name, name ); + } + + DEALLOCATE_LOCAL(name); + + return entry; +} + +extern char *rgbPath; + +static Bool have_rgb_db = FALSE; + +Bool +InitColors() +{ + FILE *rgb; + char *path; + char line[BUFSIZ]; + char name[BUFSIZ]; + int red, green, blue, lineno = 0; + dbEntryPtr entry; + + if (!rgbPath) + return TRUE; + if (!have_rgb_db) + { +#ifdef __UNIXOS2__ + rgbPath = (char*)__XOS2RedirRoot(rgbPath); +#endif + path = (char*)ALLOCATE_LOCAL(strlen(rgbPath) +5); + strcpy(path, rgbPath); + strcat(path, ".txt"); + + if (!(rgb = fopen(path, "r"))) + { + ErrorF( "Couldn't open RGB_DB '%s'\n", rgbPath ); + DEALLOCATE_LOCAL(path); + return FALSE; + } + + while(fgets(line, sizeof(line), rgb)) + { + lineno++; + if (sscanf(line,"%d %d %d %[^\n]\n", &red, &green, &blue, name) == 4) + { + if (red >= 0 && red <= 0xff && + green >= 0 && green <= 0xff && + blue >= 0 && blue <= 0xff) + { + if ((entry = lookup(name, strlen(name), TRUE))) + { + entry->red = (red * 65535) / 255; + entry->green = (green * 65535) / 255; + entry->blue = (blue * 65535) / 255; + } + } + else + ErrorF("Value for \"%s\" out of range: %s:%d\n", + name, path, lineno); + } + else if (*line && *line != '#' && *line != '!') + ErrorF("Syntax Error: %s:%d\n", path, lineno); + } + + fclose(rgb); + DEALLOCATE_LOCAL(path); + + have_rgb_db = TRUE; + } + + return TRUE; +} + + + +static Bool +OsLookupColor(name, len, pred, pgreen, pblue) + char *name; + unsigned len; + unsigned short *pred, *pgreen, *pblue; + +{ + dbEntryPtr entry; + + if ((entry = lookup(name, len, FALSE))) + { + *pred = entry->red; + *pgreen = entry->green; + *pblue = entry->blue; + return TRUE; + } + + return FALSE; +} + +/* + * colorname cache + */ + + +static int +Hash(name, len) + char *name; + int len; +{ + int hash = 0; + + while (len--) + hash = (hash << 1) ^ *name++; + if (hash < 0) + hash = -hash; + return hash; +} + +RGBEntryPtr +FindColorName(server, name, len, pVisual) + XServerPtr server; + char *name; + int len; + LbxVisualPtr pVisual; +{ + RGBCacheEntryPtr ce; + int hash; + char cname[BUFSIZ]; + + if (have_rgb_db && + OsLookupColor(name, len, + &server->rgb_buf.xred, + &server->rgb_buf.xgreen, + &server->rgb_buf.xblue)) { + + server->rgb_buf.vred = server->rgb_buf.xred; + server->rgb_buf.vgreen = server->rgb_buf.xgreen; + server->rgb_buf.vblue = server->rgb_buf.xblue; + + (*LbxResolveColor)(pVisual, + &server->rgb_buf.vred, + &server->rgb_buf.vgreen, + &server->rgb_buf.vblue); + + return &server->rgb_buf; + } + + CopyISOLatin1Lowered((unsigned char *)cname, (unsigned char *)name, len); + hash = Hash(cname, len) % NBUCKETS; + + ce = server->rgb_cache[hash]; + + while (ce) { + if ((ce->color.visual == pVisual->id) && + (ce->color.namelen == len) && + !strncmp(ce->color.name, cname, len)) { + return &ce->color; + } + ce = ce->next; + } + return (RGBEntryPtr) NULL; +} + +Bool +AddColorName(server, name, len, rgbe) + XServerPtr server; + char *name; + int len; + RGBEntryRec *rgbe; +{ + RGBCacheEntryPtr new; + int hash; + + hash = Hash(name, len) % NBUCKETS; + + new = (RGBCacheEntryPtr) xalloc(sizeof(RGBCacheEntryRec)); + if (!new) + return FALSE; + new->next = server->rgb_cache[hash]; + server->rgb_cache[hash] = new; + new->color = *rgbe; + new->color.name = (char *)xalloc(len + 1); + CopyISOLatin1Lowered((unsigned char *)new->color.name, + (unsigned char *)name, len); + new->color.namelen = len; + return TRUE; +} + + +void +FreeColors() +{ + RGBCacheEntryPtr ce, + nce; + int i, j; + + for (i = 0; i < lbxMaxServers; i++) { + if (servers[i]) { + for (j = 0; j < NBUCKETS; j++) { + for (ce = servers[i]->rgb_cache[j]; ce; ce = nce) { + nce = ce->next; + xfree(ce->color.name); + xfree(ce); + } + servers[i]->rgb_cache[j] = NULL; + } + } + } +} + + + +/* ARGSUSED */ +int +DestroyColormap(client, value, id) + ClientPtr client; + pointer value; + XID id; +{ + ColormapPtr pmap = (ColormapPtr)value; + xfree(pmap); + return Success; +} + +/* ------------------------------------------------------------------------- */ + +static int +find_matching_pixel(pent, num, channels, red, green, blue, pe) + Entry *pent; + int num; + int channels; + CARD32 red, + green, + blue; + Entry **pe; +{ + int i; + + /* OK if only server has it allocated, because even if a + * FreeCell is in transit for it, only we can realloc it */ + for (i = 0; i < num; pent++, i++) { + if (pent->status == PIXEL_SHARED) { + switch (channels) { + case DoRed: + if (pent->red == red) + { + *pe = pent; + return 1; + } + break; + case DoGreen: + if (pent->green == green) + { + *pe = pent; + return 1; + } + break; + case DoBlue: + if (pent->blue == blue) + { + *pe = pent; + return 1; + } + break; + default: + if (pent->red == red && + pent->green == green && + pent->blue == blue) + { + *pe = pent; + return 1; + } + } + } + } + *pe = NULL; + return 0; +} + +/* ARGSUSED */ +int +FindPixel(client, pmap, red, green, blue, pent) + ClientPtr client; + ColormapPtr pmap; + CARD32 red, + green, + blue; + Entry **pent; +{ + Entry *p; + + switch (pmap->pVisual->class) { + case PseudoColor: + case GrayScale: + return find_matching_pixel(pmap->red, pmap->pVisual->colormapEntries, + DoRed|DoGreen|DoBlue, + red, green, blue, pent); + case StaticGray: + case StaticColor: + if (pmap->grab_status != CMAP_GRABBED) + break; + *pent = (*LbxFindBestPixel)(pmap, red, green, blue, + DoRed|DoGreen|DoBlue); + return 1; + case TrueColor: + if (pmap->grab_status != CMAP_GRABBED) + break; + p = (*LbxFindBestPixel)(pmap, red, green, blue, DoRed); + client->server->rgb_ent.pixel = p->pixel << pmap->pVisual->offsetRed; + client->server->rgb_ent.red = p->red; + client->server->rgb_ent.refcnt = p->refcnt; + p = (*LbxFindBestPixel)(pmap, red, green, blue, DoGreen); + client->server->rgb_ent.pixel |= p->pixel << pmap->pVisual->offsetGreen; + client->server->rgb_ent.green = p->green; + if (!p->refcnt) + client->server->rgb_ent.refcnt = 0; + p = (*LbxFindBestPixel)(pmap, red, green, blue, DoBlue); + client->server->rgb_ent.pixel |= p->pixel << pmap->pVisual->offsetBlue; + client->server->rgb_ent.blue = p->blue; + if (!p->refcnt) + client->server->rgb_ent.refcnt = 0; + *pent = &client->server->rgb_ent; + return 1; + case DirectColor: + if (!find_matching_pixel(pmap->red, NUMRED(pmap->pVisual), + DoRed, red, green, blue, &p)) + break; + client->server->rgb_ent.pixel = p->pixel << pmap->pVisual->offsetRed; + client->server->rgb_ent.red = p->red; + client->server->rgb_ent.refcnt = p->refcnt; + if (!find_matching_pixel(pmap->green, NUMGREEN(pmap->pVisual), + DoGreen, red, green, blue, &p)) + break; + client->server->rgb_ent.pixel |= p->pixel << pmap->pVisual->offsetGreen; + client->server->rgb_ent.green = p->green; + if (!p->refcnt) + client->server->rgb_ent.refcnt = 0; + if (!find_matching_pixel(pmap->blue, NUMBLUE(pmap->pVisual), + DoBlue, red, green, blue, &p)) + break; + client->server->rgb_ent.pixel |= p->pixel << pmap->pVisual->offsetBlue; + client->server->rgb_ent.blue = p->blue; + if (!p->refcnt) + client->server->rgb_ent.refcnt = 0; + *pent = &client->server->rgb_ent; + return 1; + } + *pent = NULL; + return 0; +} + +static int +AddPixel(pclient, pmap, pixel) + ClientPtr pclient; + ColormapPtr pmap; + Pixel pixel; +{ + colorResource *pcr; + int npix; + Pixel *ppix; + int client = pclient->index; + + if ((pmap->pVisual->class | DynamicClass) != DirectColor) { + npix = pmap->numPixelsRed[client]; + ppix = (Pixel *) xrealloc(pmap->clientPixelsRed[client], + (npix + 1) * sizeof(Pixel)); + if (!ppix) + return 0; + ppix[npix] = pixel; + pmap->clientPixelsRed[client] = ppix; + pmap->numPixelsRed[client]++; + } else { + npix = pmap->numPixelsRed[client]; + ppix = (Pixel *) xrealloc(pmap->clientPixelsRed[client], + (npix + 1) * sizeof(Pixel)); + if (!ppix) + return 0; + ppix[npix] = REDPART(pmap->pVisual, pixel); + pmap->clientPixelsRed[client] = ppix; + pmap->numPixelsRed[client]++; + npix = pmap->numPixelsGreen[client]; + ppix = (Pixel *) xrealloc(pmap->clientPixelsGreen[client], + (npix + 1) * sizeof(Pixel)); + if (!ppix) + return 0; + ppix[npix] = GREENPART(pmap->pVisual, pixel); + pmap->clientPixelsGreen[client] = ppix; + pmap->numPixelsGreen[client]++; + npix = pmap->numPixelsBlue[client]; + ppix = (Pixel *) xrealloc(pmap->clientPixelsBlue[client], + (npix + 1) * sizeof(Pixel)); + if (!ppix) + return 0; + ppix[npix] = BLUEPART(pmap->pVisual, pixel); + pmap->clientPixelsBlue[client] = ppix; + pmap->numPixelsBlue[client]++; + } + if ((pclient->index != client) && + (pmap->numPixelsRed[client] == 1)) { + pcr = (colorResource *) xalloc(sizeof(colorResource)); + if (!pcr) + return 0; + pcr->mid = pmap->id; + AddResource(pclient, FakeClientID(client), RT_CMAPENTRY, (pointer) pcr); + } + return 1; +} + +int +IncrementPixel(pclient, pmap, pent, from_server) + ClientPtr pclient; + ColormapPtr pmap; + Entry *pent; + Bool from_server; +{ + + if (!AddPixel(pclient, pmap, pent->pixel)) + return 0; + + /* we have to AllocColor if refcnt is 0, even if server_ref is 1, + * because the server might have a FreeCell for it in flight */ + if (!from_server) { + if (!pent->refcnt && (pmap->pVisual->class & DynamicClass)) + SendAllocColor(pclient, pmap->id, pent->pixel, + pent->red, pent->green, pent->blue); + else + SendIncrementPixel(pclient, pmap->id, pent->pixel); + } + if ((pmap->pVisual->class | DynamicClass) != DirectColor) + pent->refcnt++; + else { + pmap->red[REDPART(pmap->pVisual, pent->pixel)].refcnt++; + pmap->green[GREENPART(pmap->pVisual, pent->pixel)].refcnt++; + pmap->blue[BLUEPART(pmap->pVisual, pent->pixel)].refcnt++; + } + return 1; +} + +int +AllocCell(client, pmap, pixel) + ClientPtr client; + ColormapPtr pmap; + Pixel pixel; +{ + Entry *pent; + Pixel p; + + if (!AddPixel(client, pmap, pixel)) + return 0; + switch (pmap->pVisual->class) { + case PseudoColor: + case GrayScale: + pent = &pmap->red[pixel]; + pent->pixel = pixel; + pent->status = PIXEL_PRIVATE; + pent->server_ref = 0; + return 1; + case DirectColor: + p = REDPART(pmap->pVisual, pixel); + pent = &pmap->red[p]; + pent->pixel = p; + pent->status = PIXEL_PRIVATE; + pent->server_ref = 0; + p = GREENPART(pmap->pVisual, pixel); + pent = &pmap->green[p]; + pent->pixel = p; + pent->status = PIXEL_PRIVATE; + pent->server_ref = 0; + p = BLUEPART(pmap->pVisual, pixel); + pent = &pmap->blue[p]; + pent->pixel = p; + pent->status = PIXEL_PRIVATE; + pent->server_ref = 0; + return 1; + default: + fprintf(stderr, "storing pixel in class %d colormap\n", + pmap->pVisual->class); + break; + } + return 0; +} + +int +StorePixel (client, pmap, red, green, blue, pixel, from_server) + ClientPtr client; + ColormapPtr pmap; + CARD32 red, + green, + blue; + Pixel pixel; + Bool from_server; +{ + Entry *pent; + Pixel p; + + switch (pmap->pVisual->class) { + case PseudoColor: + case GrayScale: + pent = pmap->red; + pent[pixel].red = red; + pent[pixel].green = green; + pent[pixel].blue = blue; + pent[pixel].pixel = pixel; + if (pent[pixel].status != PIXEL_SHARED) + pent[pixel].refcnt = 0; + pent[pixel].status = PIXEL_SHARED; + pent[pixel].server_ref = 1; + IncrementPixel(client, pmap, &pent[pixel], from_server); + return 1; + case DirectColor: + client->server->rgb_ent.refcnt = 1; + p = REDPART(pmap->pVisual, pixel); + pent = pmap->red; + pent[p].red = red; + pent[p].pixel = p; + if (pent[p].status != PIXEL_SHARED) + client->server->rgb_ent.refcnt = pent[p].refcnt = 0; + pent[p].status = PIXEL_SHARED; + pent[p].server_ref = 1; + p = GREENPART(pmap->pVisual, pixel); + pent = pmap->green; + pent[p].green = green; + pent[p].pixel = p; + if (pent[p].status != PIXEL_SHARED) + client->server->rgb_ent.refcnt = pent[p].refcnt = 0; + pent[p].status = PIXEL_SHARED; + pent[p].server_ref = 1; + p = BLUEPART(pmap->pVisual, pixel); + pent = pmap->blue; + pent[p].blue = blue; + pent[p].pixel = p; + if (pent[p].status != PIXEL_SHARED) + client->server->rgb_ent.refcnt = pent[p].refcnt = 0; + pent[p].status = PIXEL_SHARED; + pent[p].server_ref = 1; + client->server->rgb_ent.pixel = pixel; + client->server->rgb_ent.red = red; + client->server->rgb_ent.green = green; + client->server->rgb_ent.blue = blue; + IncrementPixel(client, pmap, &client->server->rgb_ent, from_server); + return 0; + default: + fprintf(stderr, "storing pixel in class %d colormap\n", + pmap->pVisual->class); + break; + } + return 0; +} + +/* ARGSUSED */ +static void +FreeCell(pent, pixel) + Entry *pent; + Pixel pixel; +{ + pent = &pent[pixel]; + if (pent->status == PIXEL_PRIVATE) { + if (!pent->server_ref) + pent->status = PIXEL_FREE; + } else if (pent->status == PIXEL_SHARED) { + if (pent->refcnt > 0) + pent->refcnt--; + if (!pent->refcnt && !pent->server_ref) + pent->status = PIXEL_FREE; + } +} + +static void +FreeServerCell(pent, pixel) + Entry *pent; + Pixel pixel; +{ + pent = &pent[pixel]; + if (pent->status == PIXEL_PRIVATE && pent->server_ref) + pent->status = PIXEL_FREE; + else if (pent->status == PIXEL_SHARED) { + if (!pent->refcnt) + pent->status = PIXEL_FREE; + else + pent->server_ref = 0; + } +} + +void +GotServerFreeCellsEvent(pmap, pixel_start, pixel_end) + ColormapPtr pmap; + Pixel pixel_start; + Pixel pixel_end; +{ + Pixel pixel; + + if ((pmap->pVisual->class | DynamicClass) != DirectColor) + for (pixel = pixel_start; pixel <= pixel_end; pixel++) { + FreeServerCell(pmap->red, pixel); + } + else + for (pixel = pixel_start; pixel <= pixel_end; pixel++) { + FreeServerCell(pmap->red, REDPART(pmap->pVisual, pixel)); + FreeServerCell(pmap->green, GREENPART(pmap->pVisual, pixel)); + FreeServerCell(pmap->blue, BLUEPART(pmap->pVisual, pixel)); + } +} + +void +FreeAllClientPixels(pmap, client) + ColormapPtr pmap; + int client; +{ + Pixel *ppix, *ppst; + int n; + + ppst = pmap->clientPixelsRed[client]; + for (ppix = ppst, n = pmap->numPixelsRed[client]; --n >= 0; ppix++) + FreeCell(pmap->red, *ppix); + xfree(ppst); + pmap->clientPixelsRed[client] = (Pixel *) NULL; + pmap->numPixelsRed[client] = 0; + if ((pmap->pVisual->class | DynamicClass) == DirectColor) { + ppst = pmap->clientPixelsGreen[client]; + for (ppix = ppst, n = pmap->numPixelsGreen[client]; --n >= 0; ppix++) + FreeCell(pmap->green, *ppix); + xfree(ppst); + pmap->clientPixelsGreen[client] = (Pixel *) NULL; + pmap->numPixelsGreen[client] = 0; + ppst = pmap->clientPixelsBlue[client]; + for (ppix = ppst, n = pmap->numPixelsBlue[client]; --n >= 0; ppix++) + FreeCell(pmap->blue, *ppix); + xfree(ppst); + pmap->clientPixelsBlue[client] = (Pixel *) NULL; + pmap->numPixelsBlue[client] = 0; + } +} + +/* ARGSUSED */ +int +FreeClientPixels(client, value, id) + ClientPtr client; + pointer value; + XID id; +{ + colorResource *pcr = (colorResource *)value; + ColormapPtr pmap; + + pmap = (ColormapPtr) LookupIDByType(client, pcr->mid, RT_COLORMAP); + + if (pmap) + FreeAllClientPixels(pmap, client->index); + xfree(pcr); + return Success; +} + +#define GetNextBitsOrBreak(bits, mask, base) \ + if((bits) == (mask)) \ + break; \ + (bits) += (base); \ + while((bits) & ~(mask)) \ + (bits) += ((bits) & ~(mask)) + +static void +FreeCells(client, pmap, num, pixels, mask, channels) + ClientPtr client; + ColormapPtr pmap; + int num; + Pixel *pixels; + Pixel mask; + int channels; +{ + Pixel pix, base, bits, cmask; + int i, zapped, npix, npixnew, offset; + Pixel *cptr, *pptr, *ppixClient, **ppixp; + int *npixp; + Entry *pent; + int idx; + + idx = client->index; + switch (channels) { + case DoRed: + ppixp = &pmap->clientPixelsRed[idx]; + npixp = &pmap->numPixelsRed[idx]; + cmask = pmap->pVisual->redMask; + offset = pmap->pVisual->offsetRed; + pent = pmap->red; + break; + case DoGreen: + ppixp = &pmap->clientPixelsGreen[idx]; + npixp = &pmap->numPixelsGreen[idx]; + cmask = pmap->pVisual->greenMask; + offset = pmap->pVisual->offsetGreen; + pent = pmap->green; + break; + case DoBlue: + ppixp = &pmap->clientPixelsBlue[idx]; + npixp = &pmap->numPixelsBlue[idx]; + cmask = pmap->pVisual->blueMask; + offset = pmap->pVisual->offsetBlue; + pent = pmap->blue; + break; + default: + ppixp = &pmap->clientPixelsRed[idx]; + npixp = &pmap->numPixelsRed[idx]; + cmask = ~((Pixel)0); + offset = 0; + pent = pmap->red; + break; + } + mask &= cmask; + zapped = 0; + bits = 0; + base = lowbit(mask); + while (1) + { + for (i = 0; i < num; i++) { + pix = (pixels[i] & cmask) >> offset; + for (cptr = *ppixp, npix = *npixp; + --npix >= 0 && *cptr != pix; + cptr++) + ; + if (npix >= 0) { + FreeCell(pent, pix); + *cptr = ~((Pixel)0); + zapped++; + } + } + GetNextBitsOrBreak(bits, mask, base); + } + if (zapped) { + npixnew = *npixp - zapped; + if (npixnew) { + pptr = cptr = *ppixp; + for (npix = 0; npix < npixnew; cptr++) { + if (*cptr != ~((Pixel)0)) { + *pptr++ = *cptr; + npix++; + } + } + ppixClient = *ppixp; + pptr = (Pixel *) xrealloc(ppixClient, npixnew * sizeof(Pixel)); + if (pptr) + ppixClient = pptr; + *npixp = npixnew; + *ppixp = ppixClient; + } else { + *npixp = 0; + xfree(*ppixp); + *ppixp = NULL; + } + } +} + +int +FreePixels(client, pmap, num, pixels, mask) + ClientPtr client; + ColormapPtr pmap; + int num; + Pixel *pixels; + Pixel mask; +{ + + if ((pmap->pVisual->class | DynamicClass) != DirectColor) + FreeCells(client, pmap, num, pixels, mask, DoRed|DoGreen|DoBlue); + else { + FreeCells(client, pmap, num, pixels, mask, DoRed); + FreeCells(client, pmap, num, pixels, mask, DoGreen); + FreeCells(client, pmap, num, pixels, mask, DoBlue); + } + return 1; +} diff --git a/app/lbxproxy/di/dispatch.c b/app/lbxproxy/di/dispatch.c new file mode 100644 index 000000000..a5705cc89 --- /dev/null +++ b/app/lbxproxy/di/dispatch.c @@ -0,0 +1,635 @@ +/* $Xorg: dispatch.c,v 1.3 2000/08/17 19:53:55 cpqbld Exp $ */ +/* + * Copyright 1992 Network Computing Devices + * Copyright 1996 X Consortium, Inc. + * + * Permission to use, copy, modify, distribute, and sell this software and its + * documentation for any purpose is hereby granted without fee, provided that + * the above copyright notice appear in all copies and that both that + * copyright notice and this permission notice appear in supporting + * documentation, and that the name of NCD. not be used in advertising or + * publicity pertaining to distribution of the software without specific, + * written prior permission. NCD. makes no representations about the + * suitability of this software for any purpose. It is provided "as is" + * without express or implied warranty. + * + * NCD. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL NCD. + * BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION + * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN + * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + * + */ +/* $XFree86: xc/programs/lbxproxy/di/dispatch.c,v 1.6 2001/10/28 03:34:22 tsi Exp $ */ + +#include +#include "assert.h" +#include "lbx.h" +#include "wire.h" +#include "swap.h" +#include "lbxext.h" +#include "util.h" +#include "resource.h" +#include "pm.h" + +extern int (* InitialVector[3]) (); + +static void KillAllClients( + void +); + +static void +HandleLargeRequest( + void +); + +int nextFreeClientID; /* always MIN free client ID */ +int nClients; /* number active clients */ +char *display_name = 0; +volatile char dispatchException = 0; +volatile char isItTimeToYield; +Bool lbxUseLbx = TRUE; +Bool lbxCompressImages = TRUE; +Bool lbxDoAtomShortCircuiting = TRUE; +Bool lbxDoLbxGfx = TRUE; + +extern Bool lbxWinAttr; +extern Bool lbxDoCmapGrabbing; +extern char *atomsFile; + +#define MAJOROP ((xReq *)client->requestBuffer)->reqType +#define MINOROP ((xReq *)client->requestBuffer)->data + +int +Dispatch () +{ + register int *clientReady; /* array of request ready clients */ + register int result = 0; + register ClientPtr client; + register int nready; + + nextFreeClientID = 2; + nClients = 0; + + clientReady = (int *) xalloc(sizeof(int) * MaxClients); + if (!clientReady) + FatalError("couldn't create client ready array"); + + while (!dispatchException) + { + if (numLargeRequestsInQueue == 0) { + /* + * There are no pending large requests, so do blocking read. + */ + + nready = WaitForSomething(clientReady, FALSE /* block */); + + } else { + /* + * If there is no input from any clients (the only way we can + * check this is by polling rather than blocking), handle a + * large request. + */ + + nready = WaitForSomething(clientReady, TRUE /* poll */); + + if (!nready && numLargeRequestsInQueue) + HandleLargeRequest (); + } + + /***************** + * Handle events in round robin fashion, doing input between + * each round + *****************/ + + while (!dispatchException && (--nready >= 0)) + { + client = clients[clientReady[nready]]; + if (! client) + { + /* KillClient can cause this to happen */ + continue; + } + isItTimeToYield = FALSE; + + while (!isItTimeToYield) + { + /* now, finally, deal with client requests */ + + result = ReadRequestFromClient(client); + if (result <= 0) + { + if (result < 0) + CloseDownClient(client); + break; + } + + client->sequence++; +#ifdef DEBUG + if (client->requestLogIndex == MAX_REQUEST_LOG) + client->requestLogIndex = 0; + client->requestLog[client->requestLogIndex] = MAJOROP; + client->requestLogIndex++; +#endif + client->sequenceNumber++; + result = (* client->requestVector[MAJOROP])(client); + + if (result != Success) + { + if (client->noClientException != Success) + CloseDownClient(client); + else + SendErrorToClient(client, MAJOROP, MINOROP, + client->errorValue, result); + break; + } + } + if (result >= 0 && client != client->server->serverClient) + client->server->prev_exec = client; + FlushAllOutput(); + } + } + KillAllClients(); + LbxCleanupSession(); + xfree (clientReady); + dispatchException &= ~DE_RESET; + return (dispatchException & DE_TERMINATE); +} + +void +SendErrorToClient(client, majorCode, minorCode, resId, errorCode) + ClientPtr client; + unsigned int majorCode; + unsigned int minorCode; + XID resId; + int errorCode; +{ + xError rep; + int n; + + rep.type = X_Error; + rep.sequenceNumber = LBXSequenceNumber(client); + rep.errorCode = errorCode; + rep.majorCode = majorCode; + rep.minorCode = minorCode; + rep.resourceID = resId; + + if (client->swapped) { + swaps(&rep.sequenceNumber, n); + swaps(&rep.minorCode, n); + swaps(&rep.resourceID, n); + } + + if (LBXCacheSafe(client)) { + FinishLBXRequest(client, REQ_YANK); + WriteToClient(client, sizeof(rep), (char *)&rep); + } else { + if (!LBXCanDelayReply(client)) + SendLbxSync(client); + FinishLBXRequest(client, REQ_YANKLATE); + SaveReplyData(client, (xReply *) &rep, 0, NULL); + } +} + +/************************ + * int NextAvailableClient(ospriv) + * + * OS dependent portion can't assign client id's because of CloseDownModes. + * Returns NULL if there are no free clients. + *************************/ + +ClientPtr +NextAvailableClient(ospriv, connect_fd) + pointer ospriv; + int connect_fd; +{ + register int i; + register ClientPtr client; + xReq data; + static int been_there; + + if (!been_there) { + nextFreeClientID = 1; /* The first client is serverClient */ + been_there++; + } + i = nextFreeClientID; + if (i == MAXCLIENTS) + return (ClientPtr)NULL; + clients[i] = client = (ClientPtr)xcalloc(sizeof(ClientRec)); + if (!client) + return (ClientPtr)NULL; + client->index = i; + client->closeDownMode = DestroyAll; + client->awaitingSetup = TRUE; + client->saveSet = (pointer *)NULL; + client->noClientException = Success; + client->public.requestLength = StandardRequestLength; + client->requestVector = InitialVector; + client->osPrivate = ospriv; + client->big_requests = TRUE; + + /* + * Use the fd the client connected on as a search key to find the + * associated display for this client + */ + if (connect_fd != -1) + { + int j, k, found = 0; + for (j=0; j < lbxMaxServers; j++) + { + if (servers[j]) + { + for (k=0; k < MAXTRANSPORTS; k++) + if (servers[j]->listen_fds[k] == connect_fd) + { + found = 1; + break; + } + } + if (found) + break; + } + if (!found) { + fprintf (stderr, "Cannot determine a client's transport connection\n"); + return (ClientPtr) NULL; + } + client->server = servers[j]; + } + + if (client->server && !InitClientResources(client)) + { + xfree(client); + return (ClientPtr)NULL; + } + + if (i == currentMaxClients) + currentMaxClients++; + while ((nextFreeClientID < MAXCLIENTS) && clients[nextFreeClientID]) + nextFreeClientID++; + if (client->server) + { + data.reqType = 1; + data.length = (sz_xReq + sz_xConnClientPrefix) >> 2; + if (!InsertFakeRequest(client, (char *)&data, sz_xReq)) + { + xfree (client); + return (ClientPtr) NULL; + } + } + return(client); +} + +int +ProcInitialConnection(client) + register ClientPtr client; +{ + REQUEST(xReq); + register xConnClientPrefix *prefix; + int whichbyte = 1; + + prefix = (xConnClientPrefix *)((char *)stuff + sz_xReq); + if ((prefix->byteOrder != 'l') && (prefix->byteOrder != 'B')) + return (client->noClientException = -1); + if (((*(char *) &whichbyte) && (prefix->byteOrder == 'B')) || + (!(*(char *) &whichbyte) && (prefix->byteOrder == 'l'))) + { + client->swapped = TRUE; + SwapConnClientPrefix(prefix); + } + stuff->reqType = 2; + stuff->length += ((prefix->nbytesAuthProto + 3) >> 2) + + ((prefix->nbytesAuthString + 3) >> 2); + if (client->swapped) { + swaps(&stuff->length, whichbyte); + } + ResetCurrentRequest(client); + return (client->noClientException); +} + +int +ProcEstablishConnection(client) + register ClientPtr client; +{ + register xConnClientPrefix *prefix; + register int i; + int len; + + REQUEST(xReq); + + prefix = (xConnClientPrefix *) ((char *) stuff + sz_xReq); + + nClients++; + client->requestVector = client->server->requestVector; + client->sequence = 0; + client->sequenceNumber = 0; + client->largeRequest = NULL; + + /* wait for X server to kill client */ + client->closeDownMode = RetainPermanent; + + /* + * NewClient outputs the LbxNewClient request header - have to follow it + * up with the setup connection info. + */ + /* length is still swapped */ + if (client->swapped) { + swaps(&stuff->length, i); + /* put data back to the way server will expect it */ + SwapConnClientPrefix((xConnClientPrefix *) prefix); + } + len = (stuff->length << 2) - sz_xReq; + if (!NewClient(client, len)) + return (client->noClientException = -1); + + WriteToServer(client->server->serverClient, len, (char *) prefix, + TRUE, FALSE); + + /* + * Can't allow any requests to be passed on to the server until the + * connection setup reply has been received. + */ + IgnoreClient(client); + + return (client->noClientException); +} + +/********************** + * CloseDownClient + * + * Client can either mark his resources destroy or retain. If retained and + * then killed again, the client is really destroyed. + *********************/ + +Bool resetAfterLastClient = FALSE; +Bool terminateAfterLastClient = FALSE; + +void +CloseDownClient(client) + register ClientPtr client; +{ + if (!client->clientGone) + { + CloseClient (client); + + + /* X server is telling us this client is dead */ + if (client->closeDownMode == DestroyAll) + { + client->clientGone = TRUE; /* so events aren't sent to client */ + FreeClientResources(client); + CloseDownConnection(client); + if (ClientIsAsleep (client)) + ClientSignal (client); + if (client->index < nextFreeClientID) + nextFreeClientID = client->index; + clients[client->index] = NullClient; + if ((client->requestVector != InitialVector) && + (client->server && client->server->serverClient != client) && + (--nClients == 0)) + { + if (resetAfterLastClient) + dispatchException |= DE_RESET; + else if (terminateAfterLastClient) + dispatchException |= DE_TERMINATE; + } + xfree(client); + } + else + { + client->clientGone = TRUE; + CloseDownConnection(client); + --nClients; + } + } + else + { + /* really kill resources this time */ + FreeClientResources(client); + if (ClientIsAsleep (client)) + ClientSignal (client); + if (client->index < nextFreeClientID) + nextFreeClientID = client->index; + clients[client->index] = NullClient; + xfree(client); + if (nClients == 0) + { + if (resetAfterLastClient) + dispatchException |= DE_RESET; + else if (terminateAfterLastClient) + dispatchException |= DE_TERMINATE; + } + } + + while (!clients[currentMaxClients-1]) + currentMaxClients--; +} + +static void +KillAllClients() +{ + int i; + for (i=1; icloseDownMode = DestroyAll; + CloseDownClient(clients[i]); + } + } +} + +extern void (*ZeroPadReqVector[128]) (); + +int +ProcStandardRequest (client) + ClientPtr client; +{ + REQUEST(xReq); + void (*zeroPadProc)(); + extern int lbxZeroPad; + + if (lbxZeroPad && + (MAJOROP < 128) && (zeroPadProc = ZeroPadReqVector[MAJOROP])) + (*zeroPadProc) ((void *) stuff); + FinishLBXRequest(client, REQ_PASSTHROUGH); + WriteReqToServer(client, client->req_len << 2, (char *) stuff, TRUE); + return Success; +} + +/* ARGSUSED */ +int +ProcBadRequest (client) + ClientPtr client; +{ + return BadRequest; +} + +/* + * Turn off optional features. Some features, like tags, will be turned + * off after option negotiation. + */ + +void +AdjustProcVector() +{ + int i; + + /* + * to turn off all LBX request reencodings, set all proc vectors to + * ProcStandardRequest + */ + if (!lbxUseLbx) { + for (i = 1; i < 256; i++) { + ProcVector[i] = ProcStandardRequest; + } + } + + if (!atomsFile) + ProcVector[X_ChangeWindowAttributes] = ProcStandardRequest; + + if (!lbxCompressImages) { + ProcVector[X_PutImage] = ProcStandardRequest; + ProcVector[X_GetImage] = ProcStandardRequest; + } + + if (!lbxDoAtomShortCircuiting) { + ProcVector[X_InternAtom] = ProcStandardRequest; + ProcVector[X_GetAtomName] = ProcStandardRequest; + } + + if (!lbxDoCmapGrabbing) + { + ProcVector[X_CreateColormap] = ProcStandardRequest; + ProcVector[X_FreeColormap] = ProcStandardRequest; + ProcVector[X_CopyColormapAndFree] = ProcStandardRequest; + ProcVector[X_AllocColor] = ProcStandardRequest; + ProcVector[X_AllocNamedColor] = ProcStandardRequest; + ProcVector[X_AllocColorCells] = ProcStandardRequest; + ProcVector[X_AllocColorPlanes] = ProcStandardRequest; + ProcVector[X_FreeColors] = ProcStandardRequest; + ProcVector[X_LookupColor] = ProcStandardRequest; + } + + if (!lbxDoLbxGfx) { + ProcVector[X_CopyArea] = ProcStandardRequest; + ProcVector[X_CopyPlane] = ProcStandardRequest; + ProcVector[X_PolyPoint] = ProcStandardRequest; + ProcVector[X_PolyLine] = ProcStandardRequest; + ProcVector[X_PolySegment] = ProcStandardRequest; + ProcVector[X_PolyRectangle] = ProcStandardRequest; + ProcVector[X_PolyArc] = ProcStandardRequest; + ProcVector[X_FillPoly] = ProcStandardRequest; + ProcVector[X_PolyFillRectangle] = ProcStandardRequest; + ProcVector[X_PolyFillArc] = ProcStandardRequest; + ProcVector[X_PolyText8] = ProcStandardRequest; + ProcVector[X_PolyText16] = ProcStandardRequest; + ProcVector[X_ImageText8] = ProcStandardRequest; + ProcVector[X_ImageText16] = ProcStandardRequest; + } + + if (!lbxWinAttr) + { + ProcVector[X_GetWindowAttributes] = ProcStandardRequest; + ProcVector[X_GetGeometry] = ProcStandardRequest; + } +} + + +static void +HandleLargeRequest () + +{ + LbxLargeRequestRec *largeRequest = largeRequestQueue[0]; + ClientPtr client = largeRequest->client; + int bytesLeft, chunkSize; + + /* + * Process the first large request on the queue. If this is the first + * chunk of a large request, send an LbxBeginLargeRequest message. + */ + + if (largeRequest->bytesWritten == 0) { + xLbxBeginLargeRequestReq beginReq; + int n; + + beginReq.reqType = client->server->lbxReq; + beginReq.lbxReqType = X_LbxBeginLargeRequest; + beginReq.length = 2; + beginReq.largeReqLength = largeRequest->totalBytes >> 2; + if (client->swapped) { + swapl(&beginReq.largeReqLength, n); + } + _write_to_server (client, + largeRequest->compressed, + sizeof (beginReq), (char *) &beginReq, + FALSE, TRUE); + } + + /* + * Send a chunk of the large request using the LbxLargeRequestData message. + */ + + bytesLeft = largeRequest->totalBytes - largeRequest->bytesWritten; + + if (bytesLeft > LBX_LARGE_REQUEST_CHUNK_SIZE) + chunkSize = LBX_LARGE_REQUEST_CHUNK_SIZE; + else + chunkSize = bytesLeft; + + if (chunkSize > 0) { + xLbxLargeRequestDataReq dataReq; + + dataReq.reqType = client->server->lbxReq; + dataReq.lbxReqType = X_LbxLargeRequestData; + dataReq.length = 1 + (chunkSize >> 2); + + _write_to_server (client, + largeRequest->compressed, + sizeof (dataReq), (char *) &dataReq, + FALSE, TRUE); + + _write_to_server (client, + largeRequest->compressed, + chunkSize, + largeRequest->buf + largeRequest->bytesWritten, + FALSE, FALSE); + + largeRequest->bytesWritten += chunkSize; + } + + if (numLargeRequestsInQueue > 1) { + /* + * Move this large request to the end of the queue - this way + * we can process large requests from other clients too. + */ + + memmove((char *)&largeRequestQueue[0], (char *)&largeRequestQueue[1], + (numLargeRequestsInQueue - 1) * sizeof(LbxLargeRequestRec *)); + largeRequestQueue[numLargeRequestsInQueue - 1] = largeRequest; + } + + /* + * See if the whole request has been sent. If yes, send an + * LbxEndLargeRequest and re-enable input for this client. + */ + + if (largeRequest->bytesWritten == largeRequest->totalBytes) { + xLbxEndLargeRequestReq endReq; + + endReq.reqType = client->server->lbxReq; + endReq.lbxReqType = X_LbxEndLargeRequest; + endReq.length = 1; + + _write_to_server (client, + largeRequest->compressed, + sizeof (endReq), (char *) &endReq, + FALSE, TRUE); + + xfree ((char *) largeRequest); + client->largeRequest = NULL; + numLargeRequestsInQueue--; + + AttendClient (client); + } +} diff --git a/app/lbxproxy/di/extensions.c b/app/lbxproxy/di/extensions.c new file mode 100644 index 000000000..a26edb41f --- /dev/null +++ b/app/lbxproxy/di/extensions.c @@ -0,0 +1,319 @@ +/* $Xorg: extensions.c,v 1.5 2001/02/09 02:05:31 xorgcvs Exp $ */ +/* + +Copyright 1998 The Open Group + +Permission to use, copy, modify, distribute, and sell this software and its +documentation for any purpose is hereby granted without fee, provided that +the above copyright notice appear in all copies and that both that +copyright notice and this permission notice appear in supporting +documentation. + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the name of The Open Group shall not be +used in advertising or otherwise to promote the sale, use or other dealings +in this Software without prior written authorization from The Open Group. + +*/ +/* + * Copyright 1994 Network Computing Devices, Inc. + * + * Permission to use, copy, modify, distribute, and sell this software and + * its documentation for any purpose is hereby granted without fee, provided + * that the above copyright notice appear in all copies and that both that + * copyright notice and this permission notice appear in supporting + * documentation, and that the name Network Computing Devices, Inc. not be + * used in advertising or publicity pertaining to distribution of this + * software without specific, written prior permission. + * + * THIS SOFTWARE IS PROVIDED `AS-IS'. NETWORK COMPUTING DEVICES, INC., + * DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING WITHOUT + * LIMITATION ALL IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A + * PARTICULAR PURPOSE, OR NONINFRINGEMENT. IN NO EVENT SHALL NETWORK + * COMPUTING DEVICES, INC., BE LIABLE FOR ANY DAMAGES WHATSOEVER, INCLUDING + * SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES, INCLUDING LOSS OF USE, DATA, + * OR PROFITS, EVEN IF ADVISED OF THE POSSIBILITY THEREOF, AND REGARDLESS OF + * WHETHER IN AN ACTION IN CONTRACT, TORT OR NEGLIGENCE, ARISING OUT OF OR IN + * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + * + */ + +/* tracks server extensions */ + +#include "lbx.h" +#include "assert.h" +#include "wire.h" +#include "lbxext.h" +#include "reqtype.h" +#include "swap.h" + +typedef struct _extinfo { + int nlen; + char *name; + int idx; + int opcode; + int event; + int error; + CARD8 *rep_mask, + *ev_mask; + int num_reqs; + ExtensionInfoPtr next; +} ExtensionInfoRec; + +static Bool +AddExtension(server, name, reply, rep_mask, ev_mask) + XServerPtr server; + char *name; + xLbxQueryExtensionReplyPtr reply; + CARD8 *rep_mask, + *ev_mask; +{ + ExtensionInfoPtr eip = NULL; + int req_mask_len; + + for (eip = server->extensions; eip; eip = eip->next) { + if (!strcmp(eip->name, name)) + return TRUE; + } + eip = (ExtensionInfoPtr) xalloc(sizeof(ExtensionInfoRec)); + if (!eip) + return FALSE; + eip->nlen = strlen(name); + eip->name = (char *) xalloc(eip->nlen + 1); + if (!eip->name) { + xfree(eip); + return FALSE; + } + strcpy(eip->name, name); + req_mask_len = (reply->numReqs + 7) >> 3; + eip->rep_mask = (CARD8 *) xalloc(req_mask_len); + eip->ev_mask = (CARD8 *) xalloc(req_mask_len); + if (req_mask_len && (!eip->rep_mask || !eip->ev_mask)) { + xfree(eip->rep_mask); + xfree(eip->ev_mask); + xfree(eip->name); + xfree(eip); + return FALSE; + } + if (reply->numReqs) { + memcpy((char *) eip->rep_mask, (char *) rep_mask, req_mask_len); + memcpy((char *) eip->ev_mask, (char *) ev_mask, req_mask_len); + } + eip->num_reqs = reply->numReqs; + eip->opcode = reply->major_opcode; + eip->event = reply->first_event; + eip->error = reply->first_error; + eip->next = server->extensions; + server->extensions = eip; + return TRUE; +} + +void +DeleteExtensions(server) + XServerPtr server; +{ + ExtensionInfoPtr eip; + + while ((eip = server->extensions)) { + server->extensions = eip->next; + xfree(eip->name); + xfree(eip->rep_mask); + xfree(eip->ev_mask); + xfree(eip); + } +} + +/*ARGSUSED*/ +void +HandleExtensionError(client, err, nr) + ClientPtr client; + xError *err; + ReplyStuffPtr nr; +{ +} + +/*ARGSUSED*/ +void +HandleExtensionEvent(client, ev) + ClientPtr client; + xEvent *ev; +{ +} + +static Bool +check_mask(mask, minorop) + CARD8 *mask; + int minorop; +{ + if (mask[minorop >> 3] & (1 << (minorop & 7))) + return REQ_TYPE_YES; + else + return REQ_TYPE_NO; +} + +Bool +CheckExtensionForEvents(client, req) + ClientPtr client; + xReq *req; +{ + int opcode = req->reqType; + int minorop = req->data; + ExtensionInfoPtr eip; + + for (eip = client->server->extensions; eip; eip = eip->next) { + if (eip->opcode == opcode) { + if (!eip->ev_mask || !eip->num_reqs) + return TRUE; /* assume worst */ + return check_mask(eip->ev_mask, minorop); + } + } + /* assume the worst */ + return TRUE; +} + +Bool +CheckExtensionForReplies(client, req) + ClientPtr client; + xReq *req; +{ + int opcode = req->reqType; + int minorop = req->data; + ExtensionInfoPtr eip; + + for (eip = client->server->extensions; eip; eip = eip->next) { + if (eip->opcode == opcode) { + if (!eip->rep_mask || !eip->num_reqs) + return REQ_TYPE_MAYBE; /* assume worst */ + return check_mask(eip->rep_mask, minorop); + } + } + /* assume the worst */ + return REQ_TYPE_MAYBE; +} + +static Bool +HandleLbxQueryExtensionReply(client, nr, data) + ClientPtr client; + ReplyStuffPtr nr; + char *data; +{ + xLbxQueryExtensionReply *reply; + xQueryExtensionReply crep; + char *ename; + CARD8 *rep_mask = NULL, + *ev_mask = NULL; + + reply = (xLbxQueryExtensionReply *) data; + + ename = nr->request_info.lbxqueryextension.name; + + if (reply->length) { + rep_mask = (CARD8 *) &reply[1]; + ev_mask = rep_mask + ((((reply->numReqs + 7) >> 3) + 3) & ~3); + } + if (reply->present) + AddExtension(client->server, ename, reply, rep_mask, ev_mask); + xfree(ename); + + /* and finally tell client about it */ + crep.type = X_Reply; + crep.length = 0; + crep.sequenceNumber = reply->sequenceNumber; + crep.present = reply->present; + crep.major_opcode = reply->major_opcode; + crep.first_event = reply->first_event; + crep.first_error = reply->first_error; + if (client->swapped) + SwapQueryExtensionReply(&crep); + WriteToClient(client, sizeof(xQueryExtensionReply), (char *) &crep); + + return TRUE; +} + +static int +QueryExtensionReply(client, present, opcode, event, error) + ClientPtr client; + Bool present; + int opcode, event, error; +{ + xQueryExtensionReply reply; + + reply.type = X_Reply; + reply.length = 0; + reply.sequenceNumber = LBXSequenceNumber(client); + reply.present = present; + reply.major_opcode = opcode; + reply.first_event = event; + reply.first_error = error; + if (client->swapped) + SwapQueryExtensionReply(&reply); + if (LBXCacheSafe(client)) { + FinishLBXRequest(client, REQ_YANK); + WriteToClient(client, sizeof(xQueryExtensionReply), (char *)&reply); + } else { /* store for later */ + if (!LBXCanDelayReply(client)) + SendLbxSync(client); + FinishLBXRequest(client, REQ_YANKLATE); + SaveReplyData(client, (xReply *) &reply, 0, NULL); + } + return Success; +} + +int +ProcLBXQueryExtension(client) + ClientPtr client; +{ + REQUEST(xQueryExtensionReq); + char n; + char *ename; + xLbxQueryExtensionReq req; + CARD16 nlen; + ReplyStuffPtr nr; + ExtensionInfoPtr eip; + + nlen = stuff->nbytes; + if (client->swapped) { + swaps(&nlen, n); + } + if (nlen == (sizeof(LBXNAME) - 1) && + !strncmp((char *)&stuff[1], LBXNAME, nlen)) + return QueryExtensionReply(client, FALSE, 0, 0, 0); + for (eip = client->server->extensions; eip; eip = eip->next) { + if (nlen == eip->nlen && !strncmp((char *)&stuff[1], eip->name, nlen)) + return QueryExtensionReply(client, TRUE, eip->opcode, + eip->event, eip->error); + } + ename = (char *) xalloc(nlen + 1); + if (!ename) + return BadAlloc; + memcpy(ename, (char *) &stuff[1], nlen); + ename[nlen] = '\0'; + + req.reqType = client->server->lbxReq; + req.lbxReqType = X_LbxQueryExtension; + req.length = 2 + ((nlen + 3) >> 2); + req.nbytes = nlen; + if (client->swapped) + SwapQueryExtension(&req); + nr = NewReply(client, client->server->lbxReq, X_LbxQueryExtension, + HandleLbxQueryExtensionReply); + if (!nr) { + xfree(ename); + return ProcStandardRequest(client); + } + nr->request_info.lbxqueryextension.name = ename; + FinishLBXRequest(client, REQ_PASSTHROUGH); + WriteToServer(client, sizeof(req), (char *) &req, TRUE, TRUE); + WriteToServer(client, nlen, ename, FALSE, TRUE); + + return Success; +} diff --git a/app/lbxproxy/di/gfx.c b/app/lbxproxy/di/gfx.c new file mode 100644 index 000000000..8c345c657 --- /dev/null +++ b/app/lbxproxy/di/gfx.c @@ -0,0 +1,1260 @@ +/* $Xorg: gfx.c,v 1.4 2001/02/09 02:05:31 xorgcvs Exp $ */ +/* + +Copyright 1998 The Open Group + +Permission to use, copy, modify, distribute, and sell this software and its +documentation for any purpose is hereby granted without fee, provided that +the above copyright notice appear in all copies and that both that +copyright notice and this permission notice appear in supporting +documentation. + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the name of The Open Group shall not be +used in advertising or otherwise to promote the sale, use or other dealings +in this Software without prior written authorization from The Open Group. + +*/ +/* + * Copyright 1994 Network Computing Devices, Inc. + * + * Permission to use, copy, modify, distribute, and sell this software and + * its documentation for any purpose is hereby granted without fee, provided + * that the above copyright notice appear in all copies and that both that + * copyright notice and this permission notice appear in supporting + * documentation, and that the name Network Computing Devices, Inc. not be + * used in advertising or publicity pertaining to distribution of this + * software without specific, written prior permission. + * + * THIS SOFTWARE IS PROVIDED `AS-IS'. NETWORK COMPUTING DEVICES, INC., + * DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING WITHOUT + * LIMITATION ALL IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A + * PARTICULAR PURPOSE, OR NONINFRINGEMENT. IN NO EVENT SHALL NETWORK + * COMPUTING DEVICES, INC., BE LIABLE FOR ANY DAMAGES WHATSOEVER, INCLUDING + * SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES, INCLUDING LOSS OF USE, DATA, + * OR PROFITS, EVEN IF ADVISED OF THE POSSIBILITY THEREOF, AND REGARDLESS OF + * WHETHER IN AN ACTION IN CONTRACT, TORT OR NEGLIGENCE, ARISING OUT OF OR IN + * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + * + */ +/* $XFree86: xc/programs/lbxproxy/di/gfx.c,v 1.5 2001/10/28 03:34:22 tsi Exp $ */ + +/* + * graphics acceleration + */ + +#include +#include "assert.h" +#include "misc.h" +#include "lbx.h" +#include "util.h" +#include "resource.h" +#include "wire.h" +#include +#include "proxyopts.h" +#include "swap.h" + +static Bool GetLbxImageReply(); + +static int pad[4] = {0, 3, 2, 1}; + +/* + * Routines for re-encoding line, rectangle and arc requests + */ + +#define REENCODE_PSHORT(val, out) \ + if ((val) >= 0 && (val) < 0xf0) \ + *(out)++ = (val); \ + else if ((val) >= 0xef0 || (val) < (short)0xfe00) \ + return 0; \ + else if ((val) < 0) { \ + *(out)++ = 0xf0 | (((val) + 0x1000) >> 8); \ + *(out)++ = (val) + 0x1000; \ + } else { \ + *(out)++ = 0xf0 | (((val) - 0xf0) >> 8); \ + *(out)++ = (val) - 0xf0; \ + } + + +#define REENCODE_SHORT(val, out) \ + if ((val) >= (short)0xff90 && (val) < 0x80) \ + *(out)++ = (val); \ + else if ((val) >= (short)0x0880 || (val) < (short)0xf790) \ + return 0; \ + else if ((val) < 0) { \ + *(out)++ = 0x80 | ((((val) + 0x70) >> 8) & 0x0f); \ + *(out)++ = (val) + 0x70; \ + } else { \ + *(out)++ = 0x80 | ((((val) - 0x80) >> 8) & 0x0f); \ + *(out)++ = (val) - 0x80; \ + } + +#define REENCODE_USHORT(val, out) \ + if ((val) < 0xf0) \ + *(out)++ = (val); \ + else if ((unsigned short)(val) >= 0x10f0) \ + return 0; \ + else { \ + *(out)++ = 0xf0 | (((val) - 0xf0) >> 8); \ + *(out)++ = (val) - 0xf0; \ + } + +#define REENCODE_ANGLE(val, out) \ + if ((val) > (360 << 6) || (val) < -(360 << 6)) \ + return 0; \ + else if ((val) >= 0 && (val) <= (95 << 6) && !((val) % (5 << 6))) \ + *(out)++ = 0x5a + ((val) / (5 << 6)); \ + else if ((val) >= (105 << 6) && !((val) % (15 << 6))) \ + *(out)++ = 0x67 + ((val) / (15 << 6)); \ + else if ((val) >= -(100 << 6) && (val) <= -(5 << 6) && \ + !((val) % (5 << 6))) \ + *(out)++ = 0xa6 + ((val) / (5 << 6)); \ + else if ((val) <= -(105 << 6) && !((val) % (15 << 6))) \ + *(out)++ = 0x98 + ((val) / (15 << 6)); \ + else { \ + *(out)++ = (val) >> 8; \ + *(out)++ = (val); \ + } + +#define COPY_AND_SWAPS(oval, ival) \ + { \ + register int n; \ + (oval) = (ival); \ + if (client->swapped) \ + swaps(&(oval), n); \ + } + +#define SWAP_REENCODE_PSHORT(ival, out) { \ + register int _n; \ + short _val; \ + _val = (ival); \ + if (client->swapped) swaps (&_val, _n); \ + REENCODE_PSHORT(_val, out); \ +} + +#define SWAP_REENCODE_SHORT(ival, out) { \ + register int _n; \ + short _val; \ + _val = (ival); \ + if (client->swapped) swaps (&_val, _n); \ + REENCODE_SHORT(_val, out); \ +} + +#define SWAP_REENCODE_USHORT(ival, out) { \ + register int _n; \ + unsigned short _val; \ + _val = (ival); \ + if (client->swapped) swaps (&_val, _n); \ + REENCODE_USHORT(_val, out); \ +} + +int gfx_gc_hit; +int gfx_gc_miss; +int gfx_draw_hit; +int gfx_draw_miss; +int gfx_total; + +static void +push(cache, xid) + XID cache[GFX_CACHE_SIZE]; + XID xid; +{ + memmove(cache + 1, cache, (GFX_CACHE_SIZE - 1) * sizeof(cache[0])); + cache[0] = xid; +} + +static void +use(cache, i) + XID cache[GFX_CACHE_SIZE]; + int i; +{ + XID tmp; + + if (i == 0) + return; + tmp = cache[i]; + memmove(cache + 1, cache, i * sizeof(cache[0])); + cache[0] = tmp; +} + +static int +match(cache, xid) + XID cache[GFX_CACHE_SIZE]; + XID xid; +{ + int j; + + for (j = 0; j < GFX_CACHE_SIZE; j++) + if (cache[j] == xid) + return j; + return GFXCacheNone; +} + +#define GFX_REQ_PAD 8 + +#define GFX_SRC_DST_REQ_PAD 12 + +#define GFX_CACHE_DECLARE int _dcache, _gcache; \ + Drawable _drawable; \ + GContext _gcontext + +#define GFX_SRC_DST_CACHE_DECLARE int _srcDcache, _dstDcache, _gcache; \ + Drawable _srcDrawable, _dstDrawable; \ + GContext _gcontext + +#define GFX_SETUP_DRAWABLE_AND_GC(after) {\ + _drawable = stuff->drawable; \ + _gcontext = stuff->gc; \ + if (client->swapped) { \ + register int _n; \ + swapl(&_drawable, _n); \ + swapl(&_gcontext, _n); \ + } \ + _dcache = match (LBXDrawableCache(client), _drawable); \ + if (_dcache == GFXCacheNone) \ + { \ + memcpy (after, &stuff->drawable, 4); \ + after += 4; \ + } \ + _gcache = match (LBXGContextCache(client), _gcontext); \ + if (_gcache == GFXCacheNone) \ + { \ + memcpy (after, &stuff->gc, 4); \ + after += 4; \ + } \ +} + +#define GFX_SETUP_SRC_DST_DRAWABLE_AND_GC(after) {\ + Drawable tmpDrawableCache[GFX_CACHE_SIZE]; \ + memcpy (tmpDrawableCache, LBXDrawableCache(client), sizeof (LBXDrawableCache(client))); \ + _srcDrawable = stuff->srcDrawable; \ + _dstDrawable = stuff->dstDrawable; \ + _gcontext = stuff->gc; \ + if (client->swapped) { \ + register int _n; \ + swapl (&_srcDrawable, _n); \ + swapl (&_dstDrawable, _n); \ + swapl (&_gcontext, _n); \ + } \ + _srcDcache = match (LBXDrawableCache(client), _srcDrawable); \ + if (_srcDcache == GFXCacheNone) \ + { \ + memcpy (after, &stuff->srcDrawable, 4); \ + after += 4; \ + push (tmpDrawableCache, _srcDrawable); \ + } else \ + use (tmpDrawableCache, _srcDcache); \ + _dstDcache = match (tmpDrawableCache, _dstDrawable); \ + if (_dstDcache == GFXCacheNone) \ + { \ + memcpy (after, &stuff->dstDrawable, 4); \ + after += 4; \ + } \ + _gcache = match (LBXGContextCache(client), _gcontext); \ + if (_gcache == GFXCacheNone) \ + { \ + memcpy (after, &stuff->gc, 4); \ + after += 4; \ + } \ +} + +#define GFX_SET_DRAWABLE_AND_GC {\ + if (_dcache == GFXCacheNone) { \ + gfx_draw_miss++; \ + push (LBXDrawableCache(client), _drawable); \ + } else { \ + gfx_draw_hit++; \ + use (LBXDrawableCache(client), _dcache); \ + } \ + if (_gcache == GFXCacheNone) { \ + gfx_gc_miss++; \ + push (LBXGContextCache(client), _gcontext);\ + } else { \ + gfx_gc_hit++; \ + use (LBXGContextCache(client), _gcache); \ + } \ + newreq->cacheEnts = GFXCacheEnts (_dcache, _gcache); \ + gfx_total++; \ +} +#define GFX_SET_SRC_DST_DRAWABLE_AND_GC {\ + if (_srcDcache == GFXCacheNone) { \ + gfx_draw_miss++; \ + push (LBXDrawableCache(client), _srcDrawable); \ + } else { \ + gfx_draw_hit++; \ + use (LBXDrawableCache(client), _srcDcache); \ + } \ + newreq->srcCache = GFXCacheEnts (_srcDcache, 0); \ + if (_dstDcache == GFXCacheNone) { \ + gfx_draw_miss++; \ + push (LBXDrawableCache(client), _dstDrawable); \ + } else { \ + gfx_draw_hit++; \ + use (LBXDrawableCache(client), _dstDcache); \ + } \ + if (_gcache == GFXCacheNone) { \ + gfx_gc_miss++; \ + push (LBXGContextCache(client), _gcontext);\ + } else { \ + gfx_gc_hit++; \ + use (LBXGContextCache(client), _gcache); \ + } \ + newreq->cacheEnts = GFXCacheEnts (_dstDcache, _gcache); \ + gfx_total++; \ +} + +static int +reencode_poly(client, lbxreq, reencode_rtn) + ClientPtr client; + CARD8 lbxreq; + int (*reencode_rtn) (); +{ + REQUEST(xPolyPointReq); + XServerPtr server = client->server; + int len = client->req_len << 2; + int space; + xLbxPolyPointReq *newreq = NULL; + char *after; + int bytes; + + GFX_CACHE_DECLARE; + + space = len - sz_xPolyPointReq + sz_xLbxPolyPointReq + GFX_REQ_PAD + 3; + newreq = (xLbxPolyPointReq *) xalloc(space); + if (newreq == NULL) + goto bail; + after = ((char *) newreq) + sz_xLbxPolyPointReq; + GFX_SETUP_DRAWABLE_AND_GC(after); + bytes = (*reencode_rtn) (client, (short *) &stuff[1], + (char *) after, + (len - sz_xPolyPointReq) >> 2); + if (bytes == 0) + goto bail; + FinishLBXRequest(client, REQ_PASSTHROUGH); + newreq->reqType = server->lbxReq; + newreq->lbxReqType = lbxreq; + GFX_SET_DRAWABLE_AND_GC; + len = after - ((char *) newreq) + bytes; + newreq->padBytes = pad[len & 3]; + bzero(((char *) newreq) + len, newreq->padBytes); + len += newreq->padBytes; + newreq->length = len >> 2; + WriteReqToServer(client, len, (char *) newreq, TRUE); + xfree(newreq); + return Success; +bail: + if (newreq) + xfree(newreq); + return ProcStandardRequest(client); + +} + + +/* ARGSUSED */ +static int +reencode_points_origin(client, in, out, count) + ClientPtr client; + register short *in; + register char *out; + int count; +{ + register short diff; + int i; + short inval; + short last_x = 0; + short last_y = 0; + char *start_out = out; + + for (i = 0; i < count; i++, in += 2) { + COPY_AND_SWAPS(inval, in[0]); + diff = inval - last_x; + last_x = inval; + REENCODE_SHORT(diff, out); + COPY_AND_SWAPS(inval, in[1]); + diff = inval - last_y; + last_y = inval; + REENCODE_SHORT(diff, out); + } + return out - start_out; +} + +/* ARGSUSED */ +static int +reencode_points_previous(client, in, out, count) + ClientPtr client; + register short *in; + register char *out; + int count; +{ + int i; + short inval; + char *start_out = out; + + for (i = 0; i < count; i++, in += 2) { + COPY_AND_SWAPS(inval, in[0]); + REENCODE_SHORT(inval, out); + COPY_AND_SWAPS(inval, in[1]); + REENCODE_SHORT(inval, out); + } + return out - start_out; +} + +/* ARGSUSED */ +static int +reencode_segment(client, in, out, count) + ClientPtr client; + register short *in; + register char *out; + int count; +{ + register short diff; + int i; + short inval; + short last_x = 0; + short last_y = 0; + char *start_out = out; + + count >>= 1; + for (i = 0; i < count; i++, in += 4) { + /* reencode (x1, y1) */ + COPY_AND_SWAPS(inval, in[0]); + diff = inval - last_x; + last_x = inval; + REENCODE_SHORT(diff, out); + COPY_AND_SWAPS(inval, in[1]); + diff = inval - last_y; + last_y = inval; + REENCODE_SHORT(diff, out); + + /* reencode (x2, y2) */ + COPY_AND_SWAPS(inval, in[2]); + diff = inval - last_x; + REENCODE_SHORT(diff, out); + COPY_AND_SWAPS(inval, in[3]); + diff = inval - last_y; + REENCODE_SHORT(diff, out); + } + return out - start_out; +} + +/* ARGSUSED */ +static int +reencode_rectangle(client, in, out, count) + ClientPtr client; + register short *in; + register char *out; + int count; +{ + register short diff; + int i; + short inval; + short last_x = 0; + short last_y = 0; + char *start_out = out; + + count >>= 1; + for (i = 0; i < count; i++, in += 4) { + /* reencode (x, y) origin */ + COPY_AND_SWAPS(inval, in[0]); + diff = inval - last_x; + last_x = inval; + REENCODE_SHORT(diff, out); + COPY_AND_SWAPS(inval, in[1]); + diff = inval - last_y; + last_y = inval; + REENCODE_SHORT(diff, out); + + /* reencode (width, height) */ + COPY_AND_SWAPS(inval, in[2]); + REENCODE_USHORT(inval, out); + COPY_AND_SWAPS(inval, in[3]); + REENCODE_USHORT(inval, out); + } + return out - start_out; +} + +/* ARGSUSED */ +static int +reencode_arc(client, in, out, count) + ClientPtr client; + register short *in; + register char *out; + int count; +{ + register short diff; + int i; + short inval; + short last_x = 0; + short last_y = 0; + char *start_out = out; + + count = count / 3; + for (i = 0; i < count; i++, in += 6) { + /* reencode (x, y) origin */ + COPY_AND_SWAPS(inval, in[0]); + diff = inval - last_x; + last_x = inval; + REENCODE_SHORT(diff, out); + COPY_AND_SWAPS(inval, in[1]); + diff = inval - last_y; + last_y = inval; + REENCODE_SHORT(diff, out); + + /* reencode (width, height) */ + COPY_AND_SWAPS(inval, in[2]); + REENCODE_USHORT(inval, out); + COPY_AND_SWAPS(inval, in[3]); + REENCODE_USHORT(inval, out); + + /* reencode (angle1, angle2) */ + COPY_AND_SWAPS(inval, in[4]); + REENCODE_ANGLE(inval, out); + COPY_AND_SWAPS(inval, in[5]); + REENCODE_ANGLE(inval, out); + } + return out - start_out; +} + +int +ProcLBXPolyPoint(client) + ClientPtr client; +{ + REQUEST(xPolyPointReq); + int (*reencode_rtn) (); + + reencode_rtn = (stuff->coordMode) ? reencode_points_previous : + reencode_points_origin; + return reencode_poly(client, X_LbxPolyPoint, reencode_rtn); +} + +int +ProcLBXPolyLine(client) + ClientPtr client; +{ + REQUEST(xPolyLineReq); + int (*reencode_rtn) (); + + reencode_rtn = (stuff->coordMode) ? reencode_points_previous : + reencode_points_origin; + return reencode_poly(client, X_LbxPolyLine, reencode_rtn); +} + +int +ProcLBXPolySegment(client) + ClientPtr client; +{ + return reencode_poly(client, X_LbxPolySegment, reencode_segment); +} + +int +ProcLBXPolyRectangle(client) + ClientPtr client; +{ + return reencode_poly(client, X_LbxPolyRectangle, reencode_rectangle); +} + +int +ProcLBXPolyArc(client) + ClientPtr client; +{ + return reencode_poly(client, X_LbxPolyArc, reencode_arc); +} + +int +ProcLBXFillPoly(client) + ClientPtr client; +{ + REQUEST(xFillPolyReq); + XServerPtr server = client->server; + int len = client->req_len << 2; + xLbxFillPolyReq *newreq = NULL; + char *after; + int bytes; + int space; + int (*reencode_rtn) (); + + GFX_CACHE_DECLARE; + + reencode_rtn = (stuff->coordMode) ? reencode_points_previous : + reencode_points_origin; + + space = len - sz_xFillPolyReq + sz_xLbxPolyPointReq + GFX_REQ_PAD + 3; + newreq = (xLbxFillPolyReq *) xalloc(space); + if (newreq == NULL) + goto bail; + after = ((char *) newreq) + sz_xLbxFillPolyReq; + GFX_SETUP_DRAWABLE_AND_GC(after); + bytes = (*reencode_rtn) (client, (short *) &stuff[1], after, + (len - sz_xFillPolyReq) >> 2); + if (bytes == 0) + goto bail; + + FinishLBXRequest(client, REQ_PASSTHROUGH); + newreq->reqType = server->lbxReq; + newreq->lbxReqType = X_LbxFillPoly; + newreq->shape = stuff->shape; + GFX_SET_DRAWABLE_AND_GC; + len = after - ((char *) newreq) + bytes; + newreq->padBytes = pad[len & 3]; + bzero(((char *) newreq) + len, newreq->padBytes); + len += newreq->padBytes; + newreq->length = len >> 2; + WriteReqToServer(client, len, (char *) newreq, TRUE); + xfree(newreq); + return Success; +bail: + if (newreq) + xfree(newreq); + return ProcStandardRequest(client); +} + +int +ProcLBXPolyFillRectangle(client) + ClientPtr client; +{ + return reencode_poly(client, X_LbxPolyFillRectangle, reencode_rectangle); +} + +int +ProcLBXPolyFillArc(client) + ClientPtr client; +{ + return reencode_poly(client, X_LbxPolyFillArc, reencode_arc); +} + +static int +reencode_copy(client, in, out) + ClientPtr client; + register xCopyAreaReq *in; + register char *out; +{ + char *start_out = out; + + SWAP_REENCODE_PSHORT(in->srcX, out); + SWAP_REENCODE_PSHORT(in->srcY, out); + SWAP_REENCODE_PSHORT(in->dstX, out); + SWAP_REENCODE_PSHORT(in->dstY, out); + SWAP_REENCODE_USHORT(in->width, out); + SWAP_REENCODE_USHORT(in->height, out); + return out - start_out; +} + +int +ProcLBXCopyArea(client) + ClientPtr client; +{ + REQUEST(xCopyAreaReq); + XServerPtr server = client->server; + int len; + xLbxCopyAreaReq *newreq = NULL; + unsigned long space[(SIZEOF(xLbxCopyAreaReq) + GFX_SRC_DST_REQ_PAD + 7 * sizeof(unsigned long) - 1) / sizeof(unsigned long)]; + char *after; + int extra; + int bytes; + + GFX_SRC_DST_CACHE_DECLARE; + + newreq = (xLbxCopyAreaReq *) space; + after = ((char *) newreq) + sz_xLbxCopyAreaReq; + GFX_SETUP_SRC_DST_DRAWABLE_AND_GC(after); + bytes = reencode_copy(client, stuff, after); + if (bytes == 0) + goto bail; + FinishLBXRequest(client, REQ_PASSTHROUGH); + newreq->reqType = server->lbxReq; + newreq->lbxReqType = X_LbxCopyArea; + GFX_SET_SRC_DST_DRAWABLE_AND_GC; + len = ((after + bytes) - ((char *) newreq)); + extra = pad[len & 3]; + bzero(((char *) newreq) + len, extra); + len += extra; + newreq->length = len >> 2; + WriteReqToServer(client, len, (char *) newreq, TRUE); + return Success; +bail: + return ProcStandardRequest(client); +} + +int +ProcLBXCopyPlane(client) + ClientPtr client; +{ + REQUEST(xCopyPlaneReq); + XServerPtr server = client->server; + int len; + xLbxCopyPlaneReq *newreq = NULL; + unsigned long space[(SIZEOF(xLbxCopyPlaneReq) + GFX_SRC_DST_REQ_PAD + 7 * sizeof(unsigned long) - 1) / sizeof(unsigned long)]; + char *after; + int bytes; + int extra; + + GFX_SRC_DST_CACHE_DECLARE; + + newreq = (xLbxCopyPlaneReq *) space; + after = ((char *) newreq) + sz_xLbxCopyPlaneReq; + GFX_SETUP_SRC_DST_DRAWABLE_AND_GC(after); + bytes = reencode_copy(client, (xCopyAreaReq *)stuff, after); + if (bytes == 0) + goto bail; + FinishLBXRequest(client, REQ_PASSTHROUGH); + newreq->reqType = server->lbxReq; + newreq->bitPlane = stuff->bitPlane; + newreq->lbxReqType = X_LbxCopyPlane; + GFX_SET_SRC_DST_DRAWABLE_AND_GC; + len = ((after + bytes) - ((char *) newreq)); + extra = pad[len & 3]; + bzero(((char *) newreq) + len, extra); + len += extra; + newreq->length = len >> 2; + WriteReqToServer(client, len, (char *) newreq, TRUE); + return Success; +bail: + return ProcStandardRequest(client); +} + +static int +reencode_text_pos(client, in, out) + ClientPtr client; + xPolyTextReq *in; + char *out; +{ + char *start_out; + + start_out = out; + SWAP_REENCODE_PSHORT(in->x, out); + SWAP_REENCODE_PSHORT(in->y, out); + return out - start_out; +} + +int +ProcLBXPolyText(client) + ClientPtr client; +{ + REQUEST(xPolyTextReq); + XServerPtr server = client->server; + int len = client->req_len << 2; + xLbxPolyTextReq *newreq = NULL; + int space; + char *after; + int bytes; + int extra; + + GFX_CACHE_DECLARE; + + space = len - sz_xPolyTextReq + sz_xLbxPolyTextReq + GFX_REQ_PAD + 4 + 3; + newreq = (xLbxPolyTextReq *) xalloc(space); + if (newreq == NULL) + goto bail; + after = ((char *) newreq) + sz_xLbxPolyTextReq; + GFX_SETUP_DRAWABLE_AND_GC(after); + /* Reencode the text position */ + bytes = reencode_text_pos(client, stuff, after); + if (bytes == 0) + goto bail; + /* copy the text elements */ + memcpy(after + bytes, (char *) &stuff[1], len - sz_xPolyTextReq); + bytes += len - sz_xPolyTextReq; + FinishLBXRequest(client, REQ_PASSTHROUGH); + newreq->reqType = server->lbxReq; + newreq->lbxReqType = stuff->reqType == X_PolyText8 ? X_LbxPolyText8 : X_LbxPolyText16; + GFX_SET_DRAWABLE_AND_GC; + len = ((after + bytes) - ((char *) newreq)); + extra = pad[len & 3]; + bzero(((char *) newreq) + len, extra); + len += extra; + newreq->length = len >> 2; + WriteReqToServer(client, len, (char *) newreq, TRUE); + xfree(newreq); + return Success; +bail: + if (newreq) + xfree(newreq); + return ProcStandardRequest(client); +} + +int +ProcLBXImageText(client) + ClientPtr client; +{ + REQUEST(xImageTextReq); + XServerPtr server = client->server; + int len = client->req_len << 2; + xLbxImageTextReq *newreq = NULL; + int space; + char *after; + int bytes; + int extra; + + GFX_CACHE_DECLARE; + + space = len - sz_xImageTextReq + sz_xLbxImageTextReq + GFX_REQ_PAD + 4 + 3; + newreq = (xLbxImageTextReq *) xalloc(space); + if (newreq == NULL) + goto bail; + after = ((char *) newreq) + sz_xLbxImageTextReq; + GFX_SETUP_DRAWABLE_AND_GC(after); + /* Reencode the text position */ + bytes = reencode_text_pos(client, (xPolyTextReq *) stuff, after); + if (bytes == 0) + goto bail; + /* copy the text elements */ + memcpy(after + bytes, (char *) &stuff[1], len - sz_xImageTextReq); + bytes += len - sz_xImageTextReq; + FinishLBXRequest(client, REQ_PASSTHROUGH); + newreq->reqType = server->lbxReq; + newreq->lbxReqType = stuff->reqType == X_ImageText8 ? X_LbxImageText8 : X_LbxImageText16; + newreq->nChars = stuff->nChars; + GFX_SET_DRAWABLE_AND_GC; + len = ((after + bytes) - ((char *) newreq)); + extra = pad[len & 3]; + bzero(((char *) newreq) + len, extra); + len += extra; + newreq->length = len >> 2; + WriteReqToServer(client, len, (char *) newreq, TRUE); + xfree(newreq); + return Success; +bail: + if (newreq) + xfree(newreq); + return ProcStandardRequest(client); +} + +static void +SwapXPutImage(req) + xPutImageReq *req; +{ + char n; + + swaps(&req->width, n); + swaps(&req->height, n); + swaps(&req->dstX, n); + swaps(&req->dstY, n); +} + +static char * +reencode_putimage(stuff, newreq) + xPutImageReq *stuff; + xLbxPutImageReq *newreq; +{ + char *out; + + if (stuff->format > ZPixmap || stuff->leftPad > 31 || + !stuff->depth || stuff->depth > 32 || + (stuff->format == ZPixmap && stuff->leftPad != 0)) + return 0; + + out = (char *)newreq + sz_xLbxPutImageReq; + if (!stuff->leftPad && stuff->depth <= 8) + newreq->bitPacked = 0x80 | (stuff->format << 5) | + ((stuff->depth - 1) << 2); + else { + newreq->bitPacked = ((stuff->depth - 1) << 2); + *out++ = (stuff->format << 5) | stuff->leftPad; + } + REENCODE_USHORT(stuff->width, out); + REENCODE_USHORT(stuff->height, out); + REENCODE_PSHORT(stuff->dstX, out); + REENCODE_PSHORT(stuff->dstY, out); + + return out; +} + +#define MaxPutImageSz sz_xLbxPutImageReq + 1 + 2 + 2 + 2 + 2 + GFX_REQ_PAD + +int +ProcLBXPutImage(client) + ClientPtr client; +{ + REQUEST(xPutImageReq); + XServerPtr server = client->server; + unsigned long space[(MaxPutImageSz + sizeof(unsigned long) - 1) / sizeof(unsigned long)]; + xLbxPutImageReq *newreq; + char *data = NULL; + char *out; + int len, + reqlen, + method = 0, + compBytes, + status; +#ifdef LBX_STATS + float percentCompression; + char *methodName; +#endif + LbxBitmapCompMethod *bcompMethod = NULL; + LbxPixmapCompMethod *pcompMethod = NULL; + GFX_CACHE_DECLARE; + + status = LBX_IMAGE_COMPRESS_SUCCESS; + if (stuff->format != ZPixmap || + (stuff->depth == 1 && LBXZBitsPerPixel1(client) == 1)) + { + bcompMethod = LbxFindPreferredBitmapCompMethod (client->server); + if (!bcompMethod) + status = LBX_IMAGE_COMPRESS_NO_SUPPORT; + } else { + pcompMethod = LbxFindPreferredPixmapCompMethod (client->server, + (int) stuff->format, (int) stuff->depth); + if (!pcompMethod) + status = LBX_IMAGE_COMPRESS_NO_SUPPORT; + } + + if (status == LBX_IMAGE_COMPRESS_NO_SUPPORT && + client->req_len >= 64 + (sz_xPutImageReq >> 2)) + return ProcStandardRequest(client); + + if (client->swapped) + SwapXPutImage(stuff); + + newreq = (xLbxPutImageReq *)space; + newreq->reqType = server->lbxReq; + newreq->lbxReqType = X_LbxPutImage; + out = reencode_putimage(stuff, newreq); + + if (!out) { + SwapXPutImage(stuff); + return ProcStandardRequest(client); + } + + GFX_SETUP_DRAWABLE_AND_GC(out); + + reqlen = out - (char *)space; + len = client->req_len << 2; + + data = (char *) xalloc(len); + if (!data || status == LBX_IMAGE_COMPRESS_NO_SUPPORT) + { + if (!data) + status = LBX_IMAGE_COMPRESS_BAD_MALLOC; + } + else if (stuff->format != ZPixmap || + (stuff->depth == 1 && LBXZBitsPerPixel1(client) == 1)) + { + int ppl, bpl, nbytes; + + if (!bcompMethod->inited) + { + if (bcompMethod->compInit) + (*bcompMethod->compInit)(); + bcompMethod->inited = 1; + } + + ppl = stuff->width + stuff->leftPad; + if (LBXBitmapBitOrder(client) != LBXImageByteOrder(client)) + ppl = ((ppl + LBXBitmapScanlineUnit(client) - 1) & + ~LBXBitmapScanlineUnit(client)); + bpl = (((ppl + LBXBitmapScanlinePad(client) - 1) / + LBXBitmapScanlinePad(client)) * + (LBXBitmapScanlinePad(client) >> 3)); + nbytes = bpl * stuff->height; + if (stuff->format == XYPixmap) + nbytes *= stuff->depth; + status = (*bcompMethod->compFunc) ( + (unsigned char *) &stuff[1], + (unsigned char *) data + reqlen, + len - reqlen, + nbytes, + ppl, + bpl, + LBXBitmapBitOrder(client) == LSBFirst, + &compBytes); + + method = bcompMethod->methodOpCode; +#ifdef LBX_STATS + methodName = bcompMethod->methodName; +#endif + } + else + { + if (!pcompMethod->inited) + { + if (pcompMethod->compInit) + (*pcompMethod->compInit)(); + pcompMethod->inited = 1; + } + + status = (*pcompMethod->compFunc) ( + (char *) &stuff[1], + (char *) data + reqlen, + len - reqlen, + (int) stuff->format, + (int) stuff->depth, + (int) stuff->height, + (int) (len - sz_xPutImageReq) / stuff->height, + &compBytes); + + method = pcompMethod->methodOpCode; +#ifdef LBX_STATS + methodName = pcompMethod->methodName; +#endif + } + +#ifdef LBX_STATS + fprintf(stderr, "PutImage (xid=%x, w=%d, h=%d, x=%d, y=%d): ", + stuff->drawable, stuff->width, stuff->height, + stuff->dstX, stuff->dstY); +#endif + + if (status != LBX_IMAGE_COMPRESS_SUCCESS) + { +#ifdef LBX_STATS + fprintf(stderr, "image not compressed - "); + + if (status == LBX_IMAGE_COMPRESS_NO_SUPPORT) + fprintf(stderr, "no support for compressing this image\n"); + else if (status == LBX_IMAGE_COMPRESS_NOT_WORTH_IT) + fprintf(stderr, "not worth it\n"); + else if (status == LBX_IMAGE_COMPRESS_BAD_MALLOC) + fprintf(stderr, "bad malloc\n"); +#endif + + if (!data || len >= 256 || reqlen > sz_xPutImageReq) { + if (data) + xfree(data); + + if (client->swapped) /* Swap it back */ + SwapXPutImage(stuff); + + return ProcStandardRequest(client); + } + method = 0; + compBytes = len - sz_xPutImageReq; + memcpy(data + reqlen, (char *) &stuff[1], compBytes); + } + + GFX_SET_DRAWABLE_AND_GC; + + newreq->compressionMethod = method; + + len = reqlen + compBytes; + newreq->bitPacked |= pad[len & 3]; + len += pad[len & 3]; + newreq->length = len >> 2; + memcpy(data, (char *)newreq, reqlen); + + FinishLBXRequest(client, REQ_PASSTHROUGH); + +#ifdef LBX_STATS + percentCompression = 100.0 * (1.0 - + ((float) (compBytes + pad[compBytes & 3]) / + (float) ((client->req_len << 2) - sz_xPutImageReq))); + + fprintf(stderr, "%f percent compression (%s)\n", + percentCompression, methodName); +#endif + + /* + * If the compressed image is greater that 25% of the original + * image, or is small enough to fit into the delta cache, then + * run the PutImage request through the regular stream + * compressor. Otherwise, just write the compressed image. + */ + + if (newreq->length > (client->req_len >> 2) || + DELTA_CACHEABLE(&server->outdeltas, len)) + WriteReqToServer(client, len, data, TRUE); + else + WriteToServerUncompressed(client, len, data, TRUE); + + xfree(data); + return Success; +} + + +int +ProcLBXGetImage(client) + ClientPtr client; +{ + REQUEST(xGetImageReq); + ReplyStuffPtr nr; + + nr = NewReply(client, client->server->lbxReq, X_LbxGetImage, + GetLbxImageReply); + + if (!nr) + return ProcStandardRequest(client); + + if (client->swapped) { + char n; + + swapl(&stuff->drawable, n); + swaps(&stuff->x, n); + swaps(&stuff->y, n); + swaps(&stuff->width, n); + swaps(&stuff->height, n); + swapl(&stuff->planeMask, n); + } + nr->request_info.lbxgetimage.width = stuff->width; + nr->request_info.lbxgetimage.height = stuff->height; + nr->request_info.lbxgetimage.format = stuff->format; + +#ifdef LBX_STATS + nr->request_info.lbxgetimage.drawable = stuff->drawable; + nr->request_info.lbxgetimage.x = stuff->x; + nr->request_info.lbxgetimage.y = stuff->y; +#endif + + FinishLBXRequest(client, REQ_PASSTHROUGH); + SendGetImage(client, stuff->drawable, stuff->x, stuff->y, + stuff->width, stuff->height, stuff->planeMask, + stuff->format); + return Success; +} + +static Bool +GetLbxImageReply(client, nr, data) + ClientPtr client; + ReplyStuffPtr nr; + char *data; +{ + xLbxGetImageReply *rep; + xGetImageReply reply; + pointer imageData; + int freeIt = 1; +#ifdef LBX_STATS + char *methodName; +#endif + + rep = (xLbxGetImageReply *) data; + + if (client->swapped) { + char n; + + swapl(&rep->xLength, n); + swapl(&rep->visual, n); + } + /* +1 is because fillspan in DecodeFaxG42D seems to go 1 byte too far, + * and I don't want to mess with that code */ + if ((imageData = (pointer) xalloc((rep->xLength << 2) + 1)) == NULL) + return FALSE; + + if (rep->compressionMethod == LbxImageCompressNone) + { + xfree((char *) imageData); + imageData = (pointer) &rep[1]; + freeIt = 0; + } + else if (nr->request_info.lbxgetimage.format != ZPixmap || + (rep->depth == 1 && LBXZBitsPerPixel1(client) == 1)) + { + LbxBitmapCompMethod *compMethod; + + compMethod = LbxLookupBitmapCompMethod (client->server, + rep->compressionMethod); + + if (!compMethod) + { + xfree((char *) imageData); + return FALSE; + } + else + { + int ppl, bpl, nbytes; + + if (!compMethod->inited) + { + if (compMethod->compInit) + (*compMethod->compInit)(); + compMethod->inited = 1; + } + + ppl = nr->request_info.lbxgetimage.width; + if (LBXBitmapBitOrder(client) != LBXImageByteOrder(client)) + ppl = ((ppl + LBXBitmapScanlineUnit(client) - 1) & + ~LBXBitmapScanlineUnit(client)); + bpl = (((ppl + LBXBitmapScanlinePad(client) - 1) / + LBXBitmapScanlinePad(client)) * + (LBXBitmapScanlinePad(client) >> 3)); + nbytes = bpl * nr->request_info.lbxgetimage.height; + if (nr->request_info.lbxgetimage.format == XYPixmap) + nbytes *= rep->depth; + + (*compMethod->decompFunc) ( + (unsigned char *) &rep[1], + (unsigned char *) imageData, + nbytes, + ppl, + bpl, + LBXBitmapBitOrder(client) == LSBFirst); + +#ifdef LBX_STATS + methodName = compMethod->methodName; +#endif + } + } + else + { + LbxPixmapCompMethod *compMethod; + + compMethod = LbxLookupPixmapCompMethod (client->server, + rep->compressionMethod); + + if (!compMethod) + { + xfree((char *) imageData); + return FALSE; + } + else + { + if (!compMethod->inited) + { + if (compMethod->compInit) + (*compMethod->compInit)(); + compMethod->inited = 1; + } + + (*compMethod->decompFunc) ( + (char *) &rep[1], + (char *) imageData, + (int) nr->request_info.lbxgetimage.height, + (rep->xLength << 2) / nr->request_info.lbxgetimage.height); + +#ifdef LBX_STATS + methodName = compMethod->methodName; +#endif + } + } + + reply.type = X_Reply; + reply.depth = rep->depth; + reply.sequenceNumber = rep->sequenceNumber; + reply.length = rep->xLength; + reply.visual = rep->visual; + + if (client->swapped) + SwapGetImageReply(&reply); + +#ifdef LBX_STATS + fprintf (stderr, "GetImage (xid=%x, w=%d, h=%d, x=%d, y=%d): ", + nr->request_info.lbxgetimage.drawable, + nr->request_info.lbxgetimage.width, + nr->request_info.lbxgetimage.height, + nr->request_info.lbxgetimage.x, + nr->request_info.lbxgetimage.y); + if (rep->compressionMethod == LbxImageCompressNone) { + fprintf(stderr, "image not compressed\n"); + } else { + float percentCompression = 100.0 * (1.0 - + ((float) rep->lbxLength / (float) rep->xLength)); + + fprintf(stderr, "%f percent compression (%s)\n", + percentCompression, methodName); + } +#endif + + WriteToClient(client, sizeof(xGetImageReply), &reply); + WriteToClient(client, rep->xLength << 2, imageData); + + if (freeIt) + xfree((char *) imageData); + + return TRUE; +} diff --git a/app/lbxproxy/di/globals.c b/app/lbxproxy/di/globals.c new file mode 100644 index 000000000..51843bb6e --- /dev/null +++ b/app/lbxproxy/di/globals.c @@ -0,0 +1,56 @@ +/* $Xorg: globals.c,v 1.4 2001/02/09 02:05:31 xorgcvs Exp $ */ +/************************************************************ + +Copyright 1987, 1998 The Open Group + +Permission to use, copy, modify, distribute, and sell this software and its +documentation for any purpose is hereby granted without fee, provided that +the above copyright notice appear in all copies and that both that +copyright notice and this permission notice appear in supporting +documentation. + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the name of The Open Group shall not be +used in advertising or otherwise to promote the sale, use or other dealings +in this Software without prior written authorization from The Open Group. + + +Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. + + All Rights Reserved + +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, +provided that the above copyright notice appear in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the name of Digital not be +used in advertising or publicity pertaining to distribution of the +software without specific, written prior permission. + +DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING +ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL +DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR +ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, +ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS +SOFTWARE. + +********************************************************/ + +#include "misc.h" +#include "lbx.h" + +ClientPtr *clients; +int currentMaxClients; /* current size of clients array */ + +LbxLargeRequestRec *largeRequestQueue[LARGE_REQUEST_QUEUE_LEN]; +int numLargeRequestsInQueue = 0; diff --git a/app/lbxproxy/di/init.c b/app/lbxproxy/di/init.c new file mode 100644 index 000000000..e805b4838 --- /dev/null +++ b/app/lbxproxy/di/init.c @@ -0,0 +1,272 @@ +/* $Xorg: init.c,v 1.4 2001/02/09 02:05:31 xorgcvs Exp $ */ +/* + +Copyright 1998 The Open Group + +Permission to use, copy, modify, distribute, and sell this software and its +documentation for any purpose is hereby granted without fee, provided that +the above copyright notice appear in all copies and that both that +copyright notice and this permission notice appear in supporting +documentation. + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the name of The Open Group shall not be +used in advertising or otherwise to promote the sale, use or other dealings +in this Software without prior written authorization from The Open Group. + +*/ +/* + * Copyright 1992 Network Computing Devices + * + * Permission to use, copy, modify, distribute, and sell this software and its + * documentation for any purpose is hereby granted without fee, provided that + * the above copyright notice appear in all copies and that both that + * copyright notice and this permission notice appear in supporting + * documentation, and that the name of NCD. not be used in advertising or + * publicity pertaining to distribution of the software without specific, + * written prior permission. NCD. makes no representations about the + * suitability of this software for any purpose. It is provided "as is" + * without express or implied warranty. + * + * NCD. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL NCD. + * BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION + * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN + * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + * + */ +/* $XFree86: xc/programs/lbxproxy/di/init.c,v 1.5 2001/08/01 00:45:00 tsi Exp $ */ + +/* + * This file is used for anything that needs to dip into Xlib structures + */ + +/* lbxproxy source files are compiled with -D_XSERVER64 on 64 bit machines. + * For the most part, this is appropriate. However, for this file it + * is not, because we make Xlib calls here. + */ +#undef _XSERVER64 +#include "wire.h" +#include "util.h" +#include +#include +#include +#include + +/* Hook up to an X server and set up a multiplexing LBX encoded connection */ +struct _XDisplay* +DisplayOpen (dpy_name, requestp, eventp, errorp, sequencep) + char *dpy_name; + int *requestp, *eventp, *errorp; + int *sequencep; +{ + Display *dpy; + int lbxMajor, lbxMinor; + Window win; + XTextProperty name; + XClassHint class; + + dpy = XOpenDisplay (dpy_name); + if (!dpy) + return NULL; + + win = XCreateSimpleWindow(dpy, DefaultRootWindow(dpy), + -1, -1, 1, 1, 0, 0, 0); + class.res_name = "lbxproxy"; + class.res_class = "LbxProxy"; + XStringListToTextProperty(&class.res_name, 1, &name); + XSetWMProperties(dpy, win, &name, NULL, NULL, 0, NULL, NULL, &class); + + if (!XLbxQueryExtension (dpy, requestp, eventp, errorp)) { + ErrorF("X server doesn't have LBX extension\n"); + XCloseDisplay(dpy); + return NULL; + } + if (!XLbxQueryVersion (dpy, &lbxMajor, &lbxMinor)) { + ErrorF("LBX extension query failed\n"); + XCloseDisplay(dpy); + return NULL; + } + if (lbxMajor != LBX_MAJOR_VERSION || lbxMinor != LBX_MINOR_VERSION) + ErrorF("LBX version numbers don't match (proxy %d.%d, server %d.%d), good luck!\n", LBX_MAJOR_VERSION, LBX_MINOR_VERSION, lbxMajor, lbxMinor); + *sequencep = NextRequest (dpy) - 1; + return dpy; +} + +int DisplayConnectionNumber (dpy) + struct _XDisplay* dpy; +{ + return ConnectionNumber (dpy); +} + +void DisplayGetConnSetup (dpy, cs, cs_len, change_type, changes, change_len) + struct _XDisplay* dpy; + xConnSetup** cs; + int* cs_len; + int change_type; + CARD32* changes; + int change_len; +{ + char* datap; + xConnSetup setup; + int olen; + int i, s, d, v; + static int padlength[4] = {0, 3, 2, 1}; + XPixmapFormatValues* pixmap_formats; + int npixmap_formats; + int min_keycode, max_keycode; + xWindowRoot root; + Screen* scrnp; + int numScreens; + int numVideoScreens; + int scrlist[16]; /* are there servers with more than 16 screens? */ + int scrldex; + + if (change_type == 2) { + numScreens = change_len - 6; + numVideoScreens = 1; + } else + numScreens = numVideoScreens = ScreenCount(dpy); + + pixmap_formats = XListPixmapFormats (dpy, &npixmap_formats); + XDisplayKeycodes (dpy, &min_keycode, &max_keycode); + + setup.release = VendorRelease(dpy); + setup.ridBase = dpy->resource_base; + setup.ridMask = dpy->resource_mask; + setup.motionBufferSize = XDisplayMotionBufferSize (dpy); + setup.nbytesVendor = strlen (ServerVendor (dpy)); + setup.maxRequestSize = XMaxRequestSize (dpy); + setup.numRoots = ScreenCount(dpy); + setup.numFormats = npixmap_formats; + setup.imageByteOrder = ImageByteOrder(dpy); + setup.bitmapBitOrder = BitmapBitOrder(dpy); + setup.bitmapScanlineUnit = BitmapUnit(dpy); + setup.bitmapScanlinePad = BitmapPad(dpy); + setup.minKeyCode = min_keycode; + setup.maxKeyCode = max_keycode; + + olen = sizeof (xConnSetup) + ((setup.nbytesVendor + 3) & ~3) + + (setup.numFormats * sizeof (xPixmapFormat)); + + scrldex = 0; + if (change_type != 2) { + olen += (setup.numRoots * sizeof (xWindowRoot)); + + for (s = 0; s < numScreens; s++) { + scrlist[scrldex++] = s; + for (d = 0; d < ScreenOfDisplay(dpy,s)->ndepths; d++) { + olen += sizeof (xDepth) + + sizeof (xVisualType) * ScreenOfDisplay(dpy,s)->depths[d].nvisuals; + } + } + } else { + olen += ((1 + numScreens - numVideoScreens) * sizeof (xWindowRoot)); + + /* find the one video screen that matches the appgroup's */ + for (s = 0; s < numScreens; s++) + if (RootWindow (dpy, s) == (Window) changes[1]) + break; + scrlist[scrldex++] = s; + for (d = 0; d < ScreenOfDisplay(dpy,s)->ndepths; d++) { + olen += sizeof (xDepth) + + sizeof (xVisualType) * ScreenOfDisplay(dpy,s)->depths[d].nvisuals; + } + /* and any print screens */ + for (s = numVideoScreens; s < numScreens; s++) { + scrlist[scrldex++] = s; + for (d = 0; d < ScreenOfDisplay(dpy,s)->ndepths; d++) { + olen += sizeof (xDepth) + + sizeof (xVisualType) * ScreenOfDisplay(dpy,s)->depths[d].nvisuals; + } + } + } + + datap = (char*) xalloc (olen); + if (datap == NULL) { + Xfree (pixmap_formats); + *cs = NULL; + *cs_len = 0; + return; + } + + *cs = (xConnSetup*) datap; + *cs_len = olen; + memmove (datap, &setup, sizeof (xConnSetup)); + datap += sizeof (xConnSetup); + memmove (datap, ServerVendor(dpy), setup.nbytesVendor); + datap += setup.nbytesVendor; + i = padlength[setup.nbytesVendor & 3]; + while (--i >= 0) + *datap++ = 0; + + for (i = 0; i < npixmap_formats; i++) { + xPixmapFormat pf; + + pf.depth = pixmap_formats[i].depth; + pf.bitsPerPixel = pixmap_formats[i].bits_per_pixel; + pf.scanLinePad = pixmap_formats[i].scanline_pad; + memmove (datap, &pf, sizeof (xPixmapFormat)); + datap += sizeof (xPixmapFormat); + } + + for (s = 0; s < scrldex; s++) { + xDepth dep; + Depth* depthp; + + scrnp = ScreenOfDisplay(dpy,scrlist[s]); + root.windowId = scrnp->root; + root.defaultColormap = scrnp->cmap; + root.whitePixel = scrnp->white_pixel; + root.blackPixel = scrnp->black_pixel; + root.currentInputMask = scrnp->root_input_mask; + root.pixWidth = scrnp->width; + root.pixHeight = scrnp->height; + root.mmWidth = scrnp->mwidth; + root.mmHeight = scrnp->mheight; + root.minInstalledMaps = scrnp->min_maps; + root.maxInstalledMaps = scrnp->max_maps; + root.rootVisualID = scrnp->root_visual->visualid; + root.backingStore = scrnp->backing_store; + root.saveUnders = scrnp->save_unders; + root.rootDepth = scrnp->root_depth; + root.nDepths = scrnp->ndepths; + memmove (datap, &root, sizeof (xWindowRoot)); + datap += sizeof (xWindowRoot); + + for (d = 0; d < scrnp->ndepths; d++) { + xVisualType vis; + Visual* visp; + + depthp = &scrnp->depths[d]; + dep.depth = depthp->depth; + dep.nVisuals = depthp->nvisuals; + memmove (datap, &dep, sizeof (xDepth)); + datap += sizeof (xDepth); + + for (v = 0; v < depthp->nvisuals; v++) { + visp = &depthp->visuals[v]; + vis.visualID = visp->visualid; + vis.class = visp->class; + vis.bitsPerRGB = visp->bits_per_rgb; + vis.colormapEntries = visp->map_entries; + vis.redMask = visp->red_mask; + vis.greenMask = visp->green_mask; + vis.blueMask = visp->blue_mask; + memmove (datap, &vis, sizeof (xVisualType)); + datap += sizeof (xVisualType); + } + } + } + Xfree (pixmap_formats); +} diff --git a/app/lbxproxy/di/lbxfuncs.c b/app/lbxproxy/di/lbxfuncs.c new file mode 100644 index 000000000..0ecb9b670 --- /dev/null +++ b/app/lbxproxy/di/lbxfuncs.c @@ -0,0 +1,1446 @@ +/* $Xorg: lbxfuncs.c,v 1.3 2000/08/17 19:53:55 cpqbld Exp $ */ +/* + * Copyright 1994 Network Computing Devices, Inc. + * Copyright 1996 X Consortium, Inc. + * + * Permission to use, copy, modify, distribute, and sell this software and + * its documentation for any purpose is hereby granted without fee, provided + * that the above copyright notice appear in all copies and that both that + * copyright notice and this permission notice appear in supporting + * documentation, and that the name Network Computing Devices, Inc. not be + * used in advertising or publicity pertaining to distribution of this + * software without specific, written prior permission. + * + * THIS SOFTWARE IS PROVIDED `AS-IS'. NETWORK COMPUTING DEVICES, INC., + * DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING WITHOUT + * LIMITATION ALL IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A + * PARTICULAR PURPOSE, OR NONINFRINGEMENT. IN NO EVENT SHALL NETWORK + * COMPUTING DEVICES, INC., BE LIABLE FOR ANY DAMAGES WHATSOEVER, INCLUDING + * SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES, INCLUDING LOSS OF USE, DATA, + * OR PROFITS, EVEN IF ADVISED OF THE POSSIBILITY THEREOF, AND REGARDLESS OF + * WHETHER IN AN ACTION IN CONTRACT, TORT OR NEGLIGENCE, ARISING OUT OF OR IN + * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + * + */ +/* $XFree86: xc/programs/lbxproxy/di/lbxfuncs.c,v 1.6tsi Exp $ */ + +/* + * top level LBX request & reply handling + */ + +/* + * requests copy out interesting stuff and then swap so original data + * is left alone as much as possible. note that the length field + * is *not* swapped + * + * replied data is copied yet again before swapping because the data + * may be stored as a tag result and we don't want to change that. + */ + + +#include +#include "assert.h" +#include "lbx.h" +#include "atomcache.h" +#include "util.h" +#include "init.h" +#include "tags.h" +#include "resource.h" +#include "wire.h" +#include "swap.h" +#include "reqtype.h" +#include "lbxext.h" +#include "proxyopts.h" + +#ifdef DEBUG +extern int lbxDebug; +#endif + +static Bool intern_atom_reply(); +static Bool get_atom_name_reply(); +static Bool get_mod_map_reply(); +static Bool get_key_map_reply(); +static Bool sync_reply(); +static Bool get_queryfont_reply(); +static Bool GetWinAttrAndGeomReply(); + +#define reply_length(cp,rep) ((rep)->type==X_Reply ? \ + 32 + (HostUnswapLong((cp),(rep)->length) << 2) \ + : 32) + +char protocolMode = PROTOCOL_FULL; + +/* ARGSUSED */ +static void +get_connection_info(client, cs, cs_len, change_type, changes, changes_len) + ClientPtr client; + xConnSetup *cs; + int cs_len; + int change_type; + CARD32 *changes; + int changes_len; +{ + xWindowRoot *root; + xDepth *depth; + xVisualType *vis; + char *dp = (char *) cs; + int i, + j, + k; + static int pad[4] = {0, 3, 2, 1}; + + if (!changes) + return; + + cs->ridBase = changes[0]; + dp += sizeof(xConnSetup); + /* skip vendor string & pixmap formats */ + dp += cs->nbytesVendor + pad[cs->nbytesVendor & 3]; + for (i = 0; i < cs->numFormats; i++) { + if (((xPixmapFormat *)dp)->depth == 1) + client->ZbitsPerPixel1 = ((xPixmapFormat *)dp)->bitsPerPixel; + dp += sizeof(xPixmapFormat); + } + /* process screens */ + root = (xWindowRoot *) dp; + if (change_type == 2) { + if (changes[2]) + root->rootVisualID = (VisualID) changes[2]; + if (changes[3]) { + root->defaultColormap = (Colormap) changes[3]; + root->whitePixel = changes[4]; + root->blackPixel = changes[5]; + } + } + client->rootWindow = root->windowId; + for (i = 0; i < cs->numRoots; i++) { + if (change_type != 2) { + root->currentInputMask = changes[i + 1]; + } else { + root->currentInputMask = changes[i + 6]; + } + dp += sizeof(xWindowRoot); + for (j = 0; j < root->nDepths; j++) { + depth = (xDepth *) dp; + dp += sizeof(xDepth); + for (k = 0; k < depth->nVisuals; k++) { + vis = (xVisualType *) dp; + CreateVisual(depth->depth, vis); + dp += (sizeof(xVisualType)); + vis = (xVisualType *) dp; + } + } + if (!LookupIDByType(client, root->defaultColormap, RT_COLORMAP)) + CreateColormap(client, + root->defaultColormap, root->rootVisualID); + } +} + +static void +send_setup_reply(ClientPtr client, Bool success, int majorVer, int minorVer, + void *cs, int cs_len) +{ + xConnSetupPrefix reply; + + reply.success = success; + if (!success) { + reply.lengthReason = strlen((char *)cs); + cs_len = reply.lengthReason + 3; + } + reply.majorVersion = majorVer; + reply.minorVersion = minorVer; + reply.length = cs_len >> 2; + + if (client->swapped) + WriteSConnSetupPrefix(client, &reply); + else + (void)WriteToClient(client, sizeof(xConnSetupPrefix), (char *) &reply); + if (success && client->swapped) + WriteSConnectionInfo(client, (unsigned long)(reply.length << 2), cs); + else + (void)WriteToClient(client, (int)(reply.length << 2), cs); +} + +static void +finish_setup_reply(client, cs, cs_len, change_type, changes, changes_len, majorVer, minorVer) + ClientPtr client; + xConnSetup *cs; + int cs_len; + int change_type; + CARD32* changes; + int changes_len; + int majorVer, + minorVer; +{ + get_connection_info(client, cs, cs_len, change_type, changes, changes_len); + client->minKeyCode = cs->minKeyCode; + client->maxKeyCode = cs->maxKeyCode; + client->imageByteOrder = cs->imageByteOrder; + client->bitmapBitOrder = cs->bitmapBitOrder; + client->bitmapScanlineUnit = cs->bitmapScanlineUnit; + client->bitmapScanlinePad = cs->bitmapScanlinePad; + client->ridBase = cs->ridBase; + client->ridMask = cs->ridMask; + FinishInitClientResources (client, cs->ridBase, cs->ridMask); + send_setup_reply(client, TRUE, majorVer, minorVer, cs, cs_len); +} + +/* + * ConnectionSetup data can come from three places: 1) a fully qualified + * connection-setup in the reply, 2) from the tag store, and 3) built + * from the Display* returned by the call the proxy made to XOpenDisplay. + */ + +static void +get_setup_reply(client, data, len) + ClientPtr client; + char *data; + int len; +{ + register xLbxConnSetupPrefix *rep; + TagData td; + xConnSetup *tag_data; + Bool free_td = FALSE; + CARD32* changes = NULL; + int changes_len = 0; + + rep = (xLbxConnSetupPrefix *) data; + if (client->swapped) { + data = (char *)ALLOCATE_LOCAL(len); + memcpy(data, (char *)rep, len); + rep = (xLbxConnSetupPrefix *) data; + SwapLbxConnSetupPrefix(rep); + } + switch (rep->changeType) { + default: + case 0: /* full ConnectionSetup, possibly with tag */ +#ifdef LBX_STATS + getsetup_full++; +#endif + tag_data = (xConnSetup *) &rep[1]; + if (rep->tag != 0) { + if (!TagStoreData(client->server, client->server->global_cache, + rep->tag, rep->length, + LbxTagTypeConnInfo, tag_data)) { + /* tell server we lost it */ + SendInvalidateTag(client, rep->tag); + } + } + len = rep->length << 2; + break; + + case 1: /* LbxNormalDeltas */ + case 2: /* LbxEmbeddedAppGroup */ + changes = (CARD32*) &rep[1]; + changes_len = rep->length - 1; + if (client->swapped) + SwapLongs(changes, changes_len); + + if (rep->tag != 0) { + td = TagGetTag(client->server, client->server->global_cache, + rep->tag); + if (!td) { + fprintf(stderr, "no data for setup tag 0x%lx\n", + (long)rep->tag); + send_setup_reply(client, FALSE, 0, 0, "bad tag data from server", 0); + if (client->swapped) + DEALLOCATE_LOCAL(data); + return; + } +#ifdef LBX_STATS + getsetup_tag++; + tag_bytes_unsent += td->size - len; +#endif + tag_data = td->tdata; + len = td->size; + } else { + DisplayGetConnSetup (client->server->dpy, &tag_data, &len, + rep->changeType, changes, changes_len); + free_td = TRUE; + } + break; + + } + finish_setup_reply(client, tag_data, len, + rep->changeType, changes, changes_len, + (int) rep->majorVersion, (int) rep->minorVersion); + if (free_td) xfree (tag_data); + if (client->swapped) + DEALLOCATE_LOCAL(data); +} + +int +ProcLBXInternAtom(client) + ClientPtr client; +{ + REQUEST(xInternAtomReq); + char *s; + Atom atom, + a = None; + xInternAtomReply reply; + ReplyStuffPtr nr; + char n; + CARD16 nbytes; + + nbytes = stuff->nbytes; + if (client->swapped) { + swaps(&nbytes, n); + } + if (nbytes > MAX_ATOM_LENGTH) + return ProcStandardRequest(client); + + s = (char *)stuff + sizeof(xInternAtomReq); + + atom = LbxMakeAtom(client->server, s, nbytes, a, FALSE); + if (atom != None) { + reply.type = X_Reply; + reply.length = 0; + reply.sequenceNumber = LBXSequenceNumber(client); + reply.atom = atom; + if (client->swapped) + SwapInternAtomReply(&reply); + if (LBXCacheSafe(client)) { + FinishLBXRequest(client, REQ_YANK); + WriteToClient(client, sizeof(xInternAtomReply), &reply); + } else { /* store for later */ + if (!LBXCanDelayReply(client)) + SendLbxSync(client); + FinishLBXRequest(client, REQ_YANKLATE); + SaveReplyData(client, (xReply *) & reply, 0, NULL); + } + +#ifdef LBX_STATS + intern_good++; +#endif + + return Success; + } else if (nbytes < MAX_ATOM_LENGTH) { + nr = NewReply(client, X_InternAtom, 0, intern_atom_reply); + if (!nr) + return ProcStandardRequest(client); + strncpy(nr->request_info.xintern.str, s, nbytes); + nr->request_info.xintern.str[nbytes] = '\0'; + nr->request_info.xintern.len = nbytes; + +#ifdef LBX_STATS + intern_miss++; +#endif + + return ProcStandardRequest(client); + } + + return 0; /* ?!?!? */ +} + +static Bool +intern_atom_reply(client, nr, data) + ClientPtr client; + ReplyStuffPtr nr; + char *data; +{ + Atom atom; + char *str; + xInternAtomReply *reply; + int len; + char n; + + reply = (xInternAtomReply *) data; + + str = nr->request_info.xintern.str; + len = nr->request_info.xintern.len; + + atom = reply->atom; + if (client->swapped) { + swapl(&atom, n); + } + if (atom != None) + /* make sure it gets stuffed in the DB */ + (void) LbxMakeAtom(client->server, str, len, atom, TRUE); + return TRUE; +} + +int +ProcLBXGetAtomName(client) + ClientPtr client; +{ + REQUEST(xResourceReq); + char *str; + xGetAtomNameReply reply; + int len; + ReplyStuffPtr nr; + char n; + Atom id; + + id = stuff->id; + if (client->swapped) { + swapl(&id, n); + } + str = NameForAtom(client->server, id); + + if (str) { /* found the value */ + len = strlen(str); + reply.type = X_Reply; + reply.length = (len + 3) >> 2; + reply.sequenceNumber = LBXSequenceNumber(client); + reply.nameLength = len; + if (client->swapped) + SwapGetAtomNameReply(&reply); + if (LBXCacheSafe(client)) { + FinishLBXRequest(client, REQ_YANK); + WriteToClient(client, sizeof(xGetAtomNameReply), &reply); + WriteToClient(client, len, str); + } else { + if (!LBXCanDelayReply(client)) + SendLbxSync(client); + FinishLBXRequest(client, REQ_YANKLATE); + SaveReplyData(client, (xReply *) & reply, len, str); + } + +#ifdef LBX_STATS + getatom_good++; +#endif + + return Success; + } else { + nr = NewReply(client, X_GetAtomName, 0, get_atom_name_reply); + if (!nr) + return ProcStandardRequest(client); + nr->request_info.xgetatom.atom = id; + +#ifdef LBX_STATS + getatom_miss++; +#endif + + return ProcStandardRequest(client); + } +} + +static Bool +get_atom_name_reply(client, nr, data) + ClientPtr client; + ReplyStuffPtr nr; + char *data; +{ + Atom atom; + char *s; + xGetAtomNameReply *reply; + CARD16 len; + char n; + + reply = (xGetAtomNameReply *) data; + + len = reply->nameLength; + + if (client->swapped) { + swaps(&len, n); + } + + if (len > MAX_ATOM_LENGTH) + return FALSE; + + s = data + sizeof(xGetAtomNameReply); + + atom = nr->request_info.xgetatom.atom; + /* make sure it gets stuffed in the DB */ + if (atom) + (void) LbxMakeAtom(client->server, s, (unsigned) len, atom, TRUE); + return TRUE; +} + +/* + * Send an LbxSync request to the server. After the SyncReply comes + * back, the proxy will flush any replies it saved for the client. + */ + +void +SendLbxSync (client) + ClientPtr client; +{ + xLbxSyncReq req; + ReplyStuffPtr nr; + +#ifdef SEQ_DEBUG + fprintf(stderr, "sending LbxSync, seq 0x%x\n", LBXSequenceNumber(client) - 1); +#endif + + ForceSequenceUpdate(client); + nr = NewReply(client, client->server->lbxReq, X_LbxSync, sync_reply); + --nr->sequenceNumber; /* executed BEFORE the real request */ + req.reqType = client->server->lbxReq; + req.lbxReqType = X_LbxSync; + req.length = sz_xLbxSyncReq >> 2; + + WriteReqToServer (client, sz_xLbxSyncReq, (char *) &req, TRUE); +} + +/* ARGSUSED */ +static Bool +sync_reply(client, nr, data) + ClientPtr client; + ReplyStuffPtr nr; + char *data; +{ + /* do nothing; just here to catch and discard the reply */ + return TRUE; +} + +void +WriteError(client, majorCode, minorCode, resId, errorCode) + ClientPtr client; + unsigned int majorCode; + unsigned int minorCode; + XID resId; + int errorCode; +{ + xError rep; + int n; + + rep.type = X_Error; + rep.sequenceNumber = LBXSequenceNumber(client); + rep.errorCode = errorCode; + rep.majorCode = majorCode; + rep.minorCode = minorCode; + rep.resourceID = resId; + + if (client->swapped) { + swaps(&rep.sequenceNumber, n); + swaps(&rep.minorCode, n); + swaps(&rep.resourceID, n); + } + + WriteToClient(client, sizeof(rep), (char *)&rep); +} + +int +ProcLBXGetModifierMapping(client) + ClientPtr client; +{ + ReplyStuffPtr nr; + + nr = NewReply(client, client->server->lbxReq, X_LbxGetModifierMapping, + get_mod_map_reply); + if (!nr) + return ProcStandardRequest(client); + + FinishLBXRequest(client, REQ_PASSTHROUGH); + SendGetModifierMapping(client); + return Success; +} + +/*ARGSUSED*/ +static Bool +get_mod_map_reply(client, nr, data) + ClientPtr client; + ReplyStuffPtr nr; + char *data; +{ + xLbxGetModifierMappingReply *rep; + int len; + pointer tag_data; + CARD32 tag; + char n; + xGetModifierMappingReply reply; + + rep = (xLbxGetModifierMappingReply *) data; + + tag = rep->tag; + if (client->swapped) { + swapl(&tag, n); + } + len = rep->keyspermod << 3; + if (rep->tag) { + if (rep->length) { /* first time, set tag */ + +#ifdef LBX_STATS + getmodmap_full++; +#endif + + tag_data = (pointer) &rep[1]; + if (!TagStoreData(client->server, client->server->global_cache, + tag, len, + LbxTagTypeModmap, tag_data)) { + /* tell server we lost it */ + SendInvalidateTag(client, tag); + } + } else { + tag_data = TagGetData(client->server, client->server->global_cache, + tag); + if (!tag_data) { + fprintf(stderr, "no data for mod map tag 0x%lx\n", (long)tag); + WriteError(client, X_GetModifierMapping, 0, 0, BadAlloc); + return TRUE; + } + +#ifdef LBX_STATS + getmodmap_tag++; + tag_bytes_unsent += (rep->keyspermod << 3); +#endif + } + } else { + +#ifdef LBX_STATS + getmodmap_full++; +#endif + + /* server didn't send us a tag for some reason -- just pass on data */ + tag_data = (pointer) &rep[1]; + } + + reply.type = X_Reply; + reply.numKeyPerModifier = rep->keyspermod; + reply.sequenceNumber = rep->sequenceNumber; + reply.length = len >> 2; + if (client->swapped) + SwapModmapReply(&reply); + WriteToClient(client, sizeof(xGetModifierMappingReply), &reply); + WriteToClient(client, len, tag_data); + + return TRUE; +} + +int +ProcLBXGetKeyboardMapping(client) + ClientPtr client; +{ + REQUEST(xGetKeyboardMappingReq); + ReplyStuffPtr nr; + + nr = NewReply(client, client->server->lbxReq, X_LbxGetKeyboardMapping, + get_key_map_reply); + if (!nr) + return ProcStandardRequest(client); + nr->request_info.lbxgetkeymap.count = stuff->count; + nr->request_info.lbxgetkeymap.first = stuff->firstKeyCode; + + + FinishLBXRequest(client, REQ_PASSTHROUGH); + SendGetKeyboardMapping(client); + return Success; +} + +/* + * always ask for the whole map from server, and send requested subset to + * client + */ + +static Bool +get_key_map_reply(client, nr, data) + ClientPtr client; + ReplyStuffPtr nr; + char *data; +{ + xLbxGetKeyboardMappingReply *rep; + int len; + pointer tag_data; + CARD32 tag; + char n; + xGetKeyboardMappingReply reply; + char *sdata; + + rep = (xLbxGetKeyboardMappingReply *) data; + + tag = rep->tag; + if (client->swapped) { + swapl(&tag, n); + } + if (tag) { + if (rep->length) { /* first time, set tag */ + +#ifdef LBX_STATS + getkeymap_full++; +#endif + + tag_data = (pointer) &rep[1]; + len = rep->keysperkeycode * + (LBXMaxKeyCode(client) - LBXMinKeyCode(client) + 1) * 4; + /* data always swapped, because reswapped when written */ + if (client->swapped) + SwapLongs((CARD32 *) tag_data, len / 4); + if (!TagStoreData(client->server, client->server->global_cache, + tag, len, + LbxTagTypeKeymap, tag_data)) { + /* tell server we lost it */ + SendInvalidateTag(client, tag); + } + } else { + tag_data = TagGetData(client->server, + client->server->global_cache, tag); + if (!tag_data) { + fprintf(stderr, "no data for key map tag 0x%lx\n", (long)tag); + WriteError(client, X_GetKeyboardMapping, 0, 0, BadAlloc); + return TRUE; + } + +#ifdef LBX_STATS + getkeymap_tag++; + tag_bytes_unsent += (rep->keysperkeycode * + (LBXMaxKeyCode(client) - LBXMinKeyCode(client) + 1) * 4); +#endif + } + } else { + +#ifdef LBX_STATS + getkeymap_full++; +#endif + + /* server didn't send us a tag for some reason -- just pass on data */ + tag_data = (pointer) &rep[1]; + /* data always swapped, because reswapped when written */ + if (client->swapped) { + len = rep->keysperkeycode * + (LBXMaxKeyCode(client) - LBXMinKeyCode(client) + 1) * 4; + SwapLongs((CARD32 *) tag_data, len / 4); + } + } + + len = (rep->keysperkeycode * nr->request_info.lbxgetkeymap.count) << 2; + + reply.type = X_Reply; + reply.keySymsPerKeyCode = rep->keysperkeycode; + reply.sequenceNumber = rep->sequenceNumber; + reply.length = len >> 2; + + tag_data = (char *)tag_data + (rep->keysperkeycode * + (nr->request_info.lbxgetkeymap.first - + LBXMinKeyCode(client))); + if (client->swapped) { + SwapKeymapReply(&reply); + /* have to copy data because we could be handed the tag storage */ + sdata = (char *) ALLOCATE_LOCAL(len); + if (sdata) { + memcpy(sdata, tag_data, len); + SwapLongs((CARD32 *) sdata, len / 4); + } + } else + sdata = tag_data; + WriteToClient(client, sizeof(xGetKeyboardMappingReply), &reply); + WriteToClient(client, len, sdata); + if (sdata != tag_data) + DEALLOCATE_LOCAL(sdata); + + return TRUE; +} + +int +ProcLBXQueryFont(client) + ClientPtr client; +{ + REQUEST(xResourceReq); + ReplyStuffPtr nr; + Font fid; + char n; + + fid = stuff->id; + if (client->swapped) { + swapl(&fid, n); + } + nr = NewReply(client, client->server->lbxReq, X_LbxQueryFont, + get_queryfont_reply); + if (!nr) + return ProcStandardRequest(client); + + FinishLBXRequest(client, REQ_PASSTHROUGH); + SendQueryFont(client, fid); + return Success; +} + +static INT16 +unpack_val(val, mask, sft, bts) + CARD32 val; + CARD32 mask; + int sft, + bts; +{ + CARD16 utmp; + INT16 sval; + + /* get the proper value */ + utmp = (val & mask) >> sft; + /* push the sign bit to the right spot */ + utmp <<= (16 - bts); + /* cast it so sign bit takes effect */ + sval = (INT16) utmp; + /* shift back down */ + sval >>= (16 - bts); + + return sval; +} + +/*ARGSUSED*/ +static int +UnsquishFontInfo(int compression, xLbxFontInfo *fdata, int dlen, pointer *qfr) +{ + int len, + hlen, + junklen = sizeof(BYTE) * 2 + sizeof(CARD16) + sizeof(CARD32); + char *t; + int nchars; + int i; + xCharInfo *maxb; + xQueryFontReply *new; + xLbxCharInfo *lci; + xCharInfo *ci; + CARD16 attrs; + + maxb = &fdata->maxBounds; + + nchars = fdata->nCharInfos; + hlen = sizeof(xQueryFontReply) + fdata->nFontProps * sizeof(xFontProp); + len = hlen + nchars * sizeof(xCharInfo); + + new = (xQueryFontReply *) xalloc(len); + *qfr = (pointer) new; + + if (!new) /* XXX bad stuff... */ + return 0; + + /* copy the header & props parts */ + t = (char *) new; + t += junklen; + if (compression) { + memcpy((char *) t, (char *) fdata, hlen - junklen); + } else { + memcpy((char *) t, (char *) fdata, len - junklen); + return len; + } + + attrs = maxb->attributes; + + t = (char *) fdata; + t += hlen - junklen; + lci = (xLbxCharInfo *) t; + + t = (char *) new; + t += hlen; + ci = (xCharInfo *) t; + + /* now expand the chars */ + for (i = 0; i < nchars; i++, lci++, ci++) { + if (lci->metrics == 0) { + /* empty char */ + ci->characterWidth = ci->leftSideBearing = ci->rightSideBearing = + ci->ascent = ci->descent = ci->attributes = 0; + } else { + ci->characterWidth = + unpack_val(lci->metrics, LBX_WIDTH_MASK, + LBX_WIDTH_SHIFT, LBX_WIDTH_BITS); + ci->leftSideBearing = unpack_val(lci->metrics, LBX_LEFT_MASK, + LBX_LEFT_SHIFT, LBX_LEFT_BITS); + ci->rightSideBearing = unpack_val(lci->metrics, LBX_RIGHT_MASK, + LBX_RIGHT_SHIFT, LBX_RIGHT_BITS); + ci->ascent = unpack_val(lci->metrics, LBX_ASCENT_MASK, + LBX_ASCENT_SHIFT, LBX_ASCENT_BITS); + ci->descent = unpack_val(lci->metrics, LBX_DESCENT_MASK, + LBX_DESCENT_SHIFT, LBX_DESCENT_BITS); + ci->attributes = attrs; + } + } + + return len; +} + +/*ARGSUSED*/ +static Bool +get_queryfont_reply(client, nr, data) + ClientPtr client; + ReplyStuffPtr nr; + char *data; +{ + xLbxQueryFontReply *rep; + int len, + sqlen; + pointer tag_data, + sqtag_data; + TagData td; + CARD32 tag; + char n; + xQueryFontReply *reply; + + rep = (xLbxQueryFontReply *) data; + + tag = rep->tag; + if (client->swapped) { + swapl(&tag, n); + } + if (tag) { + if (rep->length) { /* first time, set tag */ + +#ifdef LBX_STATS + queryfont_full++; +#endif + + sqtag_data = (pointer) &rep[1]; + sqlen = rep->length << 2; + if (client->swapped) + LbxSwapFontInfo(sqtag_data, rep->compression); + + /* + * store squished version of data + */ + if (!TagStoreData(client->server, client->server->global_cache, + tag, sqlen, + LbxTagTypeFont, sqtag_data)) { + /* tell server we lost it */ + SendInvalidateTag(client, tag); + } + len = UnsquishFontInfo(rep->compression, sqtag_data, sqlen, + &tag_data); + } else { + td = TagGetTag(client->server, client->server->global_cache, tag); + if (!td) { + fprintf(stderr, "no data for font tag 0x%lx\n", (long)tag); + WriteError(client, X_QueryFont, 0, 0, BadAlloc); + return TRUE; + } + sqlen = td->size; + sqtag_data = td->tdata; + len = UnsquishFontInfo(rep->compression, sqtag_data, sqlen, + &tag_data); + +#ifdef LBX_STATS + queryfont_tag++; + tag_bytes_unsent += len; +#endif + } + } else { + +#ifdef LBX_STATS + queryfont_full++; +#endif + + /* server didn't send us a tag for some reason -- just pass on data */ + sqtag_data = (pointer) &rep[1]; + if (client->swapped) + LbxSwapFontInfo(sqtag_data, FALSE); + sqlen = rep->length << 2; + len = UnsquishFontInfo(rep->compression, sqtag_data, sqlen, &tag_data); + } + + reply = (xQueryFontReply *) ALLOCATE_LOCAL(len); + if (reply) { + memcpy((char *) reply, (char *) tag_data, len); + /* patch up certain fields */ + reply->type = X_Reply; + reply->sequenceNumber = rep->sequenceNumber; + reply->length = (len - sizeof(xGenericReply)) >> 2; + + len -= sizeof(xQueryFontReply); + if (client->swapped) + SwapFont(reply, TRUE); + WriteToClient(client, sizeof(xQueryFontReply), reply); + WriteToClient(client, len, reply + 1); + DEALLOCATE_LOCAL(reply); + } + + xfree(tag_data); /* free unsquished version */ + + return TRUE; +} + + +int +ProcLBXGetWindowAttributes(client) + ClientPtr client; +{ + REQUEST(xResourceReq); + xLbxGetWinAttrAndGeomReq newreq; + XServerPtr server = client->server; + ReplyStuffPtr nr; + + /* + * GetWindowAttributes is always followed by GetGeometry. + * At this point, if lbxproxy requests the window attributes + * *AND* the geometry in one request, we are guaranteed to be + * able to short circuit the GetGeometry that follows. + */ + + nr = NewReply(client, client->server->lbxReq, X_LbxGetWinAttrAndGeom, + GetWinAttrAndGeomReply); + + if (!nr) + return ProcStandardRequest(client); + + /* + * R6 Xlib will not wait for the GetWindowAttributes reply before + * sending the GetGeometry. As a result, when lbxproxy gets the + * GetGeometry we must defer short circuting until lbxproxy receives + * the LbxGetWinAttrAndGeomReply. + */ + + nr->request_info.lbxWinGeom.got_geom_request = FALSE; + nr->request_info.lbxWinGeom.got_geom_reply = FALSE; + + + FinishLBXRequest(client, REQ_PASSTHROUGH); + + newreq.reqType = server->lbxReq; + newreq.lbxReqType = X_LbxGetWinAttrAndGeom; + newreq.length = sz_xLbxGetWinAttrAndGeomReq >> 2; + newreq.id = stuff->id; + + WriteReqToServer (client, sz_xLbxGetWinAttrAndGeomReq, (char *) &newreq, TRUE); + return Success; +} + + +static Bool +GetWinAttrAndGeomReply (client, nr, data) + ClientPtr client; + ReplyStuffPtr nr; + char *data; +{ + xLbxGetWinAttrAndGeomReply *lbxrep; + xGetWindowAttributesReply reply; + char n; + + /* + * We got the window attributes and geometry. Write the + * WindowAttributes reply now. + */ + + lbxrep = (xLbxGetWinAttrAndGeomReply *) data; + + reply.type = X_Reply; + reply.sequenceNumber = lbxrep->sequenceNumber; + reply.length = (sizeof(xGetWindowAttributesReply) - + sizeof(xGenericReply)) >> 2; + reply.backingStore = lbxrep->backingStore; + reply.visualID = lbxrep->visualID; +#if defined(__cplusplus) || defined(c_plusplus) + reply.c_class = lbxrep->c_class; +#else + reply.class = lbxrep->class; +#endif + reply.bitGravity = lbxrep->bitGravity; + reply.winGravity = lbxrep->winGravity; + reply.backingBitPlanes = lbxrep->backingBitPlanes; + reply.backingPixel = lbxrep->backingPixel; + reply.saveUnder = lbxrep->saveUnder; + reply.mapInstalled = lbxrep->mapInstalled; + reply.mapState = lbxrep->mapState; + reply.override = lbxrep->override; + reply.colormap = lbxrep->colormap; + reply.allEventMasks = lbxrep->allEventMasks; + reply.yourEventMask = lbxrep->yourEventMask; + reply.doNotPropagateMask = lbxrep->doNotPropagateMask; + + if (client->swapped) { + swaps (&reply.sequenceNumber, n); + swapl (&reply.length, n); + } + + WriteToClient(client, sizeof(xGetWindowAttributesReply), &reply); + + if (nr->request_info.lbxWinGeom.got_geom_request) + { + /* + * We can write the GetGeometry reply now too. + */ + + xGetGeometryReply geomReply; + + geomReply.type = X_Reply; + geomReply.sequenceNumber = lbxrep->sequenceNumber + 1; + geomReply.length = 0; + geomReply.depth = lbxrep->depth; + geomReply.root = lbxrep->root; + geomReply.x = lbxrep->x; + geomReply.y = lbxrep->y; + geomReply.width = lbxrep->width; + geomReply.height = lbxrep->height; + geomReply.borderWidth = lbxrep->borderWidth; + + if (client->swapped) { + swaps (&geomReply.sequenceNumber, n); + } + + WriteToClient(client, sizeof(xGetGeometryReply), &geomReply); + + LBXLastResponse(client) = lbxrep->sequenceNumber + 1; + + return TRUE; /* remove matching reply record */ + } + else + { + /* + * We didn't get the GetGeometry request yet, so we + * stash away the geometry. + */ + + nr->request_info.lbxWinGeom.got_geom_reply = TRUE; + nr->request_info.lbxWinGeom.depth = lbxrep->depth; + nr->request_info.lbxWinGeom.root = lbxrep->root; + nr->request_info.lbxWinGeom.x = lbxrep->x; + nr->request_info.lbxWinGeom.y = lbxrep->y; + nr->request_info.lbxWinGeom.width = lbxrep->width; + nr->request_info.lbxWinGeom.height = lbxrep->height; + nr->request_info.lbxWinGeom.borderWidth = lbxrep->borderWidth; + + return FALSE; /* don't remove matching reply record */ + } +} + + +int +ProcLBXGetGeometry(client) + ClientPtr client; +{ + /* REQUEST(xResourceReq); */ + xGetGeometryReply reply; + ReplyStuffPtr nr; + char n; + + /* + * If the previous request was GetWindowAttributes, then lbxproxy + * requested the window attributes *AND* the geometry in one request. + * That means we can short circuit this GetGeometry! + */ + + nr = GetMatchingReply (client, LBXSequenceNumber(client) - 1, FALSE); + + if (!nr || nr->major != client->server->lbxReq || + nr->minor != X_LbxGetWinAttrAndGeom) + { + /* + * This GetGeometry was not preceded by a GetWindowAttributes, + * so we can't short circuit. Send the normal GetGeometry request. + */ + + return ProcStandardRequest(client); + } + + if (nr->request_info.lbxWinGeom.got_geom_reply) + { + /* + * We already have the geom information, so we + * can write the reply now. + */ + + reply.type = X_Reply; + reply.sequenceNumber = LBXSequenceNumber(client); + reply.length = 0; + reply.depth = nr->request_info.lbxWinGeom.depth; + reply.root = nr->request_info.lbxWinGeom.root; + reply.x = nr->request_info.lbxWinGeom.x; + reply.y = nr->request_info.lbxWinGeom.y; + reply.width = nr->request_info.lbxWinGeom.width; + reply.height = nr->request_info.lbxWinGeom.height; + reply.borderWidth = nr->request_info.lbxWinGeom.borderWidth; + + if (client->swapped) { + swaps (&reply.sequenceNumber, n); + } + + FinishLBXRequest(client, REQ_YANK); + WriteToClient(client, sizeof(xGetGeometryReply), &reply); + RemoveReply (client, nr); + } + else + { + /* + * We must wait for the geom information before + * writing the GetGeometry reply. + */ + + nr->request_info.lbxWinGeom.got_geom_request = TRUE; + + FinishLBXRequest(client, REQ_YANKLATE); + } + return Success; +} + +/* We're just looking for signs of the window manager here */ +int +ProcLBXChangeWindowAttributes(client) + ClientPtr client; +{ + REQUEST(xChangeWindowAttributesReq); + Window win; + CARD32 mask; + char n; + + win = stuff->window; + mask = stuff->valueMask; + if (client->swapped) { + swapl(&win, n); + swapl(&mask, n); + } + if (mask == CWEventMask && win == LBXRootWindow(client)) { + mask = *(CARD32 *)&stuff[1]; + if (client->swapped) { + swapl(&mask, n); + } + if (mask & SubstructureRedirectMask) + client->server->wm_running = TRUE; + } + return ProcStandardRequest(client); +} + +void +FinishLBXRequest(client, yank) + ClientPtr client; + int yank; +{ + REQUEST(xReq); + char n; + + if (yank != REQ_PASSTHROUGH) { + LBXLastForReply(client) = LBXSequenceNumber(client); + LBXLastForResponse(client) = LBXSequenceNumber(client); + if (yank == REQ_YANK || yank == REQ_REPLACE) + LBXLastResponse(client) = LBXSequenceNumber(client); + } else { + switch (GeneratesReplies(client, stuff)) { + case REQ_TYPE_YES: + LBXLastForReply(client) = LBXSequenceNumber(client); + LBXLastForResponse(client) = LBXSequenceNumber(client); + break; + case REQ_TYPE_MAYBE: + LBXLastForResponse(client) = LBXSequenceNumber(client); + break; + case REQ_TYPE_NO: + if (protocolMode != PROTOCOL_POOR && + GeneratesEvents(client, stuff)) + LBXLastForResponse(client) = LBXSequenceNumber(client); + break; + } + } + switch (protocolMode) { + case PROTOCOL_FULL: + LBXCacheSafe(client) = (LBXSequenceNumber(client) == + LBXLastResponse(client)); + LBXCanDelayReply(client) = (LBXSequenceNumber(client) == + LBXLastForReply(client)); + break; + default: + LBXCacheSafe(client) = (LBXLastForResponse(client) <= + LBXLastResponse(client)); + LBXCanDelayReply(client) = (LBXLastForResponse(client) <= + LBXLastForReply(client)); + break; + } +#ifdef SEQ_DEBUG + fprintf(stderr, + "finished req %d, seq 0x%x, yank %d cache %d delay %d reply 0x%x response 0x%x\n", + stuff->reqType, LBXSequenceNumber(client), yank, + LBXCacheSafe(client), LBXCanDelayReply(client), + LBXLastForReply(client), LBXLastForResponse(client)); +#endif + + if (yank == REQ_YANK || yank == REQ_YANKLATE) { + LBXSequenceLost(client)++; + LBXYanked(client)++; + DBG(DBG_CLIENT, (stderr, "short-circuited client %d req %d\n", + client->index, stuff->reqType)); + } + /* make sure server's sequence number is accurate */ + if (yank != REQ_YANK && yank != REQ_YANKLATE && LBXSequenceLost(client)) + BumpSequence(client); + + /* put request length in proxy byte order */ + if (client->swapped) { + swaps(&stuff->length, n); + } +} + +/* + * need to rewrite error codes for requests we've replaced. + * + * QueryFont regularly hits this in normal operation + */ +static int +patchup_error(client, err, nr) + ClientPtr client; + xError *err; + ReplyStuffPtr nr; +{ + int retval = 1; + CARD16 minor_code; + char n; + + minor_code = err->minorCode; + if (client->swapped) { + swaps(&minor_code, n); + } + switch (minor_code) { + case X_LbxGetModifierMapping: + minor_code = X_GetModifierMapping; + break; + case X_LbxGetKeyboardMapping: + minor_code = X_GetKeyboardMapping; + break; + case X_LbxGetProperty: + minor_code = X_GetProperty; + break; + case X_LbxQueryFont: + minor_code = X_QueryFont; + break; + case X_LbxGetWinAttrAndGeom: + minor_code = X_GetWindowAttributes; + if (nr->request_info.lbxWinGeom.got_geom_request) { + err->majorCode = minor_code; + err->minorCode = 0; + if (client->swapped) { + swaps(&err->sequenceNumber, n); + } + WriteToClient (client, sizeof(xError), (char *)err); + if (client->swapped) { + swaps(&err->sequenceNumber, n); + } + err->sequenceNumber++; + LBXLastResponse(client) = err->sequenceNumber; + minor_code = X_GetGeometry; + } + break; + default: + retval = 0; /* error caused by some LBX req that shouldn't + * have an error, so eat it */ + break; + } + err->majorCode = minor_code; /* err->majorCode is CARD8, don't swap */ + err->minorCode = 0; + return retval; +} + +static Bool +error_matches(client, nr, err) + ClientPtr client; + ReplyStuffPtr nr; + xError *err; +{ + CARD16 mc; + char n; + + mc = err->minorCode; + if (client->swapped) { + swaps(&mc, n); + } + return (err->majorCode == nr->major && mc == nr->minor); +} + +/* + * returns TRUE if data (possibly modified) is to be sent on to client, + * FALSE if data is replaced + */ +static Bool +HandleReply(client, data, len) + ClientPtr client; + char *data; + int len; +{ + xGenericReply *reply; + xError *err; + ReplyStuffPtr nr; + Bool ret = TRUE; + char n; + + reply = (xGenericReply *) data; + + if (client->awaitingSetup) { + xConnSetupPrefix *prefix = (xConnSetupPrefix *) reply; + + AttendClient(client); + if (prefix->success) { + get_setup_reply(client, (char *) reply, len); + return FALSE; + } + return TRUE; + } + if (client->swapped && reply->type != KeymapNotify) { + swaps(&reply->sequenceNumber, n); + } + + if (reply->type != KeymapNotify && + reply->sequenceNumber < LBXLastResponse(client)) { + /* spontaneous events, and events in PROTOCOL_POOR mode, + * may have sequence numbers that are earlier + * than short-circuited replies and errors */ + if (reply->type > X_Reply) + reply->sequenceNumber = LBXLastResponse(client); + } + + if (reply->type != KeymapNotify && + reply->sequenceNumber > LBXSequenceNumber(client)) + { +#ifdef SEQ_DEBUG + fprintf(stderr, "lbxproxy: reply seq #0x%x > internal seq 0x%x\n", + reply->sequenceNumber, LBXSequenceNumber(client)); +#endif + reply->sequenceNumber = LBXSequenceNumber(client); + } + + if (reply->type != X_Reply) { /* event or error */ + /* clear out pending replies that resulted in errors */ + if (reply->type == X_Error) { + LBXLastResponse(client) = reply->sequenceNumber; + err = (xError *) reply; + nr = GetMatchingReply(client, reply->sequenceNumber, TRUE); + if (nr && error_matches(client, nr, err)) { + if (err->majorCode == client->server->lbxReq) { + int eret; + + if ((eret = patchup_error(client, err, nr)) < 0) { + CloseDownClient(client); + return FALSE; + } else if (eret == 0) { + /* error for proxy -- eat it */ + ret = FALSE; + } + } else { + /* error in core X or other extension */ + HandleExtensionError(client, err, nr); + } + } + if (nr) + RemoveReply(client, nr); + } else if (reply->type >= 64) + HandleExtensionEvent(client, (xEvent *)reply); + if (client->swapped && reply->type != KeymapNotify) { + swaps(&reply->sequenceNumber, n); + } + return ret; + } + + LBXLastResponse(client) = reply->sequenceNumber; + + nr = GetMatchingReply(client, reply->sequenceNumber, TRUE); + if (nr) { + if (nr->major == client->server->lbxReq) + ret = FALSE; + if ((*nr->reply_func)(client, nr, (char *)reply)) + RemoveReply(client, nr); + } + + if (client->swapped) { /* put seq & length back */ + swaps(&reply->sequenceNumber, n); + swapl(&reply->length, n); + } + return ret; +} + +void +DoLBXReply(client, data, len) + ClientPtr client; + char *data; + int len; +{ + if (HandleReply(client, data, len)) + WriteToClient (client, len, data); + + FlushDelayedReplies (client); + + switch (protocolMode) { + case PROTOCOL_FULL: + LBXCacheSafe(client) = (LBXSequenceNumber(client) == + LBXLastResponse(client)); + break; + default: + LBXCacheSafe(client) = (LBXLastForResponse(client) <= + LBXLastResponse(client)); + break; + } +#ifdef SEQ_DEBUG + fprintf(stderr, "finished reply 0x%x, cache %d\n", + ((xGenericReply *)data)->sequenceNumber, LBXCacheSafe(client)); +#endif +} diff --git a/app/lbxproxy/di/lbxutil.c b/app/lbxproxy/di/lbxutil.c new file mode 100644 index 000000000..a24ac2792 --- /dev/null +++ b/app/lbxproxy/di/lbxutil.c @@ -0,0 +1,509 @@ +/* $Xorg: lbxutil.c,v 1.4 2000/08/17 19:53:55 cpqbld Exp $ */ +/* + * Copyright 1994 Network Computing Devices, Inc. + * + * Permission to use, copy, modify, distribute, and sell this software and + * its documentation for any purpose is hereby granted without fee, provided + * that the above copyright notice appear in all copies and that both that + * copyright notice and this permission notice appear in supporting + * documentation, and that the name Network Computing Devices, Inc. not be + * used in advertising or publicity pertaining to distribution of this + * software without specific, written prior permission. + * + * THIS SOFTWARE IS PROVIDED `AS-IS'. NETWORK COMPUTING DEVICES, INC., + * DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING WITHOUT + * LIMITATION ALL IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A + * PARTICULAR PURPOSE, OR NONINFRINGEMENT. IN NO EVENT SHALL NETWORK + * COMPUTING DEVICES, INC., BE LIABLE FOR ANY DAMAGES WHATSOEVER, INCLUDING + * SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES, INCLUDING LOSS OF USE, DATA, + * OR PROFITS, EVEN IF ADVISED OF THE POSSIBILITY THEREOF, AND REGARDLESS OF + * WHETHER IN AN ACTION IN CONTRACT, TORT OR NEGLIGENCE, ARISING OUT OF OR IN + * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + * + */ +/* $XFree86$ */ + +/* + * utility routines for LBX requests + */ + + +#include +#include "misc.h" +#include "assert.h" +#include "lbx.h" +#include "util.h" +#include "tags.h" +#include "resource.h" +#include "wire.h" +#include "swap.h" +#include "colormap.h" + +Bool compStats = FALSE; /* report stream compression statistics */ + +#ifdef DEBUG +extern int lbxDebug; +#endif + +extern int lbxMaxMotionEvents; + +ReplyStuffPtr +NewReply(client, major, minor, reply_func) + ClientPtr client; + int major; + int minor; + ReplyFunc reply_func; +{ + ReplyStuffPtr new, + *end; + + new = (ReplyStuffPtr) xalloc(sizeof(ReplyStuffRec)); + if (!new) + return new; + new->sequenceNumber = LBXSequenceNumber(client); + new->major = major; + new->minor = minor; + new->reply_func = reply_func; + new->next = NULL; + end = &LBXReplyList(client); + while (*end) + end = &(*end)->next; + *end = new; + return new; +} + +void +RemoveReply(client, rp) + ClientPtr client; + ReplyStuffPtr rp; +{ + ReplyStuffPtr cur, *prev; + + prev = &LBXReplyList(client); + + while ((cur = *prev) != rp) + prev = &cur->next; + *prev = cur->next; + if (cur->major == client->server->lbxReq) { + if (CacheTrimNeeded(client->server, client->server->global_cache) && + !AnyTagBearingReplies(client->server, client->server->global_cache)) + CacheTrim(client->server, client->server->global_cache); + if (CacheTrimNeeded(client->server, client->server->prop_cache) && + !AnyTagBearingReplies(client->server, client->server->prop_cache)) + CacheTrim(client->server, client->server->prop_cache); + } + xfree(cur); +} + +ReplyStuffPtr +GetMatchingReply(client, seqno, flush_older) + ClientPtr client; + int seqno; + Bool flush_older; +{ + ReplyStuffPtr t, old; + + seqno &= 0xffff; + for (t = LBXReplyList(client); t; t = t->next) { + if ((t->sequenceNumber & 0xffff) == seqno) + break; + } +#ifdef SEQ_DEBUG + if (t) + fprintf(stderr, "matched reply for seq 0x%x\n", seqno); + else + fprintf(stderr, "no reply for seq 0x%x\n", seqno); +#endif + if (t && flush_older) { + while ((old = LBXReplyList(client)) != t) { + fprintf(stderr, + "unclaimed reply: maj %d min %d seq 0x%x curseq 0x%x\n", + old->major, old->minor, old->sequenceNumber, seqno); + LBXReplyList(client) = old->next; + xfree(old); + } + } + return t; +} + +Bool +AnyReplies(client) + ClientPtr client; +{ + return (LBXReplyList(client) != NULL); +} + +Bool +AnyTagBearingReplies(server, cache) + XServerPtr server; + Cache cache; +{ + int i; + int lbxreq; + ReplyStuffPtr t; + Bool found = FALSE; + + /* assume this is called while a reply is being processed, so need two */ + for (i = 1; i < currentMaxClients; i++) + { + if (!clients[i]) + continue; + lbxreq = clients[i]->server->lbxReq; + for (t = LBXReplyList(clients[i]); t; t = t->next) { + if (t->major == lbxreq) { + switch (t->minor) { + case X_LbxGetModifierMapping: + case X_LbxGetKeyboardMapping: + case X_LbxQueryFont: + if (cache == server->global_cache) { + if (found) + return TRUE; + found = TRUE; + } + break; + case X_LbxGetProperty: + if (cache == server->prop_cache) { + if (found) + return TRUE; + found = TRUE; + } + break; + } + } + } + } + return FALSE; +} + +/* + * this is used for stashing short-circuited replies for later. + * it currently assumes that all of them will be 32 bytes for the reply + * plus some amount of extra data + */ + +Bool +SaveReplyData(client, rep, len, data) + ClientPtr client; + xReply *rep; + int len; + pointer data; +{ + ReplyDataPtr new, *end; + + new = (ReplyDataPtr) xalloc(sizeof(ReplyDataRec)); + if (!new) + return FALSE; + if (len) { + new->data = (pointer) xalloc(len); + if (!new->data) { + xfree(new); + return FALSE; + } else { + memcpy((char *) new->data, (char *) data, len); + } + } + new->reply = *rep; + new->dlen = len; + new->delay_seq_no = LBXSequenceNumber(client); + new->next = NULL; + + end = &LBXReplyData(client); + while (*end) + end = &(*end)->next; + *end = new; +#ifdef SEQ_DEBUG + fprintf(stderr, "saving reply seq 0x%x\n", LBXSequenceNumber(client)); +#endif + return TRUE; +} + +Bool +FlushDelayedReplies(client) + ClientPtr client; +{ + ReplyDataPtr *prev, cur; + +#ifdef SEQ_DEBUG + fprintf(stderr, "flushing replies seq 0x%x:", LBXLastResponse(client)); +#endif + for (prev = &LBXReplyData(client); (cur = *prev); ) { +#ifdef SEQ_DEBUG + fprintf(stderr, " 0x%x", cur->delay_seq_no); +#endif + if ((cur->delay_seq_no & 0xffff) == LBXLastResponse(client) + 1) { + WriteToClient(client, sizeof(xReply), (char *) &cur->reply); + if (cur->dlen) + WriteToClient(client, cur->dlen, (char *) cur->data); + LBXLastResponse(client) = cur->delay_seq_no; + *prev = cur->next; + xfree(cur); + } + else + prev = &cur->next; + } +#ifdef SEQ_DEBUG + fprintf(stderr, "\n"); +#endif + return TRUE; +} + +void +BumpSequence(client) + ClientPtr client; +{ + DBG(DBG_CLIENT, (stderr, "bumping client %d sequence by %d to %d\n", + client->index, LBXSequenceLost(client), LBXSequenceNumber(client))); + ModifySequence(client, LBXSequenceLost(client)); + LBXSequenceLost(client) = 0; +} + +void +ForceSequenceUpdate(client) + ClientPtr client; +{ + if (LBXSequenceLost(client)) { + BumpSequence(client); + } +} + +void +LbxFreeTag(server, tag, tagtype) + XServerPtr server; + XID tag; + int tagtype; + +{ + Cache tag_cache; + + switch (tagtype) { + case LbxTagTypeProperty: + tag_cache = server->prop_cache; + break; + case LbxTagTypeFont: + case LbxTagTypeModmap: + case LbxTagTypeKeymap: + case LbxTagTypeConnInfo: + tag_cache = server->global_cache; + break; + default: + fprintf(stderr, + "unknown type in InvalidateTag request: tag 0x%lx type %d\n", + (long)tag, tagtype); + return; + } + TagFreeData(server, tag_cache, tag, TRUE); +} + +void +LbxSendTagData(client, tag, tagtype) + ClientPtr client; + XID tag; + int tagtype; +{ + TagData td; + unsigned long len; + pointer tdata; + PropertyTagDataPtr ptdp; + + if (tagtype == LbxTagTypeProperty && (td = TagGetTag(client->server, + client->server->prop_cache, tag))) { + ptdp = (PropertyTagDataPtr) td->tdata; + tdata = ptdp->data; + len = ptdp->length; + } else { + fprintf(stderr, "invalid SendTagData request: tag 0x%lx type %d\n", + (long)tag, tagtype); + len = 0; + tdata = NULL; + } + SendTagData(client, tag, len, tdata); +} + +extern unsigned long stream_out_compressed; +extern unsigned long stream_out_uncompressed; +extern unsigned long stream_out_plain; +extern unsigned long stream_in_compressed; +extern unsigned long stream_in_uncompressed; +extern unsigned long stream_in_plain; +extern unsigned long raw_stream_out; +extern unsigned long raw_stream_in; + +void +DumpCompressionStats() +{ + if (raw_stream_out && stream_out_plain) { + fprintf(stderr, "Requests: normal = %ld, reencoded = %ld", + (long)raw_stream_out, (long)stream_out_plain); + stream_out_compressed += stream_out_uncompressed; + if (stream_out_compressed) + fprintf(stderr, ", compressed = %ld", (long)stream_out_compressed); + else + stream_out_compressed = stream_out_plain; + fprintf(stderr, "\n %.2f:1 overall reduction ratio\n", + (float)raw_stream_out / (float)stream_out_compressed); + } + if (raw_stream_in && stream_in_plain) { + fprintf(stderr, "Responses: normal = %ld, reencoded = %ld", + (long)raw_stream_in, (long)stream_in_plain); + stream_in_compressed += stream_in_uncompressed; + if (stream_in_compressed) + fprintf(stderr, ", compressed = %ld", (long)stream_in_compressed); + else + stream_in_compressed = stream_in_plain; + fprintf(stderr, "\n %.2f:1 overall reduction ratio\n", + (float)raw_stream_in / (float)stream_in_compressed); + } +} + +void +ZeroCompressionStats() +{ + stream_out_compressed = 0; + stream_out_uncompressed = 0; + stream_out_plain = 0; + stream_in_compressed = 0; + stream_in_uncompressed = 0; + stream_in_plain = 0; + raw_stream_out = 0; + raw_stream_in = 0; +} + + + +#ifdef LBX_STATS +int intern_good, + intern_miss; +int getatom_good, + getatom_miss; +int luc_good, + luc_miss; +int ac_good, + ac_miss; +int anc_good, + anc_miss; + +int getmodmap_tag, /* tag only */ + getmodmap_full; +int getkeymap_tag, /* tag only */ + getkeymap_full; +int queryfont_tag, /* tag only */ + queryfont_full; +int getsetup_tag, /* tag only */ + getsetup_full; + +int getprop_tag, + getprop_full; + + +int tag_bytes_unsent; /* approx data kept off wire by tags */ + +int delta_out_total; +int delta_out_attempts; +int delta_out_hits; +int delta_in_total; +int delta_in_attempts; +int delta_in_hits; + +extern int gfx_gc_hit; +extern int gfx_gc_miss; +extern int gfx_draw_hit; +extern int gfx_draw_miss; +extern int gfx_total; + +void +DumpOtherStats() +{ + fprintf(stderr, "Short-circuit stats\n"); + fprintf(stderr, "InternAtom cache hits %d misses %d\n", intern_good, intern_miss); + fprintf(stderr, "GetAtomName cache hits %d misses %d\n", getatom_good, getatom_miss); + fprintf(stderr, "LookupColor cache hits %d misses %d\n", luc_good, luc_miss); + fprintf(stderr, "AllocColor cache hits %d misses %d\n", ac_good, ac_miss); + fprintf(stderr, "AllocNamedColor cache hits %d misses %d\n", anc_good, anc_miss); + + fprintf(stderr, "Tag stats\n"); + fprintf(stderr, "GetModifierMapping used tag %d, full data %d\n", getmodmap_tag, getmodmap_full); + fprintf(stderr, "GetKeyboardMapping used tag %d, full data %d\n", getkeymap_tag, getkeymap_full); + fprintf(stderr, "QueryFont used tag %d, full data %d\n", queryfont_tag, queryfont_full); + fprintf(stderr, "GetProperty used tag %d, full data %d\n", getprop_tag, getprop_full); + fprintf(stderr, "ConnectionSetup used tag %d, full data %d\n", getsetup_tag, getsetup_full); + + fprintf(stderr, "Approx bytes kept off wire by tags %d\n", tag_bytes_unsent); + + fprintf(stderr, "Delta Compressor stats\n"); + fprintf(stderr, "Sent: total msgs = %d, cacheable = %d, cache hits = %d\n", + delta_out_total, delta_out_attempts, delta_out_hits); + fprintf(stderr, "Received: total = %d, cacheable = %d, cache hits = %d\n", + delta_in_total, delta_in_attempts, delta_in_hits); + + fprintf(stderr, "GFX Cache stats\n"); + fprintf(stderr, "Reencoded = %d\n", gfx_total); +#define percent(s,t) ((t) ? ((s) * 100) / (t) : 0) + +#define ratios(h,m) (h), percent (h, (h)+(m)), (m), percent (m, (h) + (m)) + fprintf(stderr, "Draw hit = %d (%d%%) miss = %d (%d%%) GC hit = %d (%d%%) miss = %d (%d%%)\n", + ratios (gfx_draw_hit, gfx_draw_miss), + ratios (gfx_gc_hit, gfx_gc_miss)); +#define savings(h,m) (((h) + (m)) * 4) - ((h) + (m) * 5) + fprintf(stderr, "Total bytes saved = %d Draw = %d GC = %d\n", + savings (gfx_gc_hit + gfx_draw_hit, gfx_gc_miss + gfx_draw_miss), + savings (gfx_draw_hit, gfx_draw_miss), + savings (gfx_gc_hit, gfx_gc_miss)); +} + +void +ZeroOtherStats() +{ + intern_good = intern_miss = 0; + getatom_good = getatom_miss = 0; + luc_good = luc_miss = 0; + ac_good = ac_miss = 0; + anc_good = anc_miss = 0; + + getmodmap_tag = 0; + getmodmap_full = 0; + getkeymap_tag = 0; + getkeymap_full = 0; + getprop_tag = 0; + getprop_full = 0; + getsetup_tag = 0; + getsetup_full = 0; + + delta_out_total = delta_out_attempts = delta_out_hits = 0; + delta_in_total = delta_in_attempts = delta_in_hits = 0; + + gfx_gc_hit = 0; + gfx_gc_miss = 0; + gfx_draw_hit = 0; + gfx_draw_miss = 0; + gfx_total = 0; +} + +#endif + +void +SendInitLBXPackets(server) + XServerPtr server; +{ + + ZeroCompressionStats(); +#ifdef LBX_STATS + ZeroOtherStats(); +#endif + + AllowMotion(server->serverClient, lbxMaxMotionEvents); +} + +void +LbxCleanupSession() +{ + if (compStats) + { + DumpCompressionStats(); + ZeroCompressionStats(); + } + +#ifdef LBX_STATS + DumpOtherStats(); + ZeroOtherStats(); +#endif +} diff --git a/app/lbxproxy/di/main.c b/app/lbxproxy/di/main.c new file mode 100644 index 000000000..060f1885e --- /dev/null +++ b/app/lbxproxy/di/main.c @@ -0,0 +1,186 @@ +/* $Xorg: main.c,v 1.5 2001/02/09 02:05:31 xorgcvs Exp $ */ +/* + +Copyright 1998 The Open Group + +Permission to use, copy, modify, distribute, and sell this software and its +documentation for any purpose is hereby granted without fee, provided that +the above copyright notice appear in all copies and that both that +copyright notice and this permission notice appear in supporting +documentation. + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the name of The Open Group shall not be +used in advertising or otherwise to promote the sale, use or other dealings +in this Software without prior written authorization from The Open Group. + +*/ +/* + * Copyright 1992 Network Computing Devices + * + * Permission to use, copy, modify, distribute, and sell this software and its + * documentation for any purpose is hereby granted without fee, provided that + * the above copyright notice appear in all copies and that both that + * copyright notice and this permission notice appear in supporting + * documentation, and that the name of NCD. not be used in advertising or + * publicity pertaining to distribution of the software without specific, + * written prior permission. NCD. makes no representations about the + * suitability of this software for any purpose. It is provided "as is" + * without express or implied warranty. + * + * NCD. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL NCD. + * BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION + * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN + * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + * + */ +/* $XFree86: xc/programs/lbxproxy/di/main.c,v 1.8 2001/01/21 21:19:39 tsi Exp $ */ + +#include +#include "lbx.h" +#include "wire.h" +#include "atomcache.h" +#include "colormap.h" +#include "tags.h" +#include "lbxext.h" +#include "os.h" +#include "resource.h" +#include "pm.h" +#include "misc.h" + +int LbxWhoAmI = 0; /* + * for lbx zlib library to know who we are + * server = 1 + * proxy = 0 + */ + +#define DEFAULT_MAXSERVERS 20 + +XServerPtr *servers; + +char *display; + +int lbxMaxServers = DEFAULT_MAXSERVERS; + +static void InitializeGlobals (); + +int +main (argc, argv) + int argc; + char **argv; +{ + display = "63"; + + ProcessCommandLine (argc, argv); + + InitConnectionLimits(); + + AdjustProcVector(); + + InitializeGlobals (); + + proxyMngr = CheckForProxyManager (); + CreateWellKnownSockets (); + if (proxyMngr) + { + ConnectToProxyManager (); + ListenToProxyManager (); + } + + while (1) + { + OsInit (); + InitColors (); + InitDeleteFuncs(); + + if (!proxyMngr && !ConnectToServer (display_name)) + { + /* + * If no display name was given on the command line, the + * DISPLAY variable is used. + */ + if(!display_name) + display_name = getenv("DISPLAY"); + + if(display_name) { + FatalError("could not connect to display '%s'", display_name); + } else { + FatalError("no display specified"); + } + } + + if (!InitClientResources(clients[0])) + FatalError("couldn't init server resources"); + FinishInitClientResources(clients[0], 0, 0x3ffff); + + if (Dispatch () != 0) + break; + + FreeAllResources(); + FreeAtoms(); + FreeColors(); + FreeTags(); + } + CloseServerSockets(); + exit (0); +} + +/* + * Initalize those global variables that are needed to connect + * to a display server. + */ +static void +InitializeGlobals () +{ + int i; + ClientPtr tmp; + + clients = (ClientPtr *)xalloc(MAXCLIENTS * sizeof(ClientPtr)); + if (!clients) + FatalError("couldn't create client array"); + for (i=1; i < MAXCLIENTS; i++) + clients[i] = NullClient; + + servers = (XServerPtr *)xalloc(lbxMaxServers * sizeof (XServerPtr)); + if (!servers) + FatalError("couldn't create servers array"); + for (i=0; i < lbxMaxServers; i++) + servers[i] = (XServerPtr) NULL; + + tmp = (ClientPtr)xcalloc(sizeof(ClientRec)); + if (!tmp) + FatalError("couldn't create server client"); + + tmp->sequence = 0; + tmp->closeDownMode = RetainPermanent; + tmp->clientGone = FALSE; + tmp->server = servers[0]; + tmp->index = 0; + tmp->noClientException = Success; + tmp->awaitingSetup = FALSE; + tmp->swapped = FALSE; + tmp->big_requests = FALSE; + + clients[0] = tmp; + + currentMaxClients = 1; +} + + +/* ARGSUSED */ +void +MarkClientException (client) + ClientPtr client; +{ +} diff --git a/app/lbxproxy/di/options.c b/app/lbxproxy/di/options.c new file mode 100644 index 000000000..11e1f67c8 --- /dev/null +++ b/app/lbxproxy/di/options.c @@ -0,0 +1,807 @@ +/* $XdotOrg: options.c,v 1.4 2001/02/09 02:05:31 xorgcvs Exp $ */ +/* $Xorg: options.c,v 1.4 2001/02/09 02:05:31 xorgcvs Exp $ */ +/* + +Copyright 1998 The Open Group + +Permission to use, copy, modify, distribute, and sell this software and its +documentation for any purpose is hereby granted without fee, provided that +the above copyright notice appear in all copies and that both that +copyright notice and this permission notice appear in supporting +documentation. + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the name of The Open Group shall not be +used in advertising or otherwise to promote the sale, use or other dealings +in this Software without prior written authorization from The Open Group. + +*/ +/* + * Copyright 1994 Network Computing Devices, Inc. + * + * Permission to use, copy, modify, distribute, and sell this software and + * its documentation for any purpose is hereby granted without fee, provided + * that the above copyright notice appear in all copies and that both that + * copyright notice and this permission notice appear in supporting + * documentation, and that the name Network Computing Devices, Inc. not be + * used in advertising or publicity pertaining to distribution of this + * software without specific, written prior permission. + * + * THIS SOFTWARE IS PROVIDED `AS-IS'. NETWORK COMPUTING DEVICES, INC., + * DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING WITHOUT + * LIMITATION ALL IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A + * PARTICULAR PURPOSE, OR NONINFRINGEMENT. IN NO EVENT SHALL NETWORK + * COMPUTING DEVICES, INC., BE LIABLE FOR ANY DAMAGES WHATSOEVER, INCLUDING + * SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES, INCLUDING LOSS OF USE, DATA, + * OR PROFITS, EVEN IF ADVISED OF THE POSSIBILITY THEREOF, AND REGARDLESS OF + * WHETHER IN AN ACTION IN CONTRACT, TORT OR NEGLIGENCE, ARISING OUT OF OR IN + * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + * + */ +/* $XFree86: xc/programs/lbxproxy/di/options.c,v 1.8 2003/09/13 21:33:10 dawes Exp $ */ + +#include +#include +#include "misc.h" +#include +#include +#include "proxyopts.h" +#include +#include "util.h" +#include "colormap.h" +#ifndef NO_ZLIB +#include +#endif /* NO_ZLIB */ +#include "wire.h" + +static int LbxDeltaReply(); +static int LbxProxyDeltaReq(); +static int LbxServerDeltaReq(); +static int LbxStreamCompReq(); +static int LbxBitmapCompReq(); +static int LbxPixmapCompReq(); +static int LbxSquishReq(); +static int LbxUseTagsReq(); +static int LbxCmapAllReq(); + +static int LbxProxyDeltaReply(); +static int LbxServerDeltaReply(); +static int LbxStreamCompReply(); +static int LbxBitmapCompReply(); +static int LbxPixmapCompReply(); +static int LbxSquishReply(); +static int LbxUseTagsReply(); +static int LbxCmapAllReply(); + +static int OptZlibReq(); +static int OptZlibReply(); + +#define OPT_INDEX_STREAM_COMP 2 + +/* + * Local variables that get set when the command line options + * are parsed. + */ +static Bool called_LbxNoComp; +static Bool called_LbxNoDelta; + + +static void +InitializeOptionsList (server, idx, optcode, negotiate, req, reply) + XServerPtr server; + int idx; + CARD8 optcode; + Bool negotiate; + int (*req)(); + int (*reply)(); +{ + server->LbxOptions[idx].optcode = optcode; + server->LbxOptions[idx].negotiate = negotiate; + server->LbxOptions[idx].req = req; + server->LbxOptions[idx].reply = reply; +} + +static void +InitializeDeltaOptions (server) + XServerPtr server; +{ + server->proxyDeltaOpt.minN = 0; + server->proxyDeltaOpt.maxN = 0xff; + server->proxyDeltaOpt.prefN = LBX_OPT_DELTA_NCACHE_DFLT; + server->proxyDeltaOpt.minMaxMsgLen = LBX_OPT_DELTA_MSGLEN_MIN >> 2; + server->proxyDeltaOpt.maxMaxMsgLen = 0xff; + server->proxyDeltaOpt.prefMaxMsgLen = LBX_OPT_DELTA_MSGLEN_DFLT >> 2; + + server->serverDeltaOpt.minN = 0; + server->serverDeltaOpt.maxN = 0xff; + server->serverDeltaOpt.prefN = LBX_OPT_DELTA_NCACHE_DFLT; + server->serverDeltaOpt.minMaxMsgLen = LBX_OPT_DELTA_MSGLEN_MIN >> 2; + server->serverDeltaOpt.maxMaxMsgLen = 0xff; + server->serverDeltaOpt.prefMaxMsgLen = LBX_OPT_DELTA_MSGLEN_DFLT >> 2; +} + +static void +InitializeStreamComp (server) + XServerPtr server; +{ + server->LbxStreamComp[0].typelen = ZLIB_STRCOMP_OPT_LEN; + server->LbxStreamComp[0].type = ZLIB_STRCOMP_OPT; + server->LbxStreamComp[0].req = OptZlibReq; + server->LbxStreamComp[0].reply = OptZlibReply; +} + +static void +InitializeBitmapCompMethod (server) + XServerPtr server; +{ + /* compression method name */ + server->LbxBitmapCompMethods[0].methodName = "XC-FaxG42D"; + + /* inited */ + server->LbxBitmapCompMethods[0].inited = 0; + + /* method opcode - to be filled on reply */ + server->LbxBitmapCompMethods[0].methodOpCode= -1; + + /* init function */ + server->LbxBitmapCompMethods[0].compInit = NULL; + + /* encode function */ + server->LbxBitmapCompMethods[0].compFunc = LbxImageEncodeFaxG42D; + + /* decode function */ + server->LbxBitmapCompMethods[0].decompFunc = LbxImageDecodeFaxG42D; +} + +/*ARGSUSED*/ +static void +InitializePixmapCompMethod (server) + XServerPtr server; +{ + /* + * Currently, we don't support any pixmap compression algorithms + * because regular stream compression does much better than PackBits. + * If we want to plug in a better pixmap image compression algorithm, + * it would go here. + */ + +#define NUM_PIXMAP_METHODS 0 + +} + +static void +InitializeCmpaAllMethods (server) + XServerPtr server; +{ + /* colormap allocation method name */ + server->LbxCmapAllMethods[0].methodName = "XC-CMAP"; + + /* rgb resolver */ + server->LbxCmapAllMethods[0].resolver = ResolveColor; + + /* allocator */ + server->LbxCmapAllMethods[0].findfree = FindFreePixel; + + /* matcher */ + server->LbxCmapAllMethods[0].findbest = FindBestPixel; +} + +void +LbxOptInit(server) + XServerPtr server; +{ + bzero((char *)&server->lbxNegOpt, sizeof(LbxNegOptsRec)); + + server->lbxNegOpt.proxyDeltaN = LBX_OPT_DELTA_NCACHE_DFLT; + server->lbxNegOpt.proxyDeltaMaxLen = LBX_OPT_DELTA_MSGLEN_DFLT; + server->lbxNegOpt.serverDeltaN = LBX_OPT_DELTA_NCACHE_DFLT; + server->lbxNegOpt.serverDeltaMaxLen = LBX_OPT_DELTA_MSGLEN_DFLT; + server->lbxNegOpt.numBitmapCompMethods = 0; + server->lbxNegOpt.bitmapCompMethods = NULL; + server->lbxNegOpt.numPixmapCompMethods = 0; + server->lbxNegOpt.pixmapCompMethods = NULL; + server->lbxNegOpt.squish = TRUE; + server->lbxNegOpt.useTags = TRUE; + + /* + * Fill in the server's LbxOptions array. + */ + InitializeOptionsList (server, 0, LBX_OPT_DELTA_PROXY, TRUE, + LbxProxyDeltaReq, LbxProxyDeltaReply); + InitializeOptionsList (server, 1, LBX_OPT_DELTA_SERVER, TRUE, + LbxServerDeltaReq, LbxServerDeltaReply); + InitializeOptionsList (server, 2, LBX_OPT_STREAM_COMP, TRUE, + LbxStreamCompReq, LbxStreamCompReply); + InitializeOptionsList (server, 3, LBX_OPT_BITMAP_COMP, TRUE, + LbxBitmapCompReq, LbxBitmapCompReply); + InitializeOptionsList (server, 4, LBX_OPT_PIXMAP_COMP, TRUE, + LbxPixmapCompReq, LbxPixmapCompReply); + InitializeOptionsList (server, 5, LBX_OPT_MSG_COMP, TRUE, + LbxSquishReq, LbxSquishReply); + InitializeOptionsList (server, 6, LBX_OPT_USE_TAGS, TRUE, + LbxUseTagsReq, LbxUseTagsReply); + InitializeOptionsList (server, 7, LBX_OPT_CMAP_ALL, TRUE, + LbxCmapAllReq, LbxCmapAllReply); + + InitializeDeltaOptions (server); + + InitializeStreamComp (server); + + InitializeBitmapCompMethod (server); + + InitializePixmapCompMethod (server); + + InitializeCmpaAllMethods (server); + + /* + * Now update this server's LbxOptions that were set when + * command line was parsed. + */ + if (called_LbxNoComp) + server->LbxOptions[OPT_INDEX_STREAM_COMP].negotiate = FALSE; + if (called_LbxNoDelta) { + server->proxyDeltaOpt.prefN = 0; + server->serverDeltaOpt.prefN = 0; + } +} + +int +LbxOptBuildReq(server, buf) + XServerPtr server; + register char *buf; +{ + int i; + char *bufstart = buf; + char *pnopts = buf++; + + server->optcount = 0; + + for (i = 0; i < (sizeof(server->LbxOptions) / sizeof (LbxOptionsListRec)); + i++) { + int reqlen; + + if (server->LbxOptions[i].negotiate) { + reqlen = (*server->LbxOptions[i].req) (server, + buf + LBX_OPT_SMALLHDR_LEN); + *buf++ = server->LbxOptions[i].optcode; + *buf++ = LBX_OPT_SMALLHDR_LEN + reqlen; + buf += reqlen; + server->optlist[server->optcount++] = i; + } + } + + *pnopts = server->optcount; + return (buf - bufstart); +} + +int +LbxOptParseReply(server, nopts, preply, replylen) + XServerPtr server; + int nopts; + unsigned char *preply; + int replylen; +{ + int i; + + for (i = 0; i < nopts; i++) { + int len; + int hdrlen; + int result; + int optindex = *preply; + + if (optindex >= server->optcount) + return -1; + LBX_OPT_DECODE_LEN(preply + 1, len, hdrlen); + if (len < ++hdrlen || len > replylen) { +#ifdef OPTDEBUG + fprintf(stderr, "bad length, len = %d, hdrlen = %d, optlen = %d\n", + len, hdrlen, replylen); +#endif + return -1; + } + + result = (*server->LbxOptions[server->optlist[optindex]].reply) (server, + preply + hdrlen, len - hdrlen); + if (result < 0) + return -1; + + preply += len; + replylen -= len; + } + return 0; +} + +void +LbxNoDelta() +{ + /* + * All we can do now is to flag that this was called + * since the associated server structure may not be + * initialized. + */ + called_LbxNoDelta = TRUE; +} + +static int +LbxProxyDeltaReq(server, buf) + XServerPtr server; + unsigned char *buf; +{ + memcpy(buf, (char *)&server->proxyDeltaOpt, sizeof(LbxDeltaOptionsRec)); + return LBX_OPT_DELTA_REQLEN; +} + +static int +LbxServerDeltaReq(server, buf) + XServerPtr server; + unsigned char *buf; +{ + memcpy(buf, (char *)&server->serverDeltaOpt, sizeof(LbxDeltaOptionsRec)); + return LBX_OPT_DELTA_REQLEN; +} + +static int +LbxProxyDeltaReply(server, preply, replylen) + XServerPtr server; + unsigned char *preply; + int replylen; +{ + return LbxDeltaReply(preply, + replylen, + &server->lbxNegOpt.proxyDeltaN, + &server->lbxNegOpt.proxyDeltaMaxLen); +} + +static int +LbxServerDeltaReply(server, preply, replylen) + XServerPtr server; + unsigned char *preply; + int replylen; +{ + return LbxDeltaReply(preply, + replylen, + &server->lbxNegOpt.serverDeltaN, + &server->lbxNegOpt.serverDeltaMaxLen); +} + +static int +LbxDeltaReply(preply, replylen, pn, pmaxlen) + unsigned char *preply; + int replylen; + short *pn; + short *pmaxlen; +{ + if (replylen < 2) + return -1; + *pn = *preply++; + *pmaxlen = *preply; + if ((*pmaxlen <<= 2) == 0) + *pn = 0; + else if (*pmaxlen < 32) { +#ifdef DEBUG + printf("bad delta max msg length %d\n", *pmaxlen); +#endif + return -1; + } + return 0; +} + + +void +LbxNoComp() +{ + /* + * All we can do now is to flag that this was called + * since the associated server structure may not be + * initialized. + */ + called_LbxNoComp = TRUE; +} + +static int +LbxStreamCompReq(server, buf) + XServerPtr server; + unsigned char *buf; +{ + int i; + int reqlen; + int LBX_N_STRCOMP; + + LBX_N_STRCOMP = sizeof (server->LbxStreamComp) / + sizeof (LbxStreamCompRec); + + *buf++ = LBX_N_STRCOMP; + reqlen = 1; + + for (i = 0; i < LBX_N_STRCOMP; i++) { + int optdatalen; + int typelen = server->LbxStreamComp[i].typelen; + + *buf++ = typelen; + memcpy(buf, server->LbxStreamComp[i].type, typelen); + buf += typelen; + reqlen += 1 + typelen; + + optdatalen = (*server->LbxStreamComp[i].req) (server, buf + 1); + *buf = optdatalen + 1; + buf += optdatalen + 1; + reqlen += optdatalen + 1; + } + + return reqlen; +} + +static int +LbxStreamCompReply(server, preply, replylen) + XServerPtr server; + unsigned char *preply; + int replylen; +{ + int optindex; + int LBX_N_STRCOMP; + + LBX_N_STRCOMP = sizeof(server->LbxStreamComp) / + sizeof (LbxStreamCompRec); + + if (replylen < 1 || (optindex = *preply) >= LBX_N_STRCOMP) + return -1; + return (*server->LbxStreamComp[optindex].reply) (server, + preply + 1, + replylen - 1); + +} + +extern int zlevel; + +/*ARGSUSED*/ +static int +OptZlibReq(server, buf) + XServerPtr server; + unsigned char *buf; +{ + *buf++ = 1; /* len */ + *buf = zlevel; + return (2); +} + +/*ARGSUSED*/ +static int +OptZlibReply(server, preply, replylen) + XServerPtr server; + unsigned char *preply; + int replylen; +{ + server->lbxNegOpt.streamOpts.streamCompInit = + (LbxStreamCompHandle (*)(int, pointer))ZlibInit; + server->lbxNegOpt.streamOpts.streamCompArg = (pointer)(long) zlevel; + server->lbxNegOpt.streamOpts.streamCompStuffInput = ZlibStuffInput; + server->lbxNegOpt.streamOpts.streamCompInputAvail = ZlibInputAvail; + server->lbxNegOpt.streamOpts.streamCompFlush = ZlibFlush; + server->lbxNegOpt.streamOpts.streamCompRead = ZlibRead; + server->lbxNegOpt.streamOpts.streamCompWriteV = ZlibWriteV; + server->lbxNegOpt.streamOpts.streamCompOn = ZlibCompressOn; + server->lbxNegOpt.streamOpts.streamCompOff = ZlibCompressOff; + server->lbxNegOpt.streamOpts.streamCompFreeHandle = + (void (*)(LbxStreamCompHandle))ZlibFree; + + return 0; +} + +Bool lbxDoSquishing = TRUE; + +/*ARGSUSED*/ +static int +LbxSquishReq(server, buf) + XServerPtr server; + unsigned char *buf; +{ + *buf = lbxDoSquishing; + return 1; +} + +static int +LbxSquishReply(server, preply, replylen) + XServerPtr server; + unsigned char *preply; + int replylen; +{ + if (replylen < 1) + return -1; + server->lbxNegOpt.squish = *preply; + return 0; +} + + +Bool lbxUseTags = TRUE; + +/*ARGSUSED*/ +static int +LbxUseTagsReq(server, buf) + XServerPtr server; + unsigned char *buf; +{ + *buf = lbxUseTags; + return 1; +} + + +static int +LbxUseTagsReply(server, preply, replylen) + XServerPtr server; + unsigned char *preply; + int replylen; +{ + if (replylen < 1) + return -1; + server->lbxNegOpt.useTags = *preply; + return 0; +} + + +/* + * Option negotiation for image compression + */ + +static int +LbxBitmapCompReq (server, buf) + XServerPtr server; + unsigned char *buf; +{ + unsigned char *bufStart = buf; + int i; + int NUM_BITMAP_METHODS; + + NUM_BITMAP_METHODS = sizeof(server->LbxBitmapCompMethods) / + sizeof (LbxBitmapCompMethod); + + *buf++ = NUM_BITMAP_METHODS; + + for (i = 0; i < NUM_BITMAP_METHODS; i++) + { + int len = strlen (server->LbxBitmapCompMethods[i].methodName); + *buf++ = len; + memcpy (buf, server->LbxBitmapCompMethods[i].methodName, len); + buf += len; + } + + return (buf - bufStart); +} + +/*ARGSUSED*/ +static int +LbxBitmapCompReply (server, preply, replylen) + XServerPtr server; + unsigned char *preply; + int replylen; +{ + int count = *preply++; + int i; + + server->lbxNegOpt.numBitmapCompMethods = count; + + if (count > 0) + { + server->lbxNegOpt.bitmapCompMethods = (char *) xalloc (count); + if (server->lbxNegOpt.bitmapCompMethods == NULL) + { + server->lbxNegOpt.numBitmapCompMethods = 0; + return -1; + } + } + + for (i = 0; i < count; i++) + { + int index = *preply++; + server->lbxNegOpt.bitmapCompMethods[i] = index; + server->LbxBitmapCompMethods[index].methodOpCode = *preply++; + } + + return 0; +} + + +static int +LbxPixmapCompReq (server, buf) + XServerPtr server; + unsigned char *buf; +{ + unsigned char *bufStart = buf; + int i, j; + + *buf++ = NUM_PIXMAP_METHODS; + + for (i = 0; i < NUM_PIXMAP_METHODS; i++) + { + int len = strlen (server->LbxPixmapCompMethods[i].methodName); + *buf++ = len; + memcpy (buf, server->LbxPixmapCompMethods[i].methodName, len); + buf += len; + *buf++ = server->LbxPixmapCompMethods[i].formatMask; + *buf++ = server->LbxPixmapCompMethods[i].depthCount; + for (j = 0; j < server->LbxPixmapCompMethods[i].depthCount; j++) + *buf++ = server->LbxPixmapCompMethods[i].depths[j]; + } + + return (buf - bufStart); +} + +/*ARGSUSED*/ +static int +LbxPixmapCompReply (server, preply, replylen) + XServerPtr server; + unsigned char *preply; + int replylen; +{ + int count = *preply++; + int i, j; + + server->lbxNegOpt.numPixmapCompMethods = count; + + if (count > 0) + { + server->lbxNegOpt.pixmapCompMethods = (char *) xalloc (count); + if (server->lbxNegOpt.pixmapCompMethods == NULL) + { + server->lbxNegOpt.numPixmapCompMethods = 0; + return -1; + } + } + + for (i = 0; i < count; i++) + { + int index = *preply++; + server->lbxNegOpt.pixmapCompMethods[i] = index; + server->LbxPixmapCompMethods[index].methodOpCode = *preply++; + server->LbxPixmapCompMethods[index].formatMask = *preply++; + server->LbxPixmapCompMethods[index].depthCount = *preply++; + for (j = 0; j < server->LbxPixmapCompMethods[index].depthCount; j++) + server->LbxPixmapCompMethods[index].depths[j] = *preply++; + } + + return 0; +} + + +LbxBitmapCompMethod * +LbxLookupBitmapCompMethod (server, methodOpCode) + XServerPtr server; + int methodOpCode; + +{ + int i; + + for (i = 0; i < server->lbxNegOpt.numBitmapCompMethods; i++) + { + LbxBitmapCompMethod *method; + + method = &server->LbxBitmapCompMethods[(int)(server->lbxNegOpt.bitmapCompMethods[i])]; + + if (method->methodOpCode == methodOpCode) + return (method); + } + + return (NULL); +} + + +LbxPixmapCompMethod * +LbxLookupPixmapCompMethod (server, methodOpCode) + XServerPtr server; + int methodOpCode; + +{ + int i; + + for (i = 0; i < server->lbxNegOpt.numPixmapCompMethods; i++) + { + LbxPixmapCompMethod *method; + + method = &server->LbxPixmapCompMethods[(int)(server->lbxNegOpt.pixmapCompMethods[i])]; + + if (method->methodOpCode == methodOpCode) + return (method); + } + + return (NULL); +} + + +LbxBitmapCompMethod * +LbxFindPreferredBitmapCompMethod (server) + XServerPtr server; + +{ + if (server->lbxNegOpt.numBitmapCompMethods == 0) + return NULL; + else + return (&server->LbxBitmapCompMethods[(int)(server->lbxNegOpt.bitmapCompMethods[0])]); +} + + +LbxPixmapCompMethod * +LbxFindPreferredPixmapCompMethod (server, format, depth) + XServerPtr server; + int format; + int depth; + +{ + if (server->lbxNegOpt.numPixmapCompMethods == 0) + return NULL; + else + { + LbxPixmapCompMethod *method; + int i, j; + + for (i = 0; i < server->lbxNegOpt.numPixmapCompMethods; i++) + { + method = &server->LbxPixmapCompMethods[(int)(server->lbxNegOpt.pixmapCompMethods[i])]; + + if ((method->formatMask & (1 << format))) + { + for (j = 0; j < method->depthCount; j++) + if (depth == method->depths[j]) + return method; + } + } + + return NULL; + } +} + +/* + * Colormap methods + */ +static int +LbxCmapAllReq (server, buf) + XServerPtr server; + unsigned char *buf; +{ + unsigned char *bufStart = buf; + int i; + int NUM_CMAP_METHODS; + + NUM_CMAP_METHODS = sizeof (server->LbxCmapAllMethods) / + sizeof (LbxCmapAllMethod); + + *buf++ = NUM_CMAP_METHODS; + + for (i = 0; i < NUM_CMAP_METHODS; i++) + { + int len = strlen (server->LbxCmapAllMethods[i].methodName); + *buf++ = len; + memcpy (buf, server->LbxCmapAllMethods[i].methodName, len); + buf += len; + } + + return (buf - bufStart); +} + +static int +LbxCmapAllReply(server, preply, replylen) + XServerPtr server; + unsigned char *preply; + int replylen; +{ + int NUM_CMAP_METHODS; + + NUM_CMAP_METHODS = sizeof (server->LbxCmapAllMethods) / + sizeof (LbxCmapAllMethod); + + if (replylen < 1) + return -1; + if (*preply < NUM_CMAP_METHODS) { + LbxResolveColor = server->LbxCmapAllMethods[*preply].resolver; + LbxFindFreePixel = server->LbxCmapAllMethods[*preply].findfree; + LbxFindBestPixel = server->LbxCmapAllMethods[*preply].findbest; + } + return 0; +} diff --git a/app/lbxproxy/di/pm.c b/app/lbxproxy/di/pm.c new file mode 100644 index 000000000..fbe474c49 --- /dev/null +++ b/app/lbxproxy/di/pm.c @@ -0,0 +1,612 @@ +/* $Xorg: pm.c,v 1.5 2001/02/09 02:05:31 xorgcvs Exp $ */ +/* +Copyright 1996, 1998 The Open Group + +Permission to use, copy, modify, distribute, and sell this software and its +documentation for any purpose is hereby granted without fee, provided that +the above copyright notice appear in all copies and that both that +copyright notice and this permission notice appear in supporting +documentation. + +The above copyright notice and this permission notice shall be included +in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR +OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the name of The Open Group shall +not be used in advertising or otherwise to promote the sale, use or +other dealings in this Software without prior written authorization +from The Open Group. +*/ +/* $XFree86: xc/programs/lbxproxy/di/pm.c,v 1.14 2003/09/13 21:33:10 dawes Exp $ */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +/* + * Because ICElib.h had a #define for Bool and because misc.h + * has a typedef for Bool, _BOOL_ALREADY_DEFINED_ is defined so + * that misc.h does not cause a conflict for Bool. + */ +#define _BOOL_ALREADY_DEFINED_ +#include "wire.h" +#include "pmP.h" +#include "pm.h" + +/* + * Local constants + */ +#define ERROR_STRING_SIZE 256 + +/* + * Static definitions + */ +static void PMprocessMessages (); +static Status _ConnectToProxyManager (); + +static int PMopcode; +static int PMversionCount = 1; +static IcePoVersionRec PMversions[] = + {{PM_MAJOR_VERSION, PM_MINOR_VERSION, PMprocessMessages}}; +static int gotFirstGetProxyAddr = 0; + +/* + * Public variables + */ +IceConn PM_iceConn; +int proxy_manager_fd = -1; +Bool proxyMngr; + +/* + * The following comment and ICE I/O error handler code were taken + * from the X Session Manager. What's good enough for the XSM + * is good enough for the LBX proxy ... + * + * The real way to handle IO errors is to check the return status + * of IceProcessMessages. xsm properly does this. + * + * Unfortunately, a design flaw exists in the ICE library in which + * a default IO error handler is invoked if no IO error handler is + * installed. This default handler exits. We must avoid this. + * + * To get around this problem, we install an IO error handler that + * does a little magic. Since a previous IO handler might have been + * installed, when we install our IO error handler, we do a little + * trick to get both the previous IO error handler and the default + * IO error handler. When our IO error handler is called, if the + * previous handler is not the default handler, we call it. This + * way, everyone's IO error handler gets called except the stupid + * default one which does an exit! + * + */ +static IceIOErrorHandler prev_handler; + +static void +MyIoErrorHandler (ice_conn) + IceConn ice_conn; +{ + if (prev_handler) + (*prev_handler) (ice_conn); + fprintf (stderr, "Received an ICE I/O error from the Proxy Manager\n"); + + proxy_manager_fd = -1; +} + +static void +InstallIOErrorHandler () +{ + IceIOErrorHandler default_handler; + + prev_handler = IceSetIOErrorHandler (NULL); + default_handler = IceSetIOErrorHandler (MyIoErrorHandler); + if (prev_handler == default_handler) + prev_handler = NULL; +} + + +Bool +CheckForProxyManager () +{ + if (getenv ("PROXY_MANAGER")) + return 1; + else + return 0; +} + +void +ConnectToProxyManager () +{ + char *proxyManagerAddr; + char errorString[ERROR_STRING_SIZE]; + + proxyManagerAddr = (char *) getenv ("PROXY_MANAGER"); + + if (proxyManagerAddr) + { + InstallIOErrorHandler (); + + if (!_ConnectToProxyManager (proxyManagerAddr, errorString)) + { + fprintf (stderr, "%s\n", errorString); + exit (1); + } + } +} + + +static Status +_ConnectToProxyManager (pmAddr, errorString) + char *pmAddr; + char *errorString; +{ + IceProtocolSetupStatus setupstat; + char *vendor = NULL; + char *release = NULL; + pmStartProxyMsg *pMsg; + char *pData; + int len; + int majorVersion, minorVersion; + char iceError[ERROR_STRING_SIZE]; + + /* + * Register support for PROXY_MANAGEMENT. + */ + if ((PMopcode = IceRegisterForProtocolSetup ( + PM_PROTOCOL_NAME, + "The Open Group, Inc.", "1.0", + PMversionCount, PMversions, + 0, /* authcount */ + NULL, /* authnames */ + NULL, /* authprocs */ + NULL /* IceIOErrorProc */ )) < 0) + { + strcpy (errorString, + "Could not register PROXY_MANAGEMENT protocol with ICE"); + return 0; + } + + + if ((PM_iceConn = IceOpenConnection ( + pmAddr, NULL, 0, 0, sizeof(iceError), iceError)) == NULL) + { + snprintf (errorString, ERROR_STRING_SIZE, + "Could not open ICE connection to proxy manager: %s", iceError); + return 0; + } + + setupstat = IceProtocolSetup (PM_iceConn, PMopcode, NULL, + False /* mustAuthenticate */, + &majorVersion, &minorVersion, + &vendor, &release, ERROR_STRING_SIZE, errorString); + + if (setupstat != IceProtocolSetupSuccess) + { + IceCloseConnection (PM_iceConn); + snprintf (errorString, ERROR_STRING_SIZE, + "Could not initialize proxy management protocol: %s", + iceError); + return 0; + } + + + /* + * Now send the StartProxy message. + */ + + len = STRING_BYTES ("LBX"); + + IceGetHeaderExtra (PM_iceConn, PMopcode, PM_StartProxy, + SIZEOF (pmStartProxyMsg), WORD64COUNT (len), + pmStartProxyMsg, pMsg, pData); + + STORE_STRING (pData, "LBX"); + + IceFlush (PM_iceConn); + + while (!gotFirstGetProxyAddr) + { + /* wait for a GetProxyAddr request before continuing... */ + int status = IceProcessMessages( PM_iceConn, NULL, NULL ); + if (status == IceProcessMessagesIOError) + { + fprintf( stderr, "IO error occured connecting to proxy manager"); + return FALSE; + } + } + + proxy_manager_fd = IceConnectionNumber (PM_iceConn); + + ListenToProxyManager(); + + return 1; +} + + +void +SendGetProxyAddrReply ( + IceConn requestor_iceConn, + int status, + char *addr, + char *error) + +{ + int len = STRING_BYTES (addr) + STRING_BYTES (error); + pmGetProxyAddrReplyMsg *pReply; + char *pData; + + IceGetHeaderExtra (requestor_iceConn, + PMopcode, PM_GetProxyAddrReply, + SIZEOF (pmGetProxyAddrReplyMsg), WORD64COUNT (len), + pmGetProxyAddrReplyMsg, pReply, pData); + + pReply->status = status; + + STORE_STRING (pData, addr); + STORE_STRING (pData, error); + + IceFlush (requestor_iceConn); +} + + +static int +casecmp (str1, str2) + char *str1, *str2; +{ + char buf1[512],buf2[512]; + char c, *s; + register int n; + + for (n=0, s = buf1; (c = *str1++); n++) { + if (isupper(c)) + c = tolower(c); + if (n>510) + break; + *s++ = c; + } + *s = '\0'; + for (n=0, s = buf2; (c = *str2++); n++) { + if (isupper(c)) + c = tolower(c); + if (n>510) + break; + *s++ = c; + } + *s = '\0'; + return (strcmp(buf1, buf2)); +} + + +/* ARGSUSED */ +static void +PMprocessMessages (iceConn, clientData, opcode, length, + swap, replyWait, replyReadyRet) + IceConn iceConn; + IcePointer clientData; + int opcode; + unsigned long length; + Bool swap; + IceReplyWaitInfo *replyWait; + Bool *replyReadyRet; +{ + switch (opcode) + { + case PM_GetProxyAddr: + { + pmGetProxyAddrMsg *pMsg; + char *pData, *pStart; + char *serviceName = NULL, *serverAddress = NULL; + char *hostAddress = NULL, *startOptions = NULL; + char *authName = NULL, *authData = NULL; + int authLen; + char * colon; + char * tmpAddress = NULL; + +#if 0 /* No-op */ + CHECK_AT_LEAST_SIZE (iceConn, PMopcode, opcode, + length, SIZEOF (pmGetProxyAddrMsg), IceFatalToProtocol); +#endif + + IceReadCompleteMessage (iceConn, SIZEOF (pmGetProxyAddrMsg), + pmGetProxyAddrMsg, pMsg, pStart); + + if (!IceValidIO (iceConn)) + { + IceDisposeCompleteMessage (iceConn, pStart); + return; + } + + authLen = swap ? lswaps (pMsg->authLen) : pMsg->authLen; + + pData = pStart; + + SKIP_STRING (pData, swap); /* proxy-service */ + SKIP_STRING (pData, swap); /* server-address */ + SKIP_STRING (pData, swap); /* host-address */ + SKIP_STRING (pData, swap); /* start-options */ + if (authLen > 0) + { + SKIP_STRING (pData, swap); /* auth-name */ + pData += (authLen + PAD64 (authLen)); /* auth-data */ + } + + CHECK_COMPLETE_SIZE (iceConn, PMopcode, opcode, + length, pData - pStart + SIZEOF (pmGetProxyAddrMsg), + pStart, IceFatalToProtocol); + + pData = pStart; + + EXTRACT_STRING (pData, swap, serviceName); + EXTRACT_STRING (pData, swap, serverAddress); + EXTRACT_STRING (pData, swap, hostAddress); + EXTRACT_STRING (pData, swap, startOptions); + if (authLen > 0) + { + EXTRACT_STRING (pData, swap, authName); + authData = (char *) malloc (authLen); + memcpy (authData, pData, authLen); + } + + /* + * Convert the display name (serverAddress) into a FQDN + * to consolidate servers. So that for example, requests + * for displays foo:0, foo.bar:0 and foo.bar.com:0 will + * be set to the same server. + * + * If gethostbyname fails, try to connect anyhow because + * the display name could be something like :0, local:0 + * or unix:0. + * + */ + + /* Search for last colon to allow IPv6 numeric addresses. */ + colon = strrchr (serverAddress, ':'); + + if (colon) + { +#if defined(IPv6) && defined(AF_INET6) + struct addrinfo *ai, hints; + Bool bracketed = False; + char canonaddr[INET6_ADDRSTRLEN]; + int addrtype = AF_UNSPEC; +#else + struct hostent *hostent; +#endif + const char *canonhost = NULL; + char *protocol = NULL; + char *hoststart = strchr(serverAddress, '/'); + + if (hoststart == NULL) { + hoststart = serverAddress; + } else { + protocol = serverAddress; + *(hoststart++) = '\0'; + } + + /* Clear extra colon from DECnet :: addresses, but not IPv6 + numeric addresses ending in ::, followed by :display */ + if (((colon > hoststart) && (*(colon - 1) == ':')) +#if defined(IPv6) && defined(AF_INET6) + /* Make sure there are only two colons unless the protocol is + specified as DECnet */ + && ( ((colon - 1) == hoststart) || (*(colon - 2) != ':') || + ( (protocol != NULL) && (strcmp(protocol, "dnet") == 0) ) ) +#endif + ) { + colon--; + } +#if defined(IPv6) && defined(AF_INET6) + /* hostname in IPv6 [numeric_addr]:0 form? */ + else if ( (hoststart[0] == '[') && + (hoststart < colon) && (*(colon-1) == ']') && + ( (protocol == NULL) || (strcmp(protocol, "tcp") == 0) + || (strcmp(protocol, "inet6") == 0) ) ) { + struct sockaddr_in6 sin6; + + *(colon - 1) = '\0'; + /* Verify address is valid IPv6 numeric form */ + if (inet_pton(AF_INET6, hoststart + 1, &sin6) == 1) { + /* It is. Use it as such. */ + hoststart++; + bracketed = True; + } else { + /* It's not, restore it just in case some other code + can use it. */ + *(colon - 1) = ']'; + } + } +#endif + + *colon = '\0'; + +#if defined(IPv6) && defined(AF_INET6) + (void)memset(&hints, 0, sizeof(hints)); + hints.ai_flags = AI_CANONNAME; + if (bracketed == True) { +#ifdef AI_NUMERICHOST + hints.ai_flags |= AI_NUMERICHOST; +#endif + addrtype = AF_INET6; + } else if (protocol != NULL) { + if (strcmp(protocol, "inet") == 0) { + addrtype = AF_INET; + } else if (strcmp(protocol, "inet6") == 0) { + addrtype = AF_INET6; + } + } + hints.ai_family = addrtype; + if (getaddrinfo(hoststart, NULL, &hints, &ai) == 0) { + canonhost = ai->ai_canonname; + } else { + /* Couldn't get name - check if in numeric form, and if so, + translate to canonical presentation form */ + struct sockaddr_storage sa; + + if ( ((addrtype = AF_UNSPEC) || (addrtype = AF_INET6)) && + (inet_pton(AF_INET6, hoststart, &sa) == 1) ) { + canonhost = inet_ntop(AF_INET6, &sa, + canonaddr, sizeof(canonaddr)); + } + else if ( ((addrtype = AF_UNSPEC) || (addrtype = AF_INET)) && + (inet_pton(AF_INET, hoststart, &sa) == 1) ) { + canonhost = inet_ntop(AF_INET, &sa, + canonaddr, sizeof(canonaddr)); + } + + ai = NULL; + } +#else + hostent = gethostbyname (hoststart); + if (hostent && hostent->h_name) + canonhost = hostent->h_name; +#endif + *colon = ':'; + +#if defined(IPv6) && defined(AF_INET6) + if (bracketed) { + *(colon - 1) = ']'; + } +#endif + + if (canonhost) { + const char *canonproto = ""; +#if defined(IPv6) && defined(AF_INET6) + if (ai && (ai->ai_family == AF_INET)) { + canonproto = "inet/"; + } else if (ai && (ai->ai_family == AF_INET6)) { + canonproto = "inet6/"; + } else +#endif + if (protocol != NULL) { + canonproto = protocol; + } + tmpAddress = malloc (strlen(canonproto) + strlen (canonhost) + + strlen (colon) + 1); + (void) sprintf (tmpAddress, "%s%s%s", canonproto, + canonhost, colon); + serverAddress = tmpAddress; + } + + if (protocol != NULL) { + *(protocol + strlen(protocol)) = '/'; + } +#if defined(IPv6) && defined(AF_INET6) + if (ai != NULL) + freeaddrinfo(ai); +#endif + } + display_name = serverAddress; + + if (casecmp (serviceName, "LBX") != 0) + { + SendGetProxyAddrReply (iceConn, PM_Unable, + NULL, "Incorrect proxy service, should be LBX"); + } + else + { + if (!gotFirstGetProxyAddr) + { + gotFirstGetProxyAddr = 1; + if (authLen > 0) + XSetAuthorization (authName, strlen (authName), + authData, authLen); + /* + * Connect to this server and send a GetProxyAddrReply msg. + */ + if (!ConnectToServer (display_name)) { + FatalError ("could not connect to '%s'", + display_name); + } + } + else + { + /* + * First check to see if a server for this serverAddress + * already exists. + */ + int i; + int found = 0; + + for (i=0; i < lbxMaxServers; i++) + { + if (servers[i] && servers[i]->display_name && + casecmp (serverAddress, servers[i]->display_name) == 0) + { + SendGetProxyAddrReply (iceConn, + PM_Success, + servers[i]->proxy_name, + NULL); + found = 1; + break; + } + } + if (!found) + { + /* + * Go ahead and try to connect to the new server. If + * there is an error, the connection code will send + * a GetProxyAddrReply message. + */ + if (authLen > 0) + XSetAuthorization (authName, strlen (authName), + authData, authLen); + + (void) ConnectToServer (display_name); + } + } + } + + IceDisposeCompleteMessage (iceConn, pStart); + + if (serviceName) + free (serviceName); + if (hostAddress) + free (hostAddress); + if (startOptions) + free (startOptions); + if (authName) + free (authName); + if (authData) + free (authData); + if (tmpAddress) + free (tmpAddress); + + break; + } + + default: + { + _IceErrorBadMinor (iceConn, PMopcode, opcode, IceCanContinue); + _IceReadSkip (iceConn, length << 3); + break; + } + } +} + +void +HandleProxyManagerConnection () +{ + /* + * If an IO error occurs, the IO error handler will output + * an error message. + */ + (void) IceProcessMessages (PM_iceConn, NULL, NULL); +} diff --git a/app/lbxproxy/di/props.c b/app/lbxproxy/di/props.c new file mode 100644 index 000000000..296cdd185 --- /dev/null +++ b/app/lbxproxy/di/props.c @@ -0,0 +1,429 @@ +/* $Xorg: props.c,v 1.4 2001/02/09 02:05:32 xorgcvs Exp $ */ +/* $XdotOrg: $ */ +/* + +Copyright 1998 The Open Group + +Permission to use, copy, modify, distribute, and sell this software and its +documentation for any purpose is hereby granted without fee, provided that +the above copyright notice appear in all copies and that both that +copyright notice and this permission notice appear in supporting +documentation. + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the name of The Open Group shall not be +used in advertising or otherwise to promote the sale, use or other dealings +in this Software without prior written authorization from The Open Group. + +*/ +/* + * Copyright 1994 Network Computing Devices, Inc. + * + * Permission to use, copy, modify, distribute, and sell this software and + * its documentation for any purpose is hereby granted without fee, provided + * that the above copyright notice appear in all copies and that both that + * copyright notice and this permission notice appear in supporting + * documentation, and that the name Network Computing Devices, Inc. not be + * used in advertising or publicity pertaining to distribution of this + * software without specific, written prior permission. + * + * THIS SOFTWARE IS PROVIDED `AS-IS'. NETWORK COMPUTING DEVICES, INC., + * DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING WITHOUT + * LIMITATION ALL IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A + * PARTICULAR PURPOSE, OR NONINFRINGEMENT. IN NO EVENT SHALL NETWORK + * COMPUTING DEVICES, INC., BE LIABLE FOR ANY DAMAGES WHATSOEVER, INCLUDING + * SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES, INCLUDING LOSS OF USE, DATA, + * OR PROFITS, EVEN IF ADVISED OF THE POSSIBILITY THEREOF, AND REGARDLESS OF + * WHETHER IN AN ACTION IN CONTRACT, TORT OR NEGLIGENCE, ARISING OUT OF OR IN + * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + * + */ +/* $XFree86: xc/programs/lbxproxy/di/props.c,v 1.6tsi Exp $ */ + +/* + * property handling + */ + + +#include +#include "misc.h" +#include "assert.h" +#include "lbx.h" +#include "util.h" +#include "tags.h" +#include "resource.h" +#include "wire.h" +#include "swap.h" +#include "proxyopts.h" +#include "atomcache.h" + +static Bool GetLbxChangePropertyReply(); +static Bool GetLbxGetPropertyReply(); + +/* + * wrapper for tags + * + * since this stuff has pointers, have to package it for + * tag cache + */ +static Bool +propTagStoreData(server, tid, dlen, swapit, ptdp) + XServerPtr server; + XID tid; + unsigned long dlen; + Bool swapit; + PropertyTagDataPtr ptdp; +{ + PropertyTagDataPtr new; + + new = (PropertyTagDataPtr) xalloc(dlen + sizeof(PropertyTagDataRec)); + if (!new) + return FALSE; + *new = *ptdp; + new->data = (pointer) (new + 1); + memcpy((char *) new->data, (char *) ptdp->data, dlen); + /* save data in proxy format */ + if (swapit) { + switch (new->format) { + case 32: + SwapLongs((CARD32 *) new->data, dlen >> 2); + break; + case 16: + SwapShorts((short *) new->data, dlen >> 1); + break; + } + } + return TagStoreDataNC(server, server->prop_cache, tid, + (dlen + sizeof(PropertyTagDataRec)), + LbxTagTypeProperty, new); +} + +/* + * lots of brains need to live here. this decides whether or not + * to use an LbxChangeProperty + * + * some possible heuristics: + * + * - don't rewrite if it's small -- roundtrip swamps bandwidth + * - don't rewrite if it's a WM property and the WM isn't sharing + * the proxy + * - don't rewrite if the prop is on a non-root window owned by + * a non-proxy client + * + * - do rewrite if it's a prop on one of the client's windows + * - do rewrite if it's a Selection property (hope is that + * receiver is also using proxy) + */ +/*ARGSUSED*/ +static Bool +rewrite_change_prop( + ClientPtr client, + Window win, + Atom property, + Atom type, + int format, + int mode, + unsigned long nUnits +) +{ + unsigned flags; + + /* if tags are turned off, don't try */ + if (!client || !client->server) + return FALSE; + if (!client->server->lbxNegOpt.useTags) + return FALSE; + /* we aren't nearly clever enough to know what data we have */ + if (mode != PropModeReplace) + return FALSE; + if ((nUnits * (format >> 3)) < min_keep_prop_size) + return FALSE; + flags = FlagsForAtom(client->server, property); + if (flags & AtomNoCacheFlag) + return FALSE; + if ((flags & AtomWMCacheFlag) && !client->server->wm_running) + return FALSE; + return TRUE; +} + +int +ProcLBXChangeProperty(client) + ClientPtr client; +{ + REQUEST(xChangePropertyReq); + ReplyStuffPtr nr; + int size; + pointer datacopy; + char n; + Atom type, property; + Window win; + CARD32 nUnits; + + win = stuff->window; + property = stuff->property; + type = stuff->type; + nUnits = stuff->nUnits; + + if (client->swapped) { + swapl(&win, n); + swapl(&property, n); + swapl(&type, n); + swapl(&nUnits, n); + } + + /* we may want to leave it as X_ChangeProperty */ + if (!rewrite_change_prop(client, win, property, type, + stuff->format, stuff->mode, nUnits)) + return ProcStandardRequest(client); + + size = nUnits * (stuff->format >> 3); + datacopy = (pointer) xalloc(size); + if (!datacopy) + return ProcStandardRequest(client); + memcpy((char *) datacopy, (char *) &stuff[1], size); + + nr = NewReply(client, client->server->lbxReq, X_LbxChangeProperty, + GetLbxChangePropertyReply); + if (!nr) { + xfree(datacopy); + return ProcStandardRequest(client); + } + nr->request_info.lbxchangeprop.ptd.length = size; + nr->request_info.lbxchangeprop.ptd.type = type; + nr->request_info.lbxchangeprop.ptd.format = stuff->format; + nr->request_info.lbxchangeprop.ptd.data = datacopy; + + FinishLBXRequest(client, REQ_REPLACELATE); + SendChangeProperty(client, win, property, type, + stuff->format, stuff->mode, nUnits); + return Success; +} + +static Bool +GetLbxChangePropertyReply(client, nr, data) + ClientPtr client; + ReplyStuffPtr nr; + char *data; +{ + xLbxChangePropertyReply *rep; + PropertyTagDataPtr ptdp; + char n; + CARD32 tag; + + rep = (xLbxChangePropertyReply *) data; + tag = rep->tag; + if (client->swapped) { + swapl(&tag, n); + } + + ptdp = &nr->request_info.lbxchangeprop.ptd; + if (tag) { + if (!propTagStoreData(client->server, tag, (unsigned long)ptdp->length, + client->swapped, ptdp)) { + if (client->swapped) { + switch (ptdp->format) { + case 32: + SwapLongs((CARD32 *) ptdp->data, ptdp->length >> 2); + break; + case 16: + SwapShorts((short *) ptdp->data, ptdp->length >> 1); + break; + } + } + SendTagData(client, tag, ptdp->length, ptdp->data); + SendInvalidateTag(client, tag); + WriteError(client, X_ChangeProperty, 0, 0, BadAlloc); + } + } + xfree(ptdp->data); /* propStore gets its own copy */ + return TRUE; +} + +int +ProcLBXGetProperty(client) + ClientPtr client; +{ + REQUEST(xGetPropertyReq); + ReplyStuffPtr nr; + + REQUEST_SIZE_MATCH(xGetPropertyReq); + + nr = NewReply(client, client->server->lbxReq, X_LbxGetProperty, + GetLbxGetPropertyReply); + if (!nr) + return ProcStandardRequest(client); + + if (client->swapped) { + char n; + + swapl(&stuff->window, n); + swapl(&stuff->property, n); + swapl(&stuff->type, n); + swapl(&stuff->longOffset, n); + swapl(&stuff->longLength, n); + } + nr->request_info.lbxgetprop.offset = stuff->longOffset; + nr->request_info.lbxgetprop.length = stuff->longLength; + + FinishLBXRequest(client, REQ_PASSTHROUGH); + + SendGetProperty(client, stuff->window, stuff->property, stuff->type, + stuff->delete, stuff->longOffset, stuff->longLength); + return Success; +} + +static Bool +GetLbxGetPropertyReply(client, nr, data) + ClientPtr client; + ReplyStuffPtr nr; + char *data; +{ + xLbxGetPropertyReply *rep; + unsigned long len; + PropertyTagDataRec ptd; + PropertyTagDataPtr ptdp; + pointer pdata = NULL; + char *sdata = NULL; + char n; + xGetPropertyReply reply; + CARD32 tag, nItems, type, bytesAfter; + + rep = (xLbxGetPropertyReply *) data; + + tag = rep->tag; + nItems = rep->nItems; + type = rep->propertyType; + bytesAfter = rep->bytesAfter; + if (client->swapped) { + swapl(&tag, n); + swapl(&nItems, n); + swapl(&type, n); + swapl(&bytesAfter, n); + } + ptd.type = type; + ptd.format = rep->format; + ptd.data = NULL; + len = rep->length << 2; + if (len) + ptd.length = nItems * (rep->format >> 3); + else + ptd.length = 0; + ptdp = &ptd; + + if (tag) { + if (len) { /* first time, set tag */ + +#ifdef LBX_STATS + getprop_full++; +#endif + + ptd.data = (pointer) &rep[1]; + if (!propTagStoreData(client->server, tag, len, client->swapped, + &ptd)) { + /* tell server we lost it */ + SendInvalidateTag(client, tag); + } + } else { + + ptdp = (PropertyTagDataPtr) TagGetData(client->server, + client->server->prop_cache, tag); + + if (!ptdp) { + fprintf(stderr, "no data for property tag 0x%lx\n", (long)tag); + WriteError(client, X_GetProperty, 0, 0, BadAlloc); + return TRUE; + } + if (client->swapped && rep->format != 8) { + /* + * Make a copy, because we will need to swap the property data + * and we don't want to alter the tag database. + */ + pdata = (pointer) ALLOCATE_LOCAL(ptdp->length); + memcpy((char *) pdata, (char *) ptdp->data, ptdp->length); + switch (rep->format) { + case 32: + SwapLongs((CARD32 *) pdata, ptdp->length >> 2); + break; + case 16: + SwapShorts((short *) pdata, ptdp->length >> 1); + break; + } + } + +#ifdef LBX_STATS + getprop_tag++; + tag_bytes_unsent += ptdp->length; +#endif + + } + } else if (len) { + +#ifdef LBX_STATS + getprop_full++; +#endif + + /* + * server didn't send us a tag -- either can't store it or no prop + * data + */ + ptd.data = (pointer) &rep[1]; + } + + if (pdata) + sdata = pdata; + else + sdata = ptdp->data; + if (rep->tag) { + len = ptdp->length; + reply.bytesAfter = bytesAfter; + } else { + len = ptdp->length - (nr->request_info.lbxgetprop.offset << 2); + len = min(len, nr->request_info.lbxgetprop.length << 2); + reply.bytesAfter = (ptdp->length - + (len + (nr->request_info.lbxgetprop.offset << 2))); + if (sdata) + sdata = sdata + (nr->request_info.lbxgetprop.offset << 2); + } + + if (ptdp->length) { + len = ptdp->length - (nr->request_info.lbxgetprop.offset << 2); + len = min(len, nr->request_info.lbxgetprop.length << 2); + reply.bytesAfter = (ptdp->length - + (len + (nr->request_info.lbxgetprop.offset << 2))); + } else { + len = 0; + reply.bytesAfter = rep->bytesAfter; + } + if(sdata) + sdata = sdata + (nr->request_info.lbxgetprop.offset << 2); + + reply.type = X_Reply; + reply.sequenceNumber = rep->sequenceNumber; + reply.format = ptdp->format; + reply.length = (len + 3) >> 2; + reply.propertyType = ptdp->type; + if (len && ptdp->format) + reply.nItems = len / (ptdp->format >> 3); + else + reply.nItems = 0; + + if (client->swapped) + SwapGetPropertyReply(&reply); + WriteToClient(client, sizeof(xGetPropertyReply), (char *) &reply); + if (len) + WriteToClient(client, len, sdata); + + if (pdata) + DEALLOCATE_LOCAL(pdata); + + return TRUE; +} diff --git a/app/lbxproxy/di/reqtype.c b/app/lbxproxy/di/reqtype.c new file mode 100644 index 000000000..b6a779ce8 --- /dev/null +++ b/app/lbxproxy/di/reqtype.c @@ -0,0 +1,312 @@ +/* $Xorg: reqtype.c,v 1.3 2000/08/17 19:53:56 cpqbld Exp $ */ +/* + * Copyright 1994 Network Computing Devices, Inc. + * + * Permission to use, copy, modify, distribute, and sell this software and + * its documentation for any purpose is hereby granted without fee, provided + * that the above copyright notice appear in all copies and that both that + * copyright notice and this permission notice appear in supporting + * documentation, and that the name Network Computing Devices, Inc. not be + * used in advertising or publicity pertaining to distribution of this + * software without specific, written prior permission. + * + * THIS SOFTWARE IS PROVIDED `AS-IS'. NETWORK COMPUTING DEVICES, INC., + * DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING WITHOUT + * LIMITATION ALL IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A + * PARTICULAR PURPOSE, OR NONINFRINGEMENT. IN NO EVENT SHALL NETWORK + * COMPUTING DEVICES, INC., BE LIABLE FOR ANY DAMAGES WHATSOEVER, INCLUDING + * SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES, INCLUDING LOSS OF USE, DATA, + * OR PROFITS, EVEN IF ADVISED OF THE POSSIBILITY THEREOF, AND REGARDLESS OF + * WHETHER IN AN ACTION IN CONTRACT, TORT OR NEGLIGENCE, ARISING OUT OF OR IN + * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + * + */ + +/* decides what tupe of request it is */ +#include "misc.h" +#include "os.h" /* in server/include */ +#include "reqtype.h" +#include "lbxext.h" + +static char cause_replies[] = { + FALSE, /* BadRequest */ + FALSE, /* CreateWindow */ + FALSE, /* ChangeWindowAttributes */ + TRUE, /* GetWindowAttributes */ + FALSE, /* DestroyWindow */ + FALSE, /* DestroySubwindows */ + FALSE, /* ChangeSaveSet */ + FALSE, /* ReparentWindow */ + FALSE, /* MapWindow */ + FALSE, /* MapSubwindows */ + FALSE, /* UnmapWindow */ + FALSE, /* UnmapSubwindows */ + FALSE, /* ConfigureWindow */ + FALSE, /* CirculateWindow */ + TRUE, /* GetGeometry */ + TRUE, /* QueryTree */ + TRUE, /* InternAtom */ + TRUE, /* GetAtomName */ + FALSE, /* ChangeProperty */ + FALSE, /* DeleteProperty */ + TRUE, /* GetProperty */ + TRUE, /* ListProperties */ + FALSE, /* SetSelectionOwner */ + TRUE, /* GetSelectionOwner */ + FALSE, /* ConvertSelection */ + FALSE, /* SendEvent */ + TRUE, /* GrabPointer */ + FALSE, /* UngrabPointer */ + FALSE, /* GrabButton */ + FALSE, /* UngrabButton */ + FALSE, /* ChangeActivePointerGrab */ + TRUE, /* GrabKeyboard */ + FALSE, /* UngrabKeyboard */ + FALSE, /* GrabKey */ + FALSE, /* UngrabKey */ + FALSE, /* AllowEvents */ + FALSE, /* GrabServer */ + FALSE, /* UngrabServer */ + TRUE, /* QueryPointer */ + TRUE, /* GetMotionEvents */ + TRUE, /* TranslateCoords */ + FALSE, /* WarpPointer */ + FALSE, /* SetInputFocus */ + TRUE, /* GetInputFocus */ + TRUE, /* QueryKeymap */ + FALSE, /* OpenFont */ + FALSE, /* CloseFont */ + TRUE, /* QueryFont */ + TRUE, /* QueryTextExtents */ + TRUE, /* ListFonts */ + TRUE, /* ListFontsWithInfo */ + FALSE, /* SetFontPath */ + TRUE, /* GetFontPath */ + FALSE, /* CreatePixmap */ + FALSE, /* FreePixmap */ + FALSE, /* CreateGC */ + FALSE, /* ChangeGC */ + FALSE, /* CopyGC */ + FALSE, /* SetDashes */ + FALSE, /* SetClipRectangles */ + FALSE, /* FreeGC */ + FALSE, /* ClearToBackground */ + FALSE, /* CopyArea */ + FALSE, /* CopyPlane */ + FALSE, /* PolyPoint */ + FALSE, /* PolyLine */ + FALSE, /* PolySegment */ + FALSE, /* PolyRectangle */ + FALSE, /* PolyArc */ + FALSE, /* FillPoly */ + FALSE, /* PolyFillRectangle */ + FALSE, /* PolyFillArc */ + FALSE, /* PutImage */ + TRUE, /* GetImage */ + FALSE, /* PolyText */ + FALSE, /* PolyText */ + FALSE, /* ImageText8 */ + FALSE, /* ImageText16 */ + FALSE, /* CreateColormap */ + FALSE, /* FreeColormap */ + FALSE, /* CopyColormapAndFree */ + FALSE, /* InstallColormap */ + FALSE, /* UninstallColormap */ + TRUE, /* ListInstalledColormaps */ + TRUE, /* AllocColor */ + TRUE, /* AllocNamedColor */ + TRUE, /* AllocColorCells */ + TRUE, /* AllocColorPlanes */ + FALSE, /* FreeColors */ + FALSE, /* StoreColors */ + FALSE, /* StoreNamedColor */ + TRUE, /* QueryColors */ + TRUE, /* LookupColor */ + FALSE, /* CreateCursor */ + FALSE, /* CreateGlyphCursor */ + FALSE, /* FreeCursor */ + FALSE, /* RecolorCursor */ + TRUE, /* QueryBestSize */ + TRUE, /* QueryExtension */ + TRUE, /* ListExtensions */ + FALSE, /* ChangeKeyboardMapping */ + TRUE, /* GetKeyboardMapping */ + FALSE, /* ChangeKeyboardControl */ + TRUE, /* GetKeyboardControl */ + FALSE, /* Bell */ + FALSE, /* ChangePointerControl */ + TRUE, /* GetPointerControl */ + FALSE, /* SetScreenSaver */ + TRUE, /* GetScreenSaver */ + FALSE, /* ChangeHosts */ + TRUE, /* ListHosts */ + FALSE, /* ChangeAccessControl */ + FALSE, /* ChangeCloseDownMode */ + FALSE, /* KillClient */ + FALSE, /* RotateProperties */ + FALSE, /* ForceScreenSaver */ + TRUE, /* SetPointerMapping */ + TRUE, /* GetPointerMapping */ + TRUE, /* SetModifierMapping */ + TRUE, /* GetModifierMapping */ + FALSE, /* BadRequest */ + FALSE, /* BadRequest */ + FALSE, /* BadRequest */ + FALSE, /* BadRequest */ + FALSE, /* BadRequest */ + FALSE, /* BadRequest */ + FALSE, /* BadRequest */ + FALSE /* NoOp */ +}; + +static char cause_events[] = { + FALSE, /* BadRequest */ + TRUE, /* CreateWindow */ + TRUE, /* ChangeWindowAttributes */ + FALSE, /* GetWindowAttributes */ + TRUE, /* DestroyWindow */ + TRUE, /* DestroySubwindows */ + FALSE, /* ChangeSaveSet */ + TRUE, /* ReparentWindow */ + TRUE, /* MapWindow */ + TRUE, /* MapSubwindows */ + TRUE, /* UnmapWindow */ + TRUE, /* UnmapSubwindows */ + TRUE, /* ConfigureWindow */ + TRUE, /* CirculateWindow */ + FALSE, /* GetGeometry */ + FALSE, /* QueryTree */ + FALSE, /* InternAtom */ + FALSE, /* GetAtomName */ + TRUE, /* ChangeProperty */ + TRUE, /* DeleteProperty */ + TRUE, /* GetProperty */ + FALSE, /* ListProperties */ + TRUE, /* SetSelectionOwner */ + FALSE, /* GetSelectionOwner */ + TRUE, /* ConvertSelection */ + TRUE, /* SendEvent */ + TRUE, /* GrabPointer */ + TRUE, /* UngrabPointer */ + FALSE, /* GrabButton */ + FALSE, /* UngrabButton */ + FALSE, /* ChangeActivePointerGrab */ + TRUE, /* GrabKeyboard */ + TRUE, /* UngrabKeyboard */ + FALSE, /* GrabKey */ + FALSE, /* UngrabKey */ + TRUE, /* AllowEvents */ + FALSE, /* GrabServer */ + FALSE, /* UngrabServer */ + FALSE, /* QueryPointer */ + FALSE, /* GetMotionEvents */ + FALSE, /* TranslateCoords */ + TRUE, /* WarpPointer */ + TRUE, /* SetInputFocus */ + FALSE, /* GetInputFocus */ + FALSE, /* QueryKeymap */ + FALSE, /* OpenFont */ + FALSE, /* CloseFont */ + FALSE, /* QueryFont */ + FALSE, /* QueryTextExtents */ + FALSE, /* ListFonts */ + FALSE, /* ListFontsWithInfo */ + FALSE, /* SetFontPath */ + FALSE, /* GetFontPath */ + FALSE, /* CreatePixmap */ + FALSE, /* FreePixmap */ + FALSE, /* CreateGC */ + FALSE, /* ChangeGC */ + FALSE, /* CopyGC */ + FALSE, /* SetDashes */ + FALSE, /* SetClipRectangles */ + FALSE, /* FreeGC */ + TRUE, /* ClearToBackground */ + TRUE, /* CopyArea */ + TRUE, /* CopyPlane */ + FALSE, /* PolyPoint */ + FALSE, /* PolyLine */ + FALSE, /* PolySegment */ + FALSE, /* PolyRectangle */ + FALSE, /* PolyArc */ + FALSE, /* FillPoly */ + FALSE, /* PolyFillRectangle */ + FALSE, /* PolyFillArc */ + FALSE, /* PutImage */ + FALSE, /* GetImage */ + FALSE, /* PolyText */ + FALSE, /* PolyText */ + FALSE, /* ImageText8 */ + FALSE, /* ImageText16 */ + FALSE, /* CreateColormap */ + TRUE, /* FreeColormap */ + FALSE, /* CopyColormapAndFree */ + TRUE, /* InstallColormap */ + TRUE, /* UninstallColormap */ + FALSE, /* ListInstalledColormaps */ + FALSE, /* AllocColor */ + FALSE, /* AllocNamedColor */ + FALSE, /* AllocColorCells */ + FALSE, /* AllocColorPlanes */ + FALSE, /* FreeColors */ + FALSE, /* StoreColors */ + FALSE, /* StoreNamedColor */ + FALSE, /* QueryColors */ + FALSE, /* LookupColor */ + FALSE, /* CreateCursor */ + FALSE, /* CreateGlyphCursor */ + FALSE, /* FreeCursor */ + FALSE, /* RecolorCursor */ + FALSE, /* QueryBestSize */ + FALSE, /* QueryExtension */ + FALSE, /* ListExtensions */ + TRUE, /* ChangeKeyboardMapping */ + FALSE, /* GetKeyboardMapping */ + FALSE, /* ChangeKeyboardControl */ + FALSE, /* GetKeyboardControl */ + FALSE, /* Bell */ + FALSE, /* ChangePointerControl */ + FALSE, /* GetPointerControl */ + FALSE, /* SetScreenSaver */ + FALSE, /* GetScreenSaver */ + FALSE, /* ChangeHosts */ + FALSE, /* ListHosts */ + FALSE, /* ChangeAccessControl */ + FALSE, /* ChangeCloseDownMode */ + FALSE, /* KillClient */ + TRUE, /* RotateProperties */ + FALSE, /* ForceScreenSaver */ + TRUE, /* SetPointerMapping */ + FALSE, /* GetPointerMapping */ + TRUE, /* SetModifierMapping */ + FALSE, /* GetModifierMapping */ + FALSE, /* BadRequest */ + FALSE, /* BadRequest */ + FALSE, /* BadRequest */ + FALSE, /* BadRequest */ + FALSE, /* BadRequest */ + FALSE, /* BadRequest */ + FALSE, /* BadRequest */ + FALSE /* NoOp */ +}; + + +Bool +GeneratesEvents(client, req) + ClientPtr client; + xReq *req; +{ + if (req->reqType > X_NoOperation) + return CheckExtensionForEvents(client, req); + return cause_events[req->reqType]; +} + +int +GeneratesReplies(client, req) + ClientPtr client; + xReq *req; +{ + if (req->reqType > X_NoOperation) + return CheckExtensionForReplies(client, req); + return (int) cause_replies[req->reqType]; +} diff --git a/app/lbxproxy/di/resource.c b/app/lbxproxy/di/resource.c new file mode 100644 index 000000000..274a5a2f6 --- /dev/null +++ b/app/lbxproxy/di/resource.c @@ -0,0 +1,487 @@ +/* $Xorg: resource.c,v 1.4 2000/08/17 19:53:56 cpqbld Exp $ */ +/* $XdotOrg$ */ +/* + +Copyright 1987, 1998 The Open Group + +Permission to use, copy, modify, distribute, and sell this software and its +documentation for any purpose is hereby granted without fee, provided that +the above copyright notice appear in all copies and that both that +copyright notice and this permission notice appear in supporting +documentation. + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the name of The Open Group shall not be +used in advertising or otherwise to promote the sale, use or other dealings +in this Software without prior written authorization from The Open Group. + +*/ + +/************************************************************ + +Copyright 1988, 1989 Network Computing Devices, Inc. All rights reserved. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the name of The Open Group shall not be +used in advertising or otherwise to promote the sale, use or other dealings +in this Software without prior written authorization from The Open Group. + + +Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. + + All Rights Reserved + +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, +provided that the above copyright notice appear in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the name of Digital not be +used in advertising or publicity pertaining to distribution of the +software without specific, written prior permission. + +DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING +ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL +DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR +ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, +ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS +SOFTWARE. + +********************************************************/ + + +#include +#include "misc.h" +#include "os.h" +#include "resource.h" +#include "lbx.h" +#include "colormap.h" +#include "wire.h" + +static void RebuildTable(); + +#define INITBUCKETS 64 +#define INITHASHSIZE 6 +#define MAXHASHSIZE 11 + +#define NullResource ((ResourcePtr)NULL) + +#define TypeMask (RC_LASTPREDEF - 1) + +static DeleteType *DeleteFuncs = (DeleteType *)NULL; + +/* + * NOTE for LBX Multi Display + * + * The index field for each client in the global "clients" array + * represents that client's position in the "clients" array. + * + * Each server has its own clientTable array and the client's + * index in the "clients" array is identical to the client's + * index in its server's clientTable array. This facilitates + * the storage and retrieval of a client's resources. + */ + +Bool +InitDeleteFuncs() +{ + if (DeleteFuncs) + xfree(DeleteFuncs); + DeleteFuncs = (DeleteType *) xalloc((RT_LASTPREDEF + 1) * + sizeof(DeleteType)); + if (!DeleteFuncs) + return FALSE; + DeleteFuncs[RT_COLORMAP & TypeMask] = DestroyColormap; + DeleteFuncs[RT_CMAPENTRY & TypeMask] = FreeClientPixels; + return TRUE; +} + +/***************** + * InitClientResources + * When a new client is created, call this to allocate space + * in resource table + *****************/ + +Bool +InitClientResources(client) + ClientPtr client; +{ + register int i, j; + + if (!client || !client->server) + /* + * This can occur during a reset + */ + return TRUE; + + client->server->clientTable[i = client->index].resources = + (ResourcePtr *)xalloc(INITBUCKETS*sizeof(ResourcePtr)); + if (!client->server->clientTable[i].resources) + return FALSE; + + client->server->clientTable[i].buckets = INITBUCKETS; + client->server->clientTable[i].elements = 0; + client->server->clientTable[i].hashsize = INITHASHSIZE; + + for (j=0; jserver->clientTable[i].resources[j] = NullResource; + } + return TRUE; +} + +void +FinishInitClientResources(client, ridBase, ridMask) + ClientPtr client; + XID ridBase, ridMask; +{ + client->ridBase = ridBase; + client->ridMask = ridMask; + client->server->clientTable[client->index].endFakeID = + (ridBase | ridMask) + 1; + client->server->clientTable[client->index].fakeID = ridBase | PROXY_BIT; +} + +static int +Hash(client, id) + int client; + register XID id; +{ + id &= clients[client]->ridMask; + switch (clients[client]->server->clientTable[client].hashsize) + { + case 6: + return ((int)(0x03F & (id ^ (id>>6) ^ (id>>12)))); + case 7: + return ((int)(0x07F & (id ^ (id>>7) ^ (id>>13)))); + case 8: + return ((int)(0x0FF & (id ^ (id>>8) ^ (id>>16)))); + case 9: + return ((int)(0x1FF & (id ^ (id>>9)))); + case 10: + return ((int)(0x3FF & (id ^ (id>>10)))); + case 11: + return ((int)(0x7FF & (id ^ (id>>11)))); + } + return -1; +} + +static XID +AvailableID(client, id, maxid, goodid) + register int client; + register XID id, maxid, goodid; +{ + register ResourcePtr res; + + if ((goodid >= id) && (goodid <= maxid)) + return goodid; + for (; id <= maxid; id++) + { + res = clients[client]->server->clientTable[client].resources[Hash(client, id)]; + while (res && (res->id != id)) + res = res->next; + if (!res) + return id; + } + return 0; +} + +/* + * return the next usable fake client ID. + * + * normally this is just the next one in line, but if we've used the last + * in the range, we need to find a new range of safe IDs to avoid + * over-running another client. + */ + +XID +FakeClientID(client) + register int client; /* Index of a client for the global clients + * array and the server's clientTable */ +{ + register XID id, maxid; + register ResourcePtr *resp; + register ResourcePtr res; + register int i; + XID goodid = 0; + + id = clients[client]->server->clientTable[client].fakeID++; + if (id != clients[client]->server->clientTable[client].endFakeID) + return id; + + id = clients[client]->ridBase | PROXY_BIT; + maxid = id | clients[client]->ridMask; + + for (resp = clients[client]->server->clientTable[client].resources, + i = clients[client]->server->clientTable[client].buckets; + --i >= 0;) + { + for (res = *resp++; res; res = res->next) + { + if ((res->id < id) || (res->id > maxid)) + continue; + if (((res->id - id) >= (maxid - res->id)) ? + (goodid = AvailableID(client, id, res->id - 1, goodid)) : + !(goodid = AvailableID(client, res->id + 1, maxid, goodid))) + maxid = res->id - 1; + else + id = res->id + 1; + } + } + + clients[client]->server->clientTable[client].fakeID = id + 1; + clients[client]->server->clientTable[client].endFakeID = maxid + 1; + + return id; +} + +Bool +AddResource(pclient, id, type, value) + ClientPtr pclient; + XID id; + RESTYPE type; + pointer value; +{ + int client; + register ClientResourceRec *rrec; + register ResourcePtr res, *head; + + client = pclient->index; + + rrec = &clients[client]->server->clientTable[client]; + if (!rrec->buckets) + { + ErrorF("AddResource(%x, %x, %x), client=%d \n", + id, type, (unsigned long)value, client); + FatalError("client not in use\n"); + } + if ((rrec->elements >= 4*rrec->buckets) && + (rrec->hashsize < MAXHASHSIZE)) + RebuildTable(client); + head = &rrec->resources[Hash(client, id)]; + res = (ResourcePtr)xalloc(sizeof(ResourceRec)); + if (!res) + { + (*DeleteFuncs[type & TypeMask])(pclient, value, id); + return FALSE; + } + res->next = *head; + res->id = id; + res->type = type; + res->value = value; + *head = res; + rrec->elements++; + return TRUE; +} + +static void +RebuildTable(client) + int client; +{ + register int j; + register ResourcePtr res, next; + ResourcePtr **tails, *resources; + register ResourcePtr **tptr, *rptr; + + /* + * For now, preserve insertion order, since some ddx layers depend + * on resources being free in the opposite order they are added. + */ + + j = 2 * clients[client]->server->clientTable[client].buckets; + tails = (ResourcePtr **)ALLOCATE_LOCAL(j * sizeof(ResourcePtr *)); + if (!tails) + return; + resources = (ResourcePtr *)xalloc(j * sizeof(ResourcePtr)); + if (!resources) + { + DEALLOCATE_LOCAL(tails); + return; + } + for (rptr = resources, tptr = tails; --j >= 0; rptr++, tptr++) + { + *rptr = NullResource; + *tptr = rptr; + } + clients[client]->server->clientTable[client].hashsize++; + for (j = clients[client]->server->clientTable[client].buckets, + rptr = clients[client]->server->clientTable[client].resources; + --j >= 0; + rptr++) + { + for (res = *rptr; res; res = next) + { + next = res->next; + res->next = NullResource; + tptr = &tails[Hash(client, res->id)]; + **tptr = res; + *tptr = &res->next; + } + } + DEALLOCATE_LOCAL(tails); + clients[client]->server->clientTable[client].buckets *= 2; + xfree(clients[client]->server->clientTable[client].resources); + clients[client]->server->clientTable[client].resources = resources; +} + +void +FreeResource(client, id, skipDeleteFuncType) + ClientPtr client; + XID id; + RESTYPE skipDeleteFuncType; +{ + int cid; + register ResourcePtr res; + register ResourcePtr *prev, *head; + register int *eltptr; + int elements; + Bool gotOne = FALSE; + + cid = client->index; + + if (clients[cid]->server->clientTable[cid].buckets) + { + head = &clients[cid]->server->clientTable[cid].resources[Hash(cid, id)]; + eltptr = &clients[cid]->server->clientTable[cid].elements; + + prev = head; + while ((res = *prev)) + { + if (res->id == id) + { + RESTYPE rtype = res->type; + *prev = res->next; + elements = --*eltptr; + if (rtype != skipDeleteFuncType) + (*DeleteFuncs[rtype & TypeMask])(client, res->value, res->id); + xfree(res); + if (*eltptr != elements) + prev = head; /* prev may no longer be valid */ + gotOne = TRUE; + } + else + prev = &res->next; + } + } + if (!gotOne) + FatalError("Freeing resource id=%X which isn't there", id); +} + +void +FreeClientResources(client) + ClientPtr client; +{ + register ResourcePtr *resources; + register ResourcePtr this; + int j; + + /* This routine shouldn't be called with a null client, but just in + case ... */ + + if (!client) + return; + + /* + * For a multi-display proxy, must not re-free the clientTable + * for a server. + */ + if (!client->server) + return; + + resources = client->server->clientTable[client->index].resources; + for (j=0; j < client->server->clientTable[client->index].buckets; j++) + { + /* It may seem silly to update the head of this resource list as + we delete the members, since the entire list will be deleted any way, + but there are some resource deletion functions "FreeClientPixels" for + one which do a LookupID on another resource id (a Colormap id in this + case), so the resource list must be kept valid up to the point that + it is deleted, so every time we delete a resource, we must update the + head, just like in FreeResource. I hope that this doesn't slow down + mass deletion appreciably. PRH */ + + ResourcePtr *head; + + head = &resources[j]; + + for (this = *head; this; this = *head) + { + RESTYPE rtype = this->type; + *head = this->next; + (*DeleteFuncs[rtype & TypeMask])(client, this->value, this->id); + xfree(this); + } + } + xfree(client->server->clientTable[client->index].resources); + client->server->clientTable[client->index].buckets = 0; + if (client->server->lastLbxClientIndexLookup == client) + client->server->lastLbxClientIndexLookup = NULL; +} + +void +FreeAllResources() +{ + int j; + + for (j = currentMaxClients; --j >= 0; ) + { + if (clients[j]->server->clientTable[j].buckets) + FreeClientResources(clients[j]); + } +} + +/* + * LookupIDByType returns the object with the given id and type, else NULL. + */ +pointer +LookupIDByType(pclient, id, rtype) + ClientPtr pclient; + XID id; + RESTYPE rtype; +{ + register ResourcePtr res; + int i, j; + XServerPtr pserver = pclient->server; + + for (i = 1; i < currentMaxClients; i++) { + if (pserver->clientTable[i].buckets) { + for (j = 0; j < INITBUCKETS; j++) { + if (pserver->clientTable[i].resources[j]) { + if (clients[j]) { + res = pserver->clientTable[i].resources[Hash(j, id)]; + for (; res; res = res->next) + if ((res->id == id) && (res->type == rtype)) + return res->value; + } + } + } + } + } + + return (pointer)NULL; +} diff --git a/app/lbxproxy/di/swaprep.c b/app/lbxproxy/di/swaprep.c new file mode 100644 index 000000000..c5fc3720f --- /dev/null +++ b/app/lbxproxy/di/swaprep.c @@ -0,0 +1,431 @@ +/* $Xorg: swaprep.c,v 1.4 2001/02/09 02:05:32 xorgcvs Exp $ */ +/* + +Copyright 1998 The Open Group + +Permission to use, copy, modify, distribute, and sell this software and its +documentation for any purpose is hereby granted without fee, provided that +the above copyright notice appear in all copies and that both that +copyright notice and this permission notice appear in supporting +documentation. + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the name of The Open Group shall not be +used in advertising or otherwise to promote the sale, use or other dealings +in this Software without prior written authorization from The Open Group. + +*/ +/* + * + * Copyright 1994 Network Computing Devices, Inc. + * + * Permission to use, copy, modify, distribute, and sell this software and + * its documentation for any purpose is hereby granted without fee, provided + * that the above copyright notice appear in all copies and that both that + * copyright notice and this permission notice appear in supporting + * documentation, and that the name Network Computing Devices, Inc. not be + * used in advertising or publicity pertaining to distribution of this + * software without specific, written prior permission. + * + * THIS SOFTWARE IS PROVIDED `AS-IS'. NETWORK COMPUTING DEVICES, INC., + * DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING WITHOUT + * LIMITATION ALL IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A + * PARTICULAR PURPOSE, OR NONINFRINGEMENT. IN NO EVENT SHALL NETWORK + * COMPUTING DEVICES, INC., BE LIABLE FOR ANY DAMAGES WHATSOEVER, INCLUDING + * SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES, INCLUDING LOSS OF USE, DATA, + * OR PROFITS, EVEN IF ADVISED OF THE POSSIBILITY THEREOF, AND REGARDLESS OF + * WHETHER IN AN ACTION IN CONTRACT, TORT OR NEGLIGENCE, ARISING OUT OF OR IN + * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + * + */ + +#include +#include "misc.h" +#include "assert.h" +#include "lbx.h" +#include "swap.h" + +void +SwapConnSetup(pConnSetup, pConnSetupT) + xConnSetup *pConnSetup, + *pConnSetupT; +{ + cpswapl(pConnSetup->release, pConnSetupT->release); + cpswapl(pConnSetup->ridBase, pConnSetupT->ridBase); + cpswapl(pConnSetup->ridMask, pConnSetupT->ridMask); + cpswapl(pConnSetup->motionBufferSize, pConnSetupT->motionBufferSize); + cpswaps(pConnSetup->nbytesVendor, pConnSetupT->nbytesVendor); + cpswaps(pConnSetup->maxRequestSize, pConnSetupT->maxRequestSize); + pConnSetupT->minKeyCode = pConnSetup->minKeyCode; + pConnSetupT->maxKeyCode = pConnSetup->maxKeyCode; + pConnSetupT->numRoots = pConnSetup->numRoots; + pConnSetupT->numFormats = pConnSetup->numFormats; + pConnSetupT->imageByteOrder = pConnSetup->imageByteOrder; + pConnSetupT->bitmapBitOrder = pConnSetup->bitmapBitOrder; + pConnSetupT->bitmapScanlineUnit = pConnSetup->bitmapScanlineUnit; + pConnSetupT->bitmapScanlinePad = pConnSetup->bitmapScanlinePad; +} + +void +SwapWinRoot(pRoot, pRootT) + xWindowRoot *pRoot, + *pRootT; +{ + cpswapl(pRoot->windowId, pRootT->windowId); + cpswapl(pRoot->defaultColormap, pRootT->defaultColormap); + cpswapl(pRoot->whitePixel, pRootT->whitePixel); + cpswapl(pRoot->blackPixel, pRootT->blackPixel); + cpswapl(pRoot->currentInputMask, pRootT->currentInputMask); + cpswaps(pRoot->pixWidth, pRootT->pixWidth); + cpswaps(pRoot->pixHeight, pRootT->pixHeight); + cpswaps(pRoot->mmWidth, pRootT->mmWidth); + cpswaps(pRoot->mmHeight, pRootT->mmHeight); + cpswaps(pRoot->minInstalledMaps, pRootT->minInstalledMaps); + cpswaps(pRoot->maxInstalledMaps, pRootT->maxInstalledMaps); + cpswapl(pRoot->rootVisualID, pRootT->rootVisualID); + pRootT->backingStore = pRoot->backingStore; + pRootT->saveUnders = pRoot->saveUnders; + pRootT->rootDepth = pRoot->rootDepth; + pRootT->nDepths = pRoot->nDepths; +} + +void +SwapVisual(pVis, pVisT) + xVisualType *pVis, + *pVisT; +{ + cpswapl(pVis->visualID, pVisT->visualID); + pVisT->class = pVis->class; + pVisT->bitsPerRGB = pVis->bitsPerRGB; + cpswaps(pVis->colormapEntries, pVisT->colormapEntries); + cpswapl(pVis->redMask, pVisT->redMask); + cpswapl(pVis->greenMask, pVisT->greenMask); + cpswapl(pVis->blueMask, pVisT->blueMask); +} + +void +WriteSConnSetupPrefix(pClient, pcsp) + ClientPtr pClient; + xConnSetupPrefix *pcsp; +{ + xConnSetupPrefix cspT; + + cspT.success = pcsp->success; + cspT.lengthReason = pcsp->lengthReason; + cpswaps(pcsp->majorVersion, cspT.majorVersion); + cpswaps(pcsp->minorVersion, cspT.minorVersion); + cpswaps(pcsp->length, cspT.length); + (void)WriteToClient(pClient, sizeof(cspT), (char *) &cspT); +} + +void +WriteSConnectionInfo(pClient, size, pInfo) + ClientPtr pClient; + unsigned long size; + char *pInfo; +{ + int i, + j, + k; + xDepth *pDepth; + int numDepths; + char *pInfoT, + *pInfoTBase; + xConnSetup *pConnSetup = (xConnSetup *) pInfo; + + pInfoT = pInfoTBase = (char *) ALLOCATE_LOCAL(size); + if (!pInfoTBase) { + pClient->noClientException = -1; + return; + } + SwapConnSetup(pConnSetup, (xConnSetup *) pInfoT); + pInfo += sizeof(xConnSetup); + pInfoT += sizeof(xConnSetup); + + /* Copy the vendor string */ + i = (pConnSetup->nbytesVendor + 3) & ~3; + memmove(pInfoT, pInfo, i); + pInfo += i; + pInfoT += i; + + /* The Pixmap formats don't need to be swapped, just copied. */ + i = sizeof(xPixmapFormat) * pConnSetup->numFormats; + memmove(pInfoT, pInfo, i); + pInfo += i; + pInfoT += i; + + for (i = 0; i < pConnSetup->numRoots; i++) { + SwapWinRoot((xWindowRoot *) pInfo, (xWindowRoot *) pInfoT); + numDepths = ((xWindowRoot *) pInfo)->nDepths; + pInfo += sizeof(xWindowRoot); + pInfoT += sizeof(xWindowRoot); + pDepth = (xDepth *) pInfo; + for (j = 0; j < numDepths; j++, pDepth = (xDepth *) pInfo) { + ((xDepth *) pInfoT)->depth = ((xDepth *) pInfo)->depth; + cpswaps(((xDepth *) pInfo)->nVisuals, ((xDepth *) pInfoT)->nVisuals); + pInfo += sizeof(xDepth); + pInfoT += sizeof(xDepth); + for (k = 0; k < pDepth->nVisuals; k++) { + SwapVisual((xVisualType *) pInfo, (xVisualType *) pInfoT); + pInfo += sizeof(xVisualType); + pInfoT += sizeof(xVisualType); + } + } + } + (void) WriteToClient(pClient, (int) size, (char *) pInfoTBase); + DEALLOCATE_LOCAL(pInfoTBase); +} + +void +SwapGetPropertyReply(rep) + xGetPropertyReply *rep; +{ + char n; + + swaps(&rep->sequenceNumber, n); + swapl(&rep->length, n); + swapl(&rep->propertyType, n); + swapl(&rep->bytesAfter, n); + swapl(&rep->nItems, n); +} + +void +SwapInternAtomReply(rep) + xInternAtomReply *rep; +{ + char n; + + swaps(&rep->sequenceNumber, n); + swapl(&rep->length, n); + swapl(&rep->atom, n); +} + +void +SwapGetAtomNameReply(rep) + xGetAtomNameReply *rep; +{ + char n; + + swaps(&rep->sequenceNumber, n); + swapl(&rep->length, n); + swaps(&rep->nameLength, n); +} + +void +SwapLookupColorReply(rep) + xLookupColorReply *rep; +{ + char n; + + swaps(&rep->sequenceNumber, n); + swapl(&rep->length, n); + swaps(&rep->exactRed, n); + swaps(&rep->exactGreen, n); + swaps(&rep->exactBlue, n); + swaps(&rep->screenRed, n); + swaps(&rep->screenGreen, n); + swaps(&rep->screenBlue, n); +} + +void +SwapAllocColorReply(rep) + xAllocColorReply *rep; +{ + char n; + + swaps(&rep->sequenceNumber, n); + swapl(&rep->length, n); + swaps(&rep->red, n); + swaps(&rep->green, n); + swaps(&rep->blue, n); + swapl(&rep->pixel, n); +} + +void +SwapAllocNamedColorReply(rep) + xAllocNamedColorReply *rep; +{ + char n; + + swaps(&rep->sequenceNumber, n); + swapl(&rep->length, n); + swaps(&rep->exactRed, n); + swaps(&rep->exactGreen, n); + swaps(&rep->exactBlue, n); + swaps(&rep->screenRed, n); + swaps(&rep->screenGreen, n); + swaps(&rep->screenBlue, n); + swapl(&rep->pixel, n); +} + +void +SwapModmapReply(rep) + xGetModifierMappingReply *rep; +{ + char n; + + swaps(&rep->sequenceNumber, n); + swapl(&rep->length, n); +} + +void +SwapKeymapReply(rep) + xGetKeyboardMappingReply *rep; +{ + char n; + + swaps(&rep->sequenceNumber, n); + swapl(&rep->length, n); +} + +void +SwapGetImageReply(rep) + xGetImageReply *rep; +{ + char n; + + swaps(&rep->sequenceNumber, n); + swapl(&rep->length, n); + swapl(&rep->visual, n); +} + +void +SwapQueryExtensionReply(rep) + xQueryExtensionReply *rep; +{ + char n; + + swaps(&rep->sequenceNumber, n); + swapl(&rep->length, n); +} + +static void +SwapCharInfo(pInfo) + xCharInfo *pInfo; +{ + register char n; + + swaps(&pInfo->leftSideBearing, n); + swaps(&pInfo->rightSideBearing, n); + swaps(&pInfo->characterWidth, n); + swaps(&pInfo->ascent, n); + swaps(&pInfo->descent, n); + swaps(&pInfo->attributes, n); +} + +static void +SwapFontInfo(pr) + xQueryFontReply *pr; +{ + register char n; + + swaps(&pr->minCharOrByte2, n); + swaps(&pr->maxCharOrByte2, n); + swaps(&pr->defaultChar, n); + swaps(&pr->nFontProps, n); + swaps(&pr->fontAscent, n); + swaps(&pr->fontDescent, n); + SwapCharInfo(&pr->minBounds); + SwapCharInfo(&pr->maxBounds); + swapl(&pr->nCharInfos, n); +} + +static void +SwapLbxFontInfo(pr) + xLbxFontInfo *pr; +{ + register char n; + + swaps(&pr->minCharOrByte2, n); + swaps(&pr->maxCharOrByte2, n); + swaps(&pr->defaultChar, n); + swaps(&pr->nFontProps, n); + swaps(&pr->fontAscent, n); + swaps(&pr->fontDescent, n); + SwapCharInfo(&pr->minBounds); + SwapCharInfo(&pr->maxBounds); + swapl(&pr->nCharInfos, n); +} + +/* native flag specifies whether its usable and we're trying + * to swap it for external use + */ +void +SwapFont(pr, native) + xQueryFontReply *pr; + Bool native; +{ + unsigned i; + xCharInfo *pxci; + unsigned nchars, + nprops; + char *pby; + register char n; + + swaps(&pr->sequenceNumber, n); + swapl(&pr->length, n); + if (!native) + SwapFontInfo(pr); + nchars = pr->nCharInfos; + nprops = pr->nFontProps; + if (native) + SwapFontInfo(pr); + pby = (char *) &pr[1]; + /* + * Font properties are an atom and either an int32 or a CARD32, so they + * are always 2 4 byte values + */ + for (i = 0; i < nprops; i++) { + swapl(pby, n); + pby += 4; + swapl(pby, n); + pby += 4; + } + pxci = (xCharInfo *) pby; + for (i = 0; i < nchars; i++, pxci++) + SwapCharInfo(pxci); +} + +void +LbxSwapFontInfo(pr, compressed) + xLbxFontInfo *pr; + Bool compressed; +{ + unsigned i; + xCharInfo *pxci; + unsigned nchars, + nprops; + char *pby; + register char n; + + SwapLbxFontInfo(pr); + nchars = pr->nCharInfos; + nprops = pr->nFontProps; + pby = (char *) &pr[1]; + /* + * Font properties are an atom and either an int32 or a CARD32, so they + * are always 2 4 byte values + */ + for (i = 0; i < nprops; i++) { + swapl(pby, n); + pby += 4; + swapl(pby, n); + pby += 4; + } + pxci = (xCharInfo *) pby; + if (!compressed) { + for (i = 0; i < nchars; i++, pxci++) + SwapCharInfo(pxci); + } else { + SwapLongs((CARD32 *) pxci, nchars); + } +} diff --git a/app/lbxproxy/di/swapreq.c b/app/lbxproxy/di/swapreq.c new file mode 100644 index 000000000..ab35a7b23 --- /dev/null +++ b/app/lbxproxy/di/swapreq.c @@ -0,0 +1,327 @@ +/* $Xorg: swapreq.c,v 1.4 2001/02/09 02:05:32 xorgcvs Exp $ */ +/* + +Copyright 1998 The Open Group + +Permission to use, copy, modify, distribute, and sell this software and its +documentation for any purpose is hereby granted without fee, provided that +the above copyright notice appear in all copies and that both that +copyright notice and this permission notice appear in supporting +documentation. + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the name of The Open Group shall not be +used in advertising or otherwise to promote the sale, use or other dealings +in this Software without prior written authorization from The Open Group. + +*/ +/* + * + * Copyright 1994 Network Computing Devices, Inc. + * + * Permission to use, copy, modify, distribute, and sell this software and + * its documentation for any purpose is hereby granted without fee, provided + * that the above copyright notice appear in all copies and that both that + * copyright notice and this permission notice appear in supporting + * documentation, and that the name Network Computing Devices, Inc. not be + * used in advertising or publicity pertaining to distribution of this + * software without specific, written prior permission. + * + * THIS SOFTWARE IS PROVIDED `AS-IS'. NETWORK COMPUTING DEVICES, INC., + * DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING WITHOUT + * LIMITATION ALL IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A + * PARTICULAR PURPOSE, OR NONINFRINGEMENT. IN NO EVENT SHALL NETWORK + * COMPUTING DEVICES, INC., BE LIABLE FOR ANY DAMAGES WHATSOEVER, INCLUDING + * SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES, INCLUDING LOSS OF USE, DATA, + * OR PROFITS, EVEN IF ADVISED OF THE POSSIBILITY THEREOF, AND REGARDLESS OF + * WHETHER IN AN ACTION IN CONTRACT, TORT OR NEGLIGENCE, ARISING OUT OF OR IN + * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + * + */ + +#include +#include "misc.h" +#include "assert.h" +#include "lbx.h" +#include "swap.h" + +/* Byte swap a list of longs */ +void +SwapLongs(list, count) + register CARD32 *list; + register unsigned long count; +{ + register char n; + + while (count >= 8) { + swapl(list + 0, n); + swapl(list + 1, n); + swapl(list + 2, n); + swapl(list + 3, n); + swapl(list + 4, n); + swapl(list + 5, n); + swapl(list + 6, n); + swapl(list + 7, n); + list += 8; + count -= 8; + } + if (count != 0) { + do { + swapl(list, n); + list++; + } while (--count != 0); + } +} + +/* Byte swap a list of shorts */ +void +SwapShorts(list, count) + register short *list; + register unsigned long count; +{ + register char n; + + while (count >= 16) { + swaps(list + 0, n); + swaps(list + 1, n); + swaps(list + 2, n); + swaps(list + 3, n); + swaps(list + 4, n); + swaps(list + 5, n); + swaps(list + 6, n); + swaps(list + 7, n); + swaps(list + 8, n); + swaps(list + 9, n); + swaps(list + 10, n); + swaps(list + 11, n); + swaps(list + 12, n); + swaps(list + 13, n); + swaps(list + 14, n); + swaps(list + 15, n); + list += 16; + count -= 16; + } + if (count != 0) { + do { + swaps(list, n); + list++; + } while (--count != 0); + } +} + +void +SwapConnClientPrefix(pCCP) + xConnClientPrefix *pCCP; +{ + register char n; + + swaps(&pCCP->majorVersion, n); + swaps(&pCCP->minorVersion, n); + swaps(&pCCP->nbytesAuthProto, n); + swaps(&pCCP->nbytesAuthString, n); +} + +void +SwapNewClient(r) + xLbxNewClientReq *r; +{ + char n; + + swapl(&r->client, n); +} + +void +SwapCloseClient(r) + xLbxCloseClientReq *r; +{ + char n; + + swapl(&r->client, n); +} + +void +SwapModifySequence(r) + xLbxModifySequenceReq *r; +{ + char n; + + swapl(&r->adjust, n); +} + +void +SwapIncrementPixel(r) + xLbxIncrementPixelReq *r; +{ + char n; + + swapl(&r->cmap, n); + swapl(&r->pixel, n); +} + +/* ARGSUSED */ +void +SwapGetModifierMapping(r) + xLbxGetModifierMappingReq *r; +{ +} + +/* ARGSUSED */ +void +SwapGetKeyboardMapping(r) + xLbxGetKeyboardMappingReq *r; +{ +} + +void +SwapQueryFont(r) + xLbxQueryFontReq *r; +{ + char n; + + swapl(&r->fid, n); +} + +void +SwapChangeProperty(r) + xLbxChangePropertyReq *r; +{ + char n; + + swapl(&r->window, n); + swapl(&r->property, n); + swapl(&r->type, n); + swapl(&r->nUnits, n); +} + +void +SwapGetProperty(r) + xLbxGetPropertyReq *r; +{ + char n; + + swapl(&r->window, n); + swapl(&r->property, n); + swapl(&r->type, n); + swapl(&r->longOffset, n); + swapl(&r->longLength, n); +} + +void +SwapGetImage (r) + xLbxGetImageReq *r; +{ + char n; + + swapl(&r->drawable, n); + swaps(&r->x, n); + swaps(&r->y, n); + swaps(&r->width, n); + swaps(&r->height, n); + swapl(&r->planeMask, n); +} + + +void +SwapInternAtoms(r) + xLbxInternAtomsReq *r; +{ + char n; + char *ptr; + char lenbuf[2]; + CARD16 len; + int i; + + ptr = (char *) r + sz_xLbxInternAtomsReq; + for (i = 0; i < r->num; i++) + { + lenbuf[0] = ptr[0]; + lenbuf[1] = ptr[1]; + len = *((CARD16 *) lenbuf); + swaps (ptr, n); + ptr += (len + 2); + } + + swaps(&r->num, n); +} + + +void +SwapInvalidateTag(r) + xLbxInvalidateTagReq *r; +{ + char n; + + swapl(&r->tag, n); +} + +void +SwapTagData(r) + xLbxTagDataReq *r; +{ + char n; + + swapl(&r->real_length, n); + swapl(&r->tag, n); +} + +void +SwapQueryExtension(r) + xLbxQueryExtensionReq *r; +{ + char n; + + swapl(&r->nbytes, n); +} + +void +SwapLbxConnSetupPrefix(csp) + xLbxConnSetupPrefix *csp; +{ + char n; + + swaps(&csp->majorVersion, n); + swaps(&csp->minorVersion, n); + swapl(&csp->tag, n); +} + +void +SwapAllocColor(r) + xLbxAllocColorReq *r; +{ + char n; + + swapl(&r->cmap, n); + swapl(&r->pixel, n); + swaps(&r->red, n); + swaps(&r->green, n); + swaps(&r->blue, n); +} + + +void +SwapGrabCmap(r) + xLbxGrabCmapReq *r; +{ + char n; + + swapl(&r->cmap, n); +} + +void +SwapReleaseCmap(r) + xLbxReleaseCmapReq *r; +{ + char n; + + swapl(&r->cmap, n); +} + diff --git a/app/lbxproxy/di/tables.c b/app/lbxproxy/di/tables.c new file mode 100644 index 000000000..4774d6067 --- /dev/null +++ b/app/lbxproxy/di/tables.c @@ -0,0 +1,593 @@ +/* $Xorg: tables.c,v 1.3 2000/08/17 19:53:56 cpqbld Exp $ */ +/* + * Copyright 1992 Network Computing Devices + * + * Permission to use, copy, modify, distribute, and sell this software and its + * documentation for any purpose is hereby granted without fee, provided that + * the above copyright notice appear in all copies and that both that + * copyright notice and this permission notice appear in supporting + * documentation, and that the name of NCD. not be used in advertising or + * publicity pertaining to distribution of the software without specific, + * written prior permission. NCD. makes no representations about the + * suitability of this software for any purpose. It is provided "as is" + * without express or implied warranty. + * + * NCD. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL NCD. + * BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION + * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN + * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + * + */ + +extern int ProcInitialConnection(), ProcEstablishConnection(); + +extern int ProcStandardRequest(); + +extern int ProcLBXChangeWindowAttributes(), + ProcLBXGetWindowAttributes(), + ProcLBXGetGeometry(), + ProcLBXInternAtom(), + ProcLBXGetAtomName(), + ProcLBXCreateColormap(), + ProcLBXFreeColormap(), + ProcLBXCopyColormapAndFree(), + ProcLBXFreeColors(), + ProcLBXLookupColor(), + ProcLBXAllocColor(), + ProcLBXAllocNamedColor(), + ProcLBXAllocColorCells(), + ProcLBXAllocColorPlanes(), + ProcLBXGetModifierMapping(), + ProcLBXGetKeyboardMapping(), + ProcLBXQueryFont(), + ProcLBXChangeProperty(), + ProcLBXGetProperty(), + ProcLBXCopyArea(), + ProcLBXCopyPlane(), + ProcLBXPolyPoint(), + ProcLBXPolyLine(), + ProcLBXPolySegment(), + ProcLBXPolyRectangle(), + ProcLBXPolyArc(), + ProcLBXFillPoly(), + ProcLBXPolyFillRectangle(), + ProcLBXPolyFillArc(), + ProcLBXPolyText(), + ProcLBXImageText(), + ProcLBXQueryExtension(), + ProcLBXGetImage(), + ProcLBXPutImage(); + +extern int ProcBadRequest(); + +int (*InitialVector[3]) () = +{ + 0, + ProcInitialConnection, + ProcEstablishConnection +}; + +int (*ProcVector[256]) () = +{ + ProcBadRequest, + ProcStandardRequest, + ProcLBXChangeWindowAttributes, + ProcLBXGetWindowAttributes, + ProcStandardRequest, + ProcStandardRequest, /* 5 */ + ProcStandardRequest, + ProcStandardRequest, + ProcStandardRequest, + ProcStandardRequest, + ProcStandardRequest, /* 10 */ + ProcStandardRequest, + ProcStandardRequest, + ProcStandardRequest, + ProcLBXGetGeometry, + ProcStandardRequest, /* 15 */ + ProcLBXInternAtom, + ProcLBXGetAtomName, + ProcLBXChangeProperty, + ProcStandardRequest, + ProcLBXGetProperty, /* 20 */ + ProcStandardRequest, + ProcStandardRequest, + ProcStandardRequest, + ProcStandardRequest, + ProcStandardRequest, /* 25 */ + ProcStandardRequest, + ProcStandardRequest, + ProcStandardRequest, + ProcStandardRequest, + ProcStandardRequest, /* 30 */ + ProcStandardRequest, + ProcStandardRequest, + ProcStandardRequest, + ProcStandardRequest, + ProcStandardRequest, /* 35 */ + ProcStandardRequest, + ProcStandardRequest, + ProcStandardRequest, + ProcStandardRequest, + ProcStandardRequest, /* 40 */ + ProcStandardRequest, + ProcStandardRequest, + ProcStandardRequest, + ProcStandardRequest, + ProcStandardRequest, /* 45 */ + ProcStandardRequest, + ProcLBXQueryFont, + ProcStandardRequest, + ProcStandardRequest, + ProcStandardRequest, /* 50 */ + ProcStandardRequest, + ProcStandardRequest, + ProcStandardRequest, + ProcStandardRequest, + ProcStandardRequest, /* 55 */ + ProcStandardRequest, + ProcStandardRequest, + ProcStandardRequest, + ProcStandardRequest, + ProcStandardRequest, /* 60 */ + ProcStandardRequest, + ProcLBXCopyArea, + ProcLBXCopyPlane, + ProcLBXPolyPoint, + ProcLBXPolyLine, /* 65 */ + ProcLBXPolySegment, + ProcLBXPolyRectangle, + ProcLBXPolyArc, + ProcLBXFillPoly, + ProcLBXPolyFillRectangle, /* 70 */ + ProcLBXPolyFillArc, + ProcLBXPutImage, + ProcLBXGetImage, + ProcLBXPolyText, + ProcLBXPolyText, /* 75 */ + ProcLBXImageText, + ProcLBXImageText, + ProcLBXCreateColormap, + ProcLBXFreeColormap, + ProcLBXCopyColormapAndFree, /* 80 */ + ProcStandardRequest, + ProcStandardRequest, + ProcStandardRequest, + ProcLBXAllocColor, + ProcLBXAllocNamedColor, /* 85 */ + ProcLBXAllocColorCells, + ProcLBXAllocColorPlanes, + ProcLBXFreeColors, + ProcStandardRequest, + ProcStandardRequest, /* 90 */ + ProcStandardRequest, + ProcLBXLookupColor, + ProcStandardRequest, + ProcStandardRequest, + ProcStandardRequest, /* 95 */ + ProcStandardRequest, + ProcStandardRequest, + ProcLBXQueryExtension, + ProcStandardRequest, + ProcStandardRequest, /* 100 */ + ProcLBXGetKeyboardMapping, + ProcStandardRequest, + ProcStandardRequest, + ProcStandardRequest, + ProcStandardRequest, /* 105 */ + ProcStandardRequest, + ProcStandardRequest, + ProcStandardRequest, + ProcStandardRequest, + ProcStandardRequest, /* 110 */ + ProcStandardRequest, + ProcStandardRequest, + ProcStandardRequest, + ProcStandardRequest, + ProcStandardRequest, /* 115 */ + ProcStandardRequest, + ProcStandardRequest, + ProcStandardRequest, + ProcLBXGetModifierMapping, + 0, /* 120 */ + 0, + 0, + 0, + 0, + 0, /* 125 */ + 0, + ProcStandardRequest, + ProcStandardRequest, + ProcStandardRequest, + ProcStandardRequest, + ProcStandardRequest, + ProcStandardRequest, + ProcStandardRequest, + ProcStandardRequest, + ProcStandardRequest, + ProcStandardRequest, + ProcStandardRequest, + ProcStandardRequest, + ProcStandardRequest, + ProcStandardRequest, + ProcStandardRequest, + ProcStandardRequest, + ProcStandardRequest, + ProcStandardRequest, + ProcStandardRequest, + ProcStandardRequest, + ProcStandardRequest, + ProcStandardRequest, + ProcStandardRequest, + ProcStandardRequest, + ProcStandardRequest, + ProcStandardRequest, + ProcStandardRequest, + ProcStandardRequest, + ProcStandardRequest, + ProcStandardRequest, + ProcStandardRequest, + ProcStandardRequest, + ProcStandardRequest, + ProcStandardRequest, + ProcStandardRequest, + ProcStandardRequest, + ProcStandardRequest, + ProcStandardRequest, + ProcStandardRequest, + ProcStandardRequest, + ProcStandardRequest, + ProcStandardRequest, + ProcStandardRequest, + ProcStandardRequest, + ProcStandardRequest, + ProcStandardRequest, + ProcStandardRequest, + ProcStandardRequest, + ProcStandardRequest, + ProcStandardRequest, + ProcStandardRequest, + ProcStandardRequest, + ProcStandardRequest, + ProcStandardRequest, + ProcStandardRequest, + ProcStandardRequest, + ProcStandardRequest, + ProcStandardRequest, + ProcStandardRequest, + ProcStandardRequest, + ProcStandardRequest, + ProcStandardRequest, + ProcStandardRequest, + ProcStandardRequest, + ProcStandardRequest, + ProcStandardRequest, + ProcStandardRequest, + ProcStandardRequest, + ProcStandardRequest, + ProcStandardRequest, + ProcStandardRequest, + ProcStandardRequest, + ProcStandardRequest, + ProcStandardRequest, + ProcStandardRequest, + ProcStandardRequest, + ProcStandardRequest, + ProcStandardRequest, + ProcStandardRequest, + ProcStandardRequest, + ProcStandardRequest, + ProcStandardRequest, + ProcStandardRequest, + ProcStandardRequest, + ProcStandardRequest, + ProcStandardRequest, + ProcStandardRequest, + ProcStandardRequest, + ProcStandardRequest, + ProcStandardRequest, + ProcStandardRequest, + ProcStandardRequest, + ProcStandardRequest, + ProcStandardRequest, + ProcStandardRequest, + ProcStandardRequest, + ProcStandardRequest, + ProcStandardRequest, + ProcStandardRequest, + ProcStandardRequest, + ProcStandardRequest, + ProcStandardRequest, + ProcStandardRequest, + ProcStandardRequest, + ProcStandardRequest, + ProcStandardRequest, + ProcStandardRequest, + ProcStandardRequest, + ProcStandardRequest, + ProcStandardRequest, + ProcStandardRequest, + ProcStandardRequest, + ProcStandardRequest, + ProcStandardRequest, + ProcStandardRequest, + ProcStandardRequest, + ProcStandardRequest, + ProcStandardRequest, + ProcStandardRequest, + ProcStandardRequest, + ProcStandardRequest, + ProcStandardRequest, + ProcStandardRequest, + ProcStandardRequest, + ProcStandardRequest, + ProcStandardRequest, + ProcStandardRequest, + ProcStandardRequest, + ProcStandardRequest, +}; + + +extern int ServerProcError(), ServerProcReply(), + ServerProcStandardEvent(); + +int (*ServerVector[256]) () = { + ServerProcStandardEvent, + ServerProcStandardEvent, + ServerProcStandardEvent, + ServerProcStandardEvent, + ServerProcStandardEvent, + ServerProcStandardEvent, + ServerProcStandardEvent, + ServerProcStandardEvent, + ServerProcStandardEvent, + ServerProcStandardEvent, + ServerProcStandardEvent, + ServerProcStandardEvent, + ServerProcStandardEvent, + ServerProcStandardEvent, + ServerProcStandardEvent, + ServerProcStandardEvent, + ServerProcStandardEvent, + ServerProcStandardEvent, + ServerProcStandardEvent, + ServerProcStandardEvent, + ServerProcStandardEvent, + ServerProcStandardEvent, + ServerProcStandardEvent, + ServerProcStandardEvent, + ServerProcStandardEvent, + ServerProcStandardEvent, + ServerProcStandardEvent, + ServerProcStandardEvent, + ServerProcStandardEvent, + ServerProcStandardEvent, + ServerProcStandardEvent, + ServerProcStandardEvent, + ServerProcStandardEvent, + ServerProcStandardEvent, + ServerProcStandardEvent, + ServerProcStandardEvent, + ServerProcStandardEvent, + ServerProcStandardEvent, + ServerProcStandardEvent, + ServerProcStandardEvent, + ServerProcStandardEvent, + ServerProcStandardEvent, + ServerProcStandardEvent, + ServerProcStandardEvent, + ServerProcStandardEvent, + ServerProcStandardEvent, + ServerProcStandardEvent, + ServerProcStandardEvent, + ServerProcStandardEvent, + ServerProcStandardEvent, + ServerProcStandardEvent, + ServerProcStandardEvent, + ServerProcStandardEvent, + ServerProcStandardEvent, + ServerProcStandardEvent, + ServerProcStandardEvent, + ServerProcStandardEvent, + ServerProcStandardEvent, + ServerProcStandardEvent, + ServerProcStandardEvent, + ServerProcStandardEvent, + ServerProcStandardEvent, + ServerProcStandardEvent, + ServerProcStandardEvent, + ServerProcStandardEvent, + ServerProcStandardEvent, + ServerProcStandardEvent, + ServerProcStandardEvent, + ServerProcStandardEvent, + ServerProcStandardEvent, + ServerProcStandardEvent, + ServerProcStandardEvent, + ServerProcStandardEvent, + ServerProcStandardEvent, + ServerProcStandardEvent, + ServerProcStandardEvent, + ServerProcStandardEvent, + ServerProcStandardEvent, + ServerProcStandardEvent, + ServerProcStandardEvent, + ServerProcStandardEvent, + ServerProcStandardEvent, + ServerProcStandardEvent, + ServerProcStandardEvent, + ServerProcStandardEvent, + ServerProcStandardEvent, + ServerProcStandardEvent, + ServerProcStandardEvent, + ServerProcStandardEvent, + ServerProcStandardEvent, + ServerProcStandardEvent, + ServerProcStandardEvent, + ServerProcStandardEvent, + ServerProcStandardEvent, + ServerProcStandardEvent, + ServerProcStandardEvent, + ServerProcStandardEvent, + ServerProcStandardEvent, + ServerProcStandardEvent, + ServerProcStandardEvent, + ServerProcStandardEvent, + ServerProcStandardEvent, + ServerProcStandardEvent, + ServerProcStandardEvent, + ServerProcStandardEvent, + ServerProcStandardEvent, + ServerProcStandardEvent, + ServerProcStandardEvent, + ServerProcStandardEvent, + ServerProcStandardEvent, + ServerProcStandardEvent, + ServerProcStandardEvent, + ServerProcStandardEvent, + ServerProcStandardEvent, + ServerProcStandardEvent, + ServerProcStandardEvent, + ServerProcStandardEvent, + ServerProcStandardEvent, + ServerProcStandardEvent, + ServerProcStandardEvent, + ServerProcStandardEvent, + ServerProcStandardEvent, + ServerProcStandardEvent, + ServerProcStandardEvent, + ServerProcStandardEvent, + ServerProcStandardEvent, + ServerProcStandardEvent, + ServerProcStandardEvent, + ServerProcStandardEvent, + ServerProcStandardEvent, + ServerProcStandardEvent, + ServerProcStandardEvent, + ServerProcStandardEvent, + ServerProcStandardEvent, + ServerProcStandardEvent, + ServerProcStandardEvent, + ServerProcStandardEvent, + ServerProcStandardEvent, + ServerProcStandardEvent, + ServerProcStandardEvent, + ServerProcStandardEvent, + ServerProcStandardEvent, + ServerProcStandardEvent, + ServerProcStandardEvent, + ServerProcStandardEvent, + ServerProcStandardEvent, + ServerProcStandardEvent, + ServerProcStandardEvent, + ServerProcStandardEvent, + ServerProcStandardEvent, + ServerProcStandardEvent, + ServerProcStandardEvent, + ServerProcStandardEvent, + ServerProcStandardEvent, + ServerProcStandardEvent, + ServerProcStandardEvent, + ServerProcStandardEvent, + ServerProcStandardEvent, + ServerProcStandardEvent, + ServerProcStandardEvent, + ServerProcStandardEvent, + ServerProcStandardEvent, + ServerProcStandardEvent, + ServerProcStandardEvent, + ServerProcStandardEvent, + ServerProcStandardEvent, + ServerProcStandardEvent, + ServerProcStandardEvent, + ServerProcStandardEvent, + ServerProcStandardEvent, + ServerProcStandardEvent, + ServerProcStandardEvent, + ServerProcStandardEvent, + ServerProcStandardEvent, + ServerProcStandardEvent, + ServerProcStandardEvent, + ServerProcStandardEvent, + ServerProcStandardEvent, + ServerProcStandardEvent, + ServerProcStandardEvent, + ServerProcStandardEvent, + ServerProcStandardEvent, + ServerProcStandardEvent, + ServerProcStandardEvent, + ServerProcStandardEvent, + ServerProcStandardEvent, + ServerProcStandardEvent, + ServerProcStandardEvent, + ServerProcStandardEvent, + ServerProcStandardEvent, + ServerProcStandardEvent, + ServerProcStandardEvent, + ServerProcStandardEvent, + ServerProcStandardEvent, + ServerProcStandardEvent, + ServerProcStandardEvent, + ServerProcStandardEvent, + ServerProcStandardEvent, + ServerProcStandardEvent, + ServerProcStandardEvent, + ServerProcStandardEvent, + ServerProcStandardEvent, + ServerProcStandardEvent, + ServerProcStandardEvent, + ServerProcStandardEvent, + ServerProcStandardEvent, + ServerProcStandardEvent, + ServerProcStandardEvent, + ServerProcStandardEvent, + ServerProcStandardEvent, + ServerProcStandardEvent, + ServerProcStandardEvent, + ServerProcStandardEvent, + ServerProcStandardEvent, + ServerProcStandardEvent, + ServerProcStandardEvent, + ServerProcStandardEvent, + ServerProcStandardEvent, + ServerProcStandardEvent, + ServerProcStandardEvent, + ServerProcStandardEvent, + ServerProcStandardEvent, + ServerProcStandardEvent, + ServerProcStandardEvent, + ServerProcStandardEvent, + ServerProcStandardEvent, + ServerProcStandardEvent, + ServerProcStandardEvent, + ServerProcStandardEvent, + ServerProcStandardEvent, + ServerProcStandardEvent, + ServerProcStandardEvent, + ServerProcStandardEvent, + ServerProcStandardEvent, + ServerProcStandardEvent, + ServerProcStandardEvent, + ServerProcStandardEvent, + ServerProcStandardEvent, + ServerProcStandardEvent, + ServerProcStandardEvent, + ServerProcStandardEvent, + ServerProcStandardEvent, + ServerProcStandardEvent, + ServerProcStandardEvent, + ServerProcStandardEvent, + ServerProcStandardEvent, + ServerProcStandardEvent, + ServerProcStandardEvent, + ServerProcStandardEvent, + ServerProcStandardEvent, + ServerProcStandardEvent, + ServerProcStandardEvent, + ServerProcStandardEvent, + ServerProcStandardEvent, + ServerProcStandardEvent, + ServerProcStandardEvent, +}; diff --git a/app/lbxproxy/di/tags.c b/app/lbxproxy/di/tags.c new file mode 100644 index 000000000..0e800f259 --- /dev/null +++ b/app/lbxproxy/di/tags.c @@ -0,0 +1,192 @@ +/* $Xorg: tags.c,v 1.4 2001/02/09 02:05:32 xorgcvs Exp $ */ +/* + +Copyright 1998 The Open Group + +Permission to use, copy, modify, distribute, and sell this software and its +documentation for any purpose is hereby granted without fee, provided that +the above copyright notice appear in all copies and that both that +copyright notice and this permission notice appear in supporting +documentation. + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the name of The Open Group shall not be +used in advertising or otherwise to promote the sale, use or other dealings +in this Software without prior written authorization from The Open Group. + +*/ +/* + * Copyright 1993 Network Computing Devices, Inc. + * + * Permission to use, copy, modify, distribute, and sell this software and + * its documentation for any purpose is hereby granted without fee, provided + * that the above copyright notice appear in all copies and that both that + * copyright notice and this permission notice appear in supporting + * documentation, and that the name Network Computing Devices, Inc. not be + * used in advertising or publicity pertaining to distribution of this + * software without specific, written prior permission. + * + * THIS SOFTWARE IS PROVIDED `AS-IS'. NETWORK COMPUTING DEVICES, INC., + * DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING WITHOUT + * LIMITATION ALL IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A + * PARTICULAR PURPOSE, OR NONINFRINGEMENT. IN NO EVENT SHALL NETWORK + * COMPUTING DEVICES, INC., BE LIABLE FOR ANY DAMAGES WHATSOEVER, INCLUDING + * SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES, INCLUDING LOSS OF USE, DATA, + * OR PROFITS, EVEN IF ADVISED OF THE POSSIBILITY THEREOF, AND REGARDLESS OF + * WHETHER IN AN ACTION IN CONTRACT, TORT OR NEGLIGENCE, ARISING OUT OF OR IN + * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + * + */ + +#include "misc.h" +#include "util.h" +#include "cache.h" +#include "tags.h" +#include "assert.h" +#include "wire.h" +#include "proxyopts.h" + +int lbxTagCacheSize = 1 << 20; + +void +TagsInit(server, useTags) + XServerPtr server; + Bool useTags; +{ + if (!useTags) { + lbxTagCacheSize = 0; + } + server->global_cache = CacheInit(server, lbxTagCacheSize); + server->prop_cache = CacheInit(server, lbxTagCacheSize); +} + +void +FreeTags() +{ + int i; + + for (i=0; i < lbxMaxServers; i++) { + if (servers[i] && servers[i]->caches[servers[i]->global_cache]) + CacheFreeCache(servers[i], servers[i]->global_cache); + if (servers[i] && servers[i]->caches[servers[i]->prop_cache]) + CacheFreeCache(servers[i], servers[i]->prop_cache); + } +} + +/* ARGSUSED */ +static void +cache_free(id, client, data, reason) + CacheID id; + ClientPtr client; + pointer data; + int reason; +{ + TagData tag = (TagData) data; + + /* tell server we toasted this one */ + if (reason != CacheEntryFreed) + SendInvalidateTag(client, tag->tid); + xfree(tag->tdata); + xfree(data); +} + +Bool +TagStoreData(server, cache, id, size, dtype, data) + XServerPtr server; + Cache cache; + CacheID id; + int size; + int dtype; + pointer data; +{ + pointer tdata; + + tdata = (pointer) xalloc(size); + if (!tdata) + return FALSE; + memcpy((char *) tdata, (char *) data, size); + return TagStoreDataNC(server, cache, id, size, dtype, tdata); +} + +Bool +TagStoreDataNC(server, cache, id, size, dtype, data) + XServerPtr server; + Cache cache; + CacheID id; + int size; + int dtype; + pointer data; +{ + TagData tag; + Bool ret; + + assert(server->lbxNegOpt.useTags); + + tag = (TagData) xalloc(sizeof(TagDataRec)); + if (!tag) + return FALSE; + tag->tdata = data; + tag->tid = id; + tag->data_type = dtype; + tag->size = size; + + ret = CacheStoreMemory(server, cache, id, (pointer) tag, size, cache_free, + !AnyTagBearingReplies(server, cache)); + if (!ret) { + xfree(tag->tdata); + xfree(tag); + } + return ret; +} + +TagData +TagGetTag(server, cache, id) + XServerPtr server; + Cache cache; + CacheID id; +{ + TagData tag; + + assert(server->lbxNegOpt.useTags); + + tag = (TagData) CacheFetchMemory(server, cache, id, TRUE); + return tag; +} + +pointer +TagGetData(server, cache, id) + XServerPtr server; + Cache cache; + CacheID id; +{ + TagData tag; + + assert(server->lbxNegOpt.useTags); + + tag = (TagData) CacheFetchMemory(server, cache, id, TRUE); + if (tag) + return tag->tdata; + else + return (pointer) NULL; +} + +void +TagFreeData(server, cache, id, notify) + XServerPtr server; + Cache cache; + CacheID id; + Bool notify; +{ + assert(server->lbxNegOpt.useTags); + + CacheFreeMemory(server, cache, id, notify); +} diff --git a/app/lbxproxy/di/unsquish.c b/app/lbxproxy/di/unsquish.c new file mode 100644 index 000000000..9bf294ed0 --- /dev/null +++ b/app/lbxproxy/di/unsquish.c @@ -0,0 +1,123 @@ +/* $Xorg: unsquish.c,v 1.4 2001/02/09 02:05:32 xorgcvs Exp $ */ +/* + +Copyright 1987, 1998 The Open Group + +Permission to use, copy, modify, distribute, and sell this software and its +documentation for any purpose is hereby granted without fee, provided that +the above copyright notice appear in all copies and that both that +copyright notice and this permission notice appear in supporting +documentation. + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the name of The Open Group shall not be +used in advertising or otherwise to promote the sale, use or other dealings +in this Software without prior written authorization from The Open Group. + +*/ +/* + * Copyright 1994 Network Computing Devices, Inc. + * + * Permission to use, copy, modify, distribute, and sell this software and + * its documentation for any purpose is hereby granted without fee, provided + * that the above copyright notice appear in all copies and that both that + * copyright notice and this permission notice appear in supporting + * documentation, and that the name Network Computing Devices, Inc. not be + * used in advertising or publicity pertaining to distribution of this + * software without specific, written prior permission. + * + * THIS SOFTWARE IS PROVIDED `AS-IS'. NETWORK COMPUTING DEVICES, INC., + * DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING WITHOUT + * LIMITATION ALL IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A + * PARTICULAR PURPOSE, OR NONINFRINGEMENT. IN NO EVENT SHALL NETWORK + * COMPUTING DEVICES, INC., BE LIABLE FOR ANY DAMAGES WHATSOEVER, INCLUDING + * SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES, INCLUDING LOSS OF USE, DATA, + * OR PROFITS, EVEN IF ADVISED OF THE POSSIBILITY THEREOF, AND REGARDLESS OF + * WHETHER IN AN ACTION IN CONTRACT, TORT OR NEGLIGENCE, ARISING OUT OF OR IN + * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + * + */ + +/* handles unsquishing events */ + +#include +#define NEED_REPLIES +#define NEED_EVENTS +#include +#include "misc.h" +#define _XLBX_SERVER_ +#include +#include "proxyopts.h" + +#include + +static char lbxevsize[] = { + sz_xError, + sz_xReply, + lbxsz_KeyButtonEvent, + lbxsz_KeyButtonEvent, + lbxsz_KeyButtonEvent, + lbxsz_KeyButtonEvent, + lbxsz_KeyButtonEvent, + lbxsz_EnterLeaveEvent, + lbxsz_EnterLeaveEvent, + lbxsz_FocusEvent, + lbxsz_FocusEvent, + lbxsz_KeymapEvent, + lbxsz_ExposeEvent, + lbxsz_GfxExposeEvent, + lbxsz_NoExposeEvent, + lbxsz_VisibilityEvent, + lbxsz_CreateNotifyEvent, + lbxsz_DestroyNotifyEvent, + lbxsz_UnmapNotifyEvent, + lbxsz_MapNotifyEvent, + lbxsz_MapRequestEvent, + lbxsz_ReparentEvent, + lbxsz_ConfigureNotifyEvent, + lbxsz_ConfigureRequestEvent, + lbxsz_GravityEvent, + lbxsz_ResizeRequestEvent, + lbxsz_CirculateEvent, + lbxsz_CirculateEvent, + lbxsz_PropertyEvent, + lbxsz_SelectionClearEvent, + lbxsz_SelectionRequestEvent, + lbxsz_SelectionNotifyEvent, + lbxsz_ColormapEvent, + lbxsz_ClientMessageEvent, + lbxsz_MappingNotifyEvent +}; + +int +EventLength(ev, squish) + xEvent *ev; + Bool squish; +{ + if (!squish || ev->u.u.type >= LASTEvent) + return sz_xEvent; + return lbxevsize[ev->u.u.type]; +} + +Bool +UnsquishEvent(rep, ev, lenp) + xReply *rep; + xEvent *ev; + int *lenp; +{ + if (*lenp < sz_xEvent) { + memcpy((char *)ev, (char *)rep, *lenp); + *lenp = sz_xEvent; + return TRUE; + } + return FALSE; +} diff --git a/app/lbxproxy/di/utils.c b/app/lbxproxy/di/utils.c new file mode 100644 index 000000000..60de7921e --- /dev/null +++ b/app/lbxproxy/di/utils.c @@ -0,0 +1,1008 @@ +/* $Xorg: utils.c,v 1.5 2001/02/09 02:05:32 xorgcvs Exp $ */ +/* $XdotOrg: $ */ +/*********************************************************** + +Copyright 1987, 1996, 1998 The Open Group + +Permission to use, copy, modify, distribute, and sell this software and its +documentation for any purpose is hereby granted without fee, provided that +the above copyright notice appear in all copies and that both that +copyright notice and this permission notice appear in supporting +documentation. + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the name of The Open Group shall not be +used in advertising or otherwise to promote the sale, use or other dealings +in this Software without prior written authorization from The Open Group. + + +Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. + + All Rights Reserved + +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, +provided that the above copyright notice appear in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the name of Digital not be +used in advertising or publicity pertaining to distribution of the +software without specific, written prior permission. + +DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING +ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL +DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR +ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, +ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS +SOFTWARE. + +******************************************************************/ +/* $XFree86: xc/programs/lbxproxy/di/utils.c,v 1.17 2003/09/13 21:33:10 dawes Exp $ */ + +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif + +#include "lbx.h" +#include +#include /* getenv(), {m,re}alloc() */ +#ifdef X_POSIX_C_SOURCE +#define _POSIX_C_SOURCE X_POSIX_C_SOURCE +#include +#undef _POSIX_C_SOURCE +#else +#if defined(X_NOT_POSIX) || defined(_POSIX_SOURCE) +#include +#else +#define _POSIX_SOURCE +#include +#undef _POSIX_SOURCE +#endif +#endif +#if !defined(SYSV) && !defined(Lynx) && !defined(QNX4) +#include +#endif + +#include + +static void VErrorF(const char*, va_list); + +#ifdef RETSIGTYPE /* autoconf AC_TYPE_SIGNAL */ +# define SIGVAL RETSIGTYPE +#else /* Imake */ +#ifdef SIGNALRETURNSINT +#define SIGVAL int +#else +#define SIGVAL void +#endif +#endif /* RETSIGTYPE */ + +#include "util.h" +#include "wire.h" +#include "atomcache.h" +#include "proxyopts.h" + +#include + +/* + * External declarations not in header files + */ +extern Bool PartialNetwork; +extern int lbxDebug; + +extern char protocolMode; +extern Bool reconnectAfterCloseServer; +extern Bool resetAfterLastClient; +extern Bool terminateAfterLastClient; +extern int lbxTagCacheSize; +extern Bool lbxUseLbx; +extern Bool lbxUseTags; +extern Bool lbxDoSquishing; +extern Bool lbxCompressImages; +extern Bool lbxDoAtomShortCircuiting; +extern Bool lbxDoLbxGfx; +extern Bool compStats; + +/* + * Static vars + */ +static Bool CoreDump; +static Bool Must_have_memory = FALSE; + +/* + * Debug stuff + */ +#ifdef DEBUG +#ifndef SPECIAL_MALLOC +#define MEMBUG +#endif +#endif + +#ifdef MEMBUG +#define MEM_FAIL_SCALE 100000 +long Memory_fail = 0; +#endif + +/* + * Global vars that may get set when the command line opts are parsed. + */ +#ifdef RGB_DB +char *rgbPath = RGB_DB; +#else +char *rgbPath; +#endif + +Bool lbxZeroPad = TRUE; /* zero out pad bytes in X requests */ + +char *atomsFile = DEF_ATOMS_FILE; + +Bool lbxWinAttr = TRUE; /* group GetWindowAttributes/GetGeometry into 1 trip */ + +Bool lbxDoCmapGrabbing = TRUE; /* do colormap grabbing? */ + +int lbxMaxMotionEvents = NUM_MOTION_EVENTS; /* max # motion events */ + +int min_keep_prop_size = DEF_KEEP_PROP_SIZE; + +/* + * zlevel = 1..9, 9 == max compression. 6 == good tradeoff between + * compression and speed. Try gzipping a large file at the default + * level (which is 6) and at max compression (9) and notice the + * difference in time it takes to compress the file and the difference + * in file size. level 9 compression takes ~50 more (time, cpu) but + * only yields a very small improvement in compression. + */ +int zlevel = 6; + + +/* + * The functions + */ +OsSigHandlerPtr +OsSignal(sig, handler) + int sig; + OsSigHandlerPtr handler; +{ +#ifdef X_NOT_POSIX + return signal(sig, handler); +#else + struct sigaction act, oact; + + sigemptyset(&act.sa_mask); + if (handler != SIG_IGN) + sigaddset(&act.sa_mask, sig); + act.sa_flags = 0; + act.sa_handler = handler; + sigaction(sig, &act, &oact); + return oact.sa_handler; +#endif +} + +/* Force connections to close on SIGHUP from init */ + +/* ARGSUSED */ +SIGVAL +AutoResetServer (sig) + int sig; +{ + dispatchException |= DE_RESET; + isItTimeToYield = TRUE; +#ifdef GPROF + chdir ("/tmp"); + _exit (0); +#endif +#ifdef SYSV + signal (SIGHUP, AutoResetServer); +#endif +} + +/* Force connections to close and then exit on SIGTERM, SIGINT */ + +/* ARGSUSED */ +SIGVAL +GiveUp(sig) + int sig; +{ + dispatchException |= DE_TERMINATE; + isItTimeToYield = TRUE; +} + +static void +AbortServer() +{ + fflush(stderr); + if (CoreDump) + abort(); + exit (1); +} + +void +Error(str) + char *str; +{ + perror(str); +} + +void UseMsg() +{ + ErrorF("use: lbxproxy [:] [option]\n"); +#ifdef MEMBUG + ErrorF("-alloc int chance alloc should fail\n"); +#endif + ErrorF("-help prints message with these options\n"); + ErrorF("-display specify address of LBX server\n"); + ErrorF("-motion # allow # motion events in flight\n"); + ErrorF("-[terminate|reset] terminate or reset after last client exits\n"); + ErrorF(" (default is continue running)\n"); + ErrorF("-I ignore all remaining arguments\n"); + ErrorF("-reconnect reset if server connection is broken\n"); + ErrorF(" (default is to exit if connection is broken)\n"); + ErrorF("-nolbx disable LBX reencoding of X requests\n"); + ErrorF("-nocomp disable stream compression\n"); + ErrorF("-nodelta disable request deltas\n"); + ErrorF("-notags disable tags\n"); + ErrorF("-nogfx disable graphics enhancements\n"); + ErrorF("-noimage disable image compression\n"); + ErrorF("-nosquish disable event squishing\n"); + ErrorF("-nointernsc disable InternAtom short circuiting\n"); + ErrorF("-noatomsfile disable atom control file\n"); + ErrorF("-atomsfile override AtomControl file\n"); + ErrorF("-nowinattr disable GetWindowAttributes/GetGeometry\n"); + ErrorF(" grouping into one round trip\n"); + ErrorF("-nograbcmap disable colormap grabbing\n"); + ErrorF("-norgbfile disables color name to RGB resolution\n"); + ErrorF("-rgbfile path specifies an alternate RGB database\n"); + ErrorF(" for color name to RGB resolution\n"); + ErrorF("-tagcachesize # set tag cache size\n"); + ErrorF("-maxservers # maximum number of servers to use\n"); + ErrorF(" default is 20, but this is overrided\n"); + ErrorF(" the following environment variable:\n"); + ErrorF(" LBXPROXY_MAXSERVERS=\n"); + ErrorF("-zlevel # zlib compression level (1-9)\n"); + ErrorF(" default is 9\n"); + ErrorF(" 1 = worst compression, fastest\n"); + ErrorF(" 9 = best compression, slowest\n"); + ErrorF("-compstats report stream compression statistics\n"); + ErrorF("-nozeropad don't zero out pad bytes in X requests\n"); + ErrorF("-cheaterrors cheat on X protocol errors for better performance\n"); + ErrorF("-cheatevents cheat on events and errors for better performance\n"); +} + +void +ShowHelpAndExit (status) + int status; +{ + UseMsg (); + exit (status); +} + +static int +proxyProcessArgument (argc, argv, i) + int argc; + char **argv; + int i; +{ + if (strcmp (argv[i], "-debug") == 0) + { + if (++i < argc) + lbxDebug = atoi(argv[i]); + else + ShowHelpAndExit (1); + return 2; + } + if (strcmp (argv[i], "-cheaterrors") == 0) + { + protocolMode = PROTOCOL_MOST; + return 1; + } + if (strcmp (argv[i], "-cheatevents") == 0) + { + protocolMode = PROTOCOL_POOR; + return 1; + } + if (strcmp (argv[i], "-nolbx") == 0) + { + lbxUseLbx = FALSE; + return 1; + } + if (strcmp (argv[i], "-nointernsc") == 0) + { + lbxDoAtomShortCircuiting = FALSE; + return 1; + } + if (strcmp (argv[i], "-nocomp") == 0) + { + LbxNoComp(); + return 1; + } + if (strcmp (argv[i], "-nodelta") == 0) + { + LbxNoDelta(); + return 1; + } + if (strcmp (argv[i], "-notags") == 0) + { + lbxUseTags = FALSE; + return 1; + } + if (strcmp (argv[i], "-nogfx") == 0) + { + lbxDoLbxGfx = FALSE; + return 1; + } + if (strcmp (argv[i], "-noimage") == 0) + { + lbxCompressImages = FALSE; + return 1; + } + if (strcmp (argv[i], "-nosquish") == 0) + { + lbxDoSquishing = FALSE; + return 1; + } + if (strcmp (argv[i], "-nograbcmap") == 0) + { + lbxDoCmapGrabbing = FALSE; + return 1; + } + if (strcmp (argv[i], "-reconnect") == 0) + { + reconnectAfterCloseServer = TRUE; + return 1; + } + if (strcmp (argv[i], "-norgbfile") == 0) + { + rgbPath = NULL; + return 1; + } + if (strcmp (argv[i], "-rgbfile") == 0) + { + if (++i < argc) + if (argv[i][0] == '-') + ShowHelpAndExit (1); + else + rgbPath = argv[i]; + else + ShowHelpAndExit (1); + return 2; + } + if (strcmp (argv[i], "-nowinattr") == 0) + { + lbxWinAttr = FALSE; + return 1; + } + if (strcmp (argv[i], "-noatomsfile") == 0) + { + atomsFile = NULL; + return 1; + } + if (strcmp (argv[i], "-atomsfile") == 0) + { + if (++i < argc) + { + if (argv[i][0] == '-') + ShowHelpAndExit (1); + else + atomsFile = argv[i]; + } + else + ShowHelpAndExit (1); + return 2; + } + if (strcmp (argv[i], "-tagcachesize") == 0) + { + if (++i < argc) + lbxTagCacheSize = atoi(argv[i]); + else + ShowHelpAndExit (1); + return 2; + } + if (strcmp (argv[i], "-maxservers") == 0) + { + if (++i < argc) + lbxMaxServers = atoi(argv[i]); + else + ShowHelpAndExit (1); + return 2; + } + if (strcmp (argv[i], "-motion") == 0) + { + if (++i < argc) + lbxMaxMotionEvents = atoi(argv[i]); + else + ShowHelpAndExit (1); + return 2; + } + if (strcmp (argv[i], "-zlevel") == 0) + { + if (++i < argc) + { + zlevel = atoi(argv[i]); + if (zlevel < 1 || zlevel > 9) + ShowHelpAndExit (1); + } + else + ShowHelpAndExit (1); + return 2; + } + if (strcmp (argv[i], "-compstats") == 0) + { + compStats = TRUE; + return 1; + } + if (strcmp (argv[i], "-nozeropad") == 0) + { + lbxZeroPad = FALSE; + return 1; + } + return 0; +} + +/* + * This function parses the command line. Handles device-independent fields + * and allows ddx to handle additional fields. It is not allowed to modify + * argc or any of the strings pointed to by argv. + */ +void +ProcessCommandLine ( argc, argv ) +int argc; +char *argv[]; + +{ + int i, skip; + char *env; + + /* + * Some options may also be defined by environment variables. + * However, if this is the case, the command line options will + * take precedence so check the environment first. + */ + if ((env = getenv ("LBXPROXY_MAXSERVERS"))) + lbxMaxServers = atoi (env); + + for ( i = 1; i < argc; i++ ) + { + /* do proxy-specific stuff first */ + if((skip = proxyProcessArgument(argc, argv, i))) + { + i += (skip - 1); + } + else if(argv[i][0] == ':') + { + /* initialize display */ + display = argv[i]; + display++; + } +#ifdef MEMBUG + else if ( strcmp( argv[i], "-alloc") == 0) + { + if(++i < argc) + Memory_fail = atoi(argv[i]); + else + ShowHelpAndExit (1); + } +#endif + else if ( strcmp( argv[i], "-display") == 0) + { + if(++i < argc) + display_name = argv[i]; + else + ShowHelpAndExit (1); + } + else if ( strcmp( argv[i], "-core") == 0) + CoreDump = TRUE; + else if ( strcmp( argv[i], "-help") == 0) + ShowHelpAndExit (0); + else if ( strcmp( argv[i], "-pn") == 0) + PartialNetwork = TRUE; + else if ( strcmp( argv[i], "-reset") == 0) + { + if (terminateAfterLastClient) + ShowHelpAndExit (1); + + resetAfterLastClient = TRUE; + } + else if ( strcmp( argv[i], "-terminate") == 0) + { + if (resetAfterLastClient) + ShowHelpAndExit (1); + + terminateAfterLastClient = TRUE; + } + else if ( strcmp( argv[i], "-I") == 0) + { + /* ignore all remaining arguments */ + break; + } + else if (strncmp (argv[i], "tty", 3) == 0) + { + /* Ignored */ + } + else + ShowHelpAndExit (1); + } +} + +/* XALLOC -- X's internal memory allocator. Why does it return unsigned + * int * instead of the more common char *? Well, if you read K&R you'll + * see they say that alloc must return a pointer "suitable for conversion" + * to whatever type you really want. In a full-blown generic allocator + * there's no way to solve the alignment problems without potentially + * wasting lots of space. But we have a more limited problem. We know + * we're only ever returning pointers to structures which will have to + * be long word aligned. So we are making a stronger guarantee. It might + * have made sense to make Xalloc return char * to conform with people's + * expectations of malloc, but this makes lint happier. + */ + +unsigned long * +Xalloc (amount) + unsigned long amount; +{ + register pointer ptr; + + if ((long)amount <= 0) + return (unsigned long *)NULL; + /* aligned extra on long word boundary */ + amount = (amount + 3) & ~3; +#ifdef MEMBUG + if (!Must_have_memory && Memory_fail && + ((random() % MEM_FAIL_SCALE) < Memory_fail)) + return (unsigned long *)NULL; +#endif + if ((ptr = (pointer)malloc(amount))) + return (unsigned long *)ptr; + if (Must_have_memory) + FatalError("Out of memory"); + return (unsigned long *)NULL; +} + +/***************** + * Xcalloc + *****************/ + +unsigned long * +Xcalloc (amount) + unsigned long amount; +{ + unsigned long *ret; + + ret = Xalloc (amount); + if (ret) + bzero ((char *) ret, (int) amount); + return ret; +} + +/***************** + * Xrealloc + *****************/ + +unsigned long * +Xrealloc (ptr, amount) + register pointer ptr; + unsigned long amount; +{ +#ifdef MEMBUG + if (!Must_have_memory && Memory_fail && + ((random() % MEM_FAIL_SCALE) < Memory_fail)) + return (unsigned long *)NULL; +#endif + if ((long)amount <= 0) + { + if (ptr && !amount) + free(ptr); + return (unsigned long *)NULL; + } + amount = (amount + 3) & ~3; + if (ptr) + ptr = (pointer)realloc((char *)ptr, amount); + else + ptr = (pointer)malloc(amount); + if (ptr) + return (unsigned long *)ptr; + if (Must_have_memory) + FatalError("Out of memory"); + return (unsigned long *)NULL; +} + +/***************** + * Xfree + * calls free + *****************/ + +void +Xfree(ptr) + register pointer ptr; +{ + if (ptr) + free((char *)ptr); +} + +void +OsInitAllocator () +{ +#ifdef MEMBUG + static int been_here; + + /* Check the memory system after each generation */ + if (been_here) + CheckMemory (); + else + been_here = 1; +#endif +} + +void +AuditF(const char * f, ...) +{ +#ifdef notyet /* ever ? */ + time_t tm; + char *autime, *s; + va_list args; + + if (*f != ' ') + { + time(&tm); + autime = ctime(&tm); + if (s = strchr(autime, '\n')) + *s = '\0'; + if (s = strrchr(argvGlobal[0], '/')) + s++; + else + s = argvGlobal[0]; + ErrorF("AUDIT: %s: %d %s: ", autime, getpid(), s); + } + va_start(args, f); + VErrorF(f, args); + va_end(args); +#endif +} + +void +FatalError(const char *f, ...) +{ + va_list args; + ErrorF("\nFatal lbxproxy error: "); + va_start(args, f); + VErrorF(f, args); + va_end(args); + ErrorF("\n"); + AbortServer(); + /*NOTREACHED*/ +} + +static void +VErrorF(const char *f, va_list args) +{ + vfprintf(stderr, f, args); +} + +void +ErrorF(const char * f, ...) +{ + va_list args; + va_start(args, f); + VErrorF(f, args); + va_end(args); +} + +char * +strnalloc(str, len) + char *str; + int len; +{ + char *t; + + t = (char *) Xalloc(len); + if (!t) + return (char *) 0; + memcpy(t, str, len); + return t; +} + +/* + * A general work queue. Perform some task before the server + * sleeps for input. + */ + +typedef struct _WorkQueue { + struct _WorkQueue *next; + Bool (*function) ( + ClientPtr /* pClient */, + pointer /* closure */ +); + ClientPtr client; + pointer closure; +} WorkQueueRec; + +WorkQueuePtr workQueue; +static WorkQueuePtr *workQueueLast = &workQueue; + +/* ARGSUSED */ +void +ProcessWorkQueue() +{ + WorkQueuePtr q, n, p; + + p = NULL; + /* + * Scan the work queue once, calling each function. Those + * which return TRUE are removed from the queue, otherwise + * they will be called again. This must be reentrant with + * QueueWorkProc, hence the crufty usage of variables. + */ + for (q = workQueue; q; q = n) + { + if ((*q->function) (q->client, q->closure)) + { + /* remove q from the list */ + n = q->next; /* don't fetch until after func called */ + if (p) + p->next = n; + else + workQueue = n; + xfree (q); + } + else + { + n = q->next; /* don't fetch until after func called */ + p = q; + } + } + if (p) + workQueueLast = &p->next; + else + { + workQueueLast = &workQueue; + } +} + +Bool +QueueWorkProc (function, client, closure) + Bool (*function)(); + ClientPtr client; + pointer closure; +{ + WorkQueuePtr q; + + q = (WorkQueuePtr) xalloc (sizeof *q); + if (!q) + return FALSE; + q->function = function; + q->client = client; + q->closure = closure; + q->next = NULL; + *workQueueLast = q; + workQueueLast = &q->next; + return TRUE; +} + +/* + * Manage a queue of sleeping clients, awakening them + * when requested, by using the OS functions IgnoreClient + * and AttendClient. Note that this *ignores* the troubles + * with request data interleaving itself with events, but + * we'll leave that until a later time. + */ + +typedef struct _SleepQueue { + struct _SleepQueue *next; + ClientPtr client; + Bool (*function)(); + pointer closure; +} SleepQueueRec, *SleepQueuePtr; + +static SleepQueuePtr sleepQueue = NULL; + +Bool +ClientSleep (client, function, closure) + ClientPtr client; + Bool (*function)(); + pointer closure; +{ + SleepQueuePtr q; + + q = (SleepQueuePtr) xalloc (sizeof *q); + if (!q) + return FALSE; + + IgnoreClient (client); + q->next = sleepQueue; + q->client = client; + q->function = function; + q->closure = closure; + sleepQueue = q; + return TRUE; +} + +Bool +ClientSignal (client) + ClientPtr client; +{ + SleepQueuePtr q; + + for (q = sleepQueue; q; q = q->next) + if (q->client == client) + { + return QueueWorkProc (q->function, q->client, q->closure); + } + return FALSE; +} + +void +ClientWakeup (client) + ClientPtr client; +{ + SleepQueuePtr q, *prev; + + prev = &sleepQueue; + while ((q = *prev)) + { + if (q->client == client) + { + *prev = q->next; + xfree (q); + if (!client->clientGone) + AttendClient (client); + break; + } + prev = &q->next; + } +} + +Bool +ClientIsAsleep (client) + ClientPtr client; +{ + SleepQueuePtr q; + + for (q = sleepQueue; q; q = q->next) + if (q->client == client) + return TRUE; + return FALSE; +} + +#ifdef __UNIXOS2__ +/* This code is duplicated from XLibInt.c, because the same problems with + * the drive letter as in clients also exist in the server + * Unfortunately the standalone servers don't link against libX11 + */ + +char *__XOS2RedirRoot(char *fname) +{ + /* This adds a further redirection by allowing the ProjectRoot + * to be prepended by the content of the envvar X11ROOT. + * This is for the purpose to move the whole X11 stuff to a different + * disk drive. + * The feature was added despite various environment variables + * because not all file opens respect them. + */ + static char redirname[300]; /* enough for long filenames */ + char *root; + + /* if name does not start with /, assume it is not root-based */ + if (fname==0 || !(fname[0]=='/' || fname[0]=='\\')) + return fname; + + root = (char*)getenv("X11ROOT"); + if (root==0 || + (fname[1]==':' && isalpha(fname[0]) || + (strlen(fname)+strlen(root)+2) > 300)) + return fname; + sprintf(redirname,"%s%s",root,fname); + return redirname; +} +#endif + + + + + +void +LBXReadAtomsFile (server) + XServerPtr server; +{ + FILE *f; + char buf[256], *p; + int len; + + if (!atomsFile) + return; + + while (server->atom_control_count) + xfree(server->atom_control[--server->atom_control_count].name); + xfree(server->atom_control); + server->atom_control = NULL; + min_keep_prop_size = DEF_KEEP_PROP_SIZE; + +#ifdef __UNIXOS2__ + atomsFile = (char*)__XOS2RedirRoot(atomsFile); +#endif + if (!(f = fopen (atomsFile, "r"))) { + ErrorF ("Could not load atom control file: %s\n", atomsFile); + return; + } + + while (fgets (buf, 256, f)) + if (*buf != '!' && *buf != 0 && *buf != '\n') + server->atom_control_count++; + + if (!server->atom_control_count) { + fclose(f); + return; + } + + server->atom_control = (AtomControlPtr) xalloc (server->atom_control_count * + sizeof(AtomControlRec)); + + server->atom_control_count = 0; + + if (!server->atom_control) { + fclose(f); + return; + } + + fseek (f, 0, 0); + + while (fgets (buf, 256, f)) + { + if (*buf == '!' || *buf == 0 || *buf == '\n') + continue; + + len = strlen(buf); + if (buf[len - 1] == '\n') + buf[--len] = 0; + p = buf; + if (*p == 'z') { + do { + p++; + } while (*p == ' ' || *p == '\t'); + min_keep_prop_size = atoi(p); + continue; + } + server->atom_control[server->atom_control_count].flags = 0; + while (*p && *p != ' ' && *p != '\t') { + switch (*p) { + case 'i': + server->atom_control[server->atom_control_count].flags + |= AtomPreInternFlag; + break; + case 'n': + server->atom_control[server->atom_control_count].flags + |= AtomNoCacheFlag; + break; + case 'w': + server->atom_control[server->atom_control_count].flags + |= AtomWMCacheFlag; + break; + default: + fprintf(stderr, "bad atom control: %c\n", *p); + break; + } + p++; + } + while (*p == ' ' || *p == '\t') + p++; + if (!*p) + continue; + len = strlen(p); + server->atom_control[server->atom_control_count].name = + (char *) xalloc(len + 1); + if (server->atom_control[server->atom_control_count].name) { + server->atom_control[server->atom_control_count].len = len; + strcpy(server->atom_control[server->atom_control_count].name, p); + server->atom_control_count++; + } + } + + fclose(f); +} diff --git a/app/lbxproxy/di/wire.c b/app/lbxproxy/di/wire.c new file mode 100644 index 000000000..6142d9253 --- /dev/null +++ b/app/lbxproxy/di/wire.c @@ -0,0 +1,1597 @@ +/* $Xorg: wire.c,v 1.4 2001/02/09 02:05:32 xorgcvs Exp $ */ +/* + +Copyright 1998 The Open Group + +Permission to use, copy, modify, distribute, and sell this software and its +documentation for any purpose is hereby granted without fee, provided that +the above copyright notice appear in all copies and that both that +copyright notice and this permission notice appear in supporting +documentation. + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the name of The Open Group shall not be +used in advertising or otherwise to promote the sale, use or other dealings +in this Software without prior written authorization from The Open Group. + +*/ +/* + * Copyright 1992 Network Computing Devices + * + * Permission to use, copy, modify, distribute, and sell this software and its + * documentation for any purpose is hereby granted without fee, provided that + * the above copyright notice appear in all copies and that both that + * copyright notice and this permission notice appear in supporting + * documentation, and that the name of NCD. not be used in advertising or + * publicity pertaining to distribution of the software without specific, + * written prior permission. NCD. makes no representations about the + * suitability of this software for any purpose. It is provided "as is" + * without express or implied warranty. + * + * NCD. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL NCD. + * BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION + * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN + * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + * + */ +/* $XFree86: xc/programs/lbxproxy/di/wire.c,v 1.14 2002/09/19 13:22:03 tsi Exp $ */ + +#include "lbx.h" +#include +#include +#include "wire.h" +#include "tags.h" +#include "colormap.h" +#include "init.h" +#ifndef Lynx +#include +#else +#include +#endif +#include +#include "proxyopts.h" +#include "swap.h" +#include "assert.h" +#include "os.h" +#include "resource.h" +#include "colormap.h" +#include "lbxext.h" +#include "atomcache.h" +#include "util.h" +#include "pm.h" +#include "misc.h" + +#include +#ifdef BIGREQS +#include +#endif + +/* + * The following include for utsname.h is from lib/xtrans + */ +#if (defined(_POSIX_SOURCE) && !defined(AIXV3) && !defined(__QNX__)) || defined(hpux) || defined(USG) || defined(SVR4) +#define NEED_UTSNAME +#include /* uname() */ +#else +#include /* gethostname() */ +#endif + +#ifdef LBX_STATS +extern int delta_out_total; +extern int delta_out_attempts; +extern int delta_out_hits; +extern int delta_in_total; +extern int delta_in_attempts; +extern int delta_in_hits; +#endif + +/* + * Local constants + */ +#define MAXBYTESDIFF 8 +#define PM_Unable 0 +#define PM_Success 1 +#define PM_Failure 2 + +/* + * Global vars + */ +int lbxDebug = 0; + +/* + * Local functions + */ +static void LbxOnlyListenToOneClient(); +static void LbxListenToAllClients(); + +/* + * Any request that could be delta compressed comes through here + */ +void +WriteReqToServer(client, len, buf, checkLargeRequest) + ClientPtr client; + int len; + char *buf; + Bool checkLargeRequest; +{ + XServerPtr server = client->server; + xLbxDeltaReq *p = (xLbxDeltaReq *) server->tempdeltabuf; + int diffs; + int cindex; + int newlen; + Bool written = FALSE; + +#ifdef LBX_STATS + delta_out_total++; +#endif + + if (DELTA_CACHEABLE(&server->outdeltas, len)) { + +#ifdef LBX_STATS + delta_out_attempts++; +#endif + + if ((diffs = LBXDeltaMinDiffs(&server->outdeltas, (unsigned char *)buf, + len, min(MAXBYTESDIFF, (len - sz_xLbxDeltaReq) >> 1), + &cindex)) >= 0) { + +#ifdef LBX_STATS + delta_out_hits++; +#endif + + LBXEncodeDelta(&server->outdeltas, (unsigned char *)buf, diffs, + cindex, &server->tempdeltabuf[sz_xLbxDeltaReq]); + p->reqType = server->lbxReq; + p->lbxReqType = X_LbxDelta; + p->diffs = diffs; + p->cindex = cindex; + newlen = sz_xLbxDeltaReq + sz_xLbxDiffItem * diffs; + p->length = (newlen + 3) >> 2; + /* Don't byte swap -- lengths are always in proxy order */ + WriteToServer(client, newlen, (char *) p, TRUE, checkLargeRequest); + written = TRUE; + } + LBXAddDeltaOut(&server->outdeltas, (unsigned char *)buf, len); + } + if (!written) { +#ifdef BIGREQS + if (len > (0xffff << 2)) { + xBigReq bigreq; + bigreq.reqType = ((xReq *)buf)->reqType; + bigreq.data = ((xReq *)buf)->data; + bigreq.zero = 0; + bigreq.length = (len + sizeof(xBigReq) - sizeof(xReq)) >> 2; + WriteToServer(client, sizeof(xBigReq), (char *)&bigreq, + TRUE, checkLargeRequest); + WriteToServer(client, len - sizeof(xReq), buf + sizeof(xReq), + FALSE, checkLargeRequest); + return; + } +#endif + WriteToServer(client, len, buf, TRUE, checkLargeRequest); + } +} + +void +_write_to_server(client, compressed, len, buf, checkLarge, startOfRequest) + ClientPtr client; + Bool compressed; + int len; + char *buf; + Bool checkLarge; + Bool startOfRequest; +{ + XServerPtr server = client->server; + unsigned reqSize; + + if (server->serverClient->clientGone) + return; + + if (checkLarge && client != clients[0] && nClients > 1 && + ((client != server->prev_exec) || numLargeRequestsInQueue)) { + /* + * Check if this is a large request only if there is more than + * one client and a different client was the last to execute or + * there are already large requests queued. + * + * If it is a large request, and there is room in the large request + * queue, add it to the queue. lbxproxy will send the large request + * in chunks, preventing this client from hogging the wire. + * + * By checking that the previous client was someone else, + * we hope that we can prevent splitting a large request + * when the other clients appear to be idle (based on their past + * history). + */ + + if (startOfRequest && + (!(reqSize = (((xReq *) buf)->length) << 2) || + reqSize >= LBX_LARGE_REQUEST_MIN_SIZE) && + numLargeRequestsInQueue < LARGE_REQUEST_QUEUE_LEN) { + LbxLargeRequestRec *largeRequest; + + if (!reqSize) + reqSize = ((xBigReq *)buf)->length << 2; + largeRequest = (LbxLargeRequestRec *) + xalloc (sizeof (LbxLargeRequestRec) + reqSize); + + /* + * Add this large request to the queue + */ + + largeRequest->client = client; + largeRequest->compressed = compressed; + largeRequest->buf = (char *) largeRequest + + sizeof (LbxLargeRequestRec); + memcpy (largeRequest->buf, buf, len); + largeRequest->totalBytes = reqSize; + largeRequest->bytesRead = len; + largeRequest->bytesWritten = 0; + client->largeRequest = largeRequest; + + largeRequestQueue[numLargeRequestsInQueue++] = largeRequest; + + /* + * Once we have the whole large request, we want to disable + * input from this client - we don't want to read new requests + * until we are done sending the whole large request. + */ + + if (reqSize == len) + IgnoreClient(client); + + return; + } else if (client->largeRequest) { + + /* + * Append to the large request + */ + + char *dst = client->largeRequest->buf + + client->largeRequest->bytesRead; + memcpy (dst, buf, len); + client->largeRequest->bytesRead += len; + + /* + * Once we have the whole large request, we want to disable + * input from this client - we don't want to read new requests + * until we are done sending the whole large request. + */ + + if (client->largeRequest->bytesRead == + client->largeRequest->totalBytes) + IgnoreClient(client); + + return; + } + } + + if (server->send != client) { + xLbxSwitchReq s; + + DBG(DBG_SWITCH, (stderr, "switch downstream to %d\n", client->index)); + s.reqType = server->lbxReq; + s.lbxReqType = X_LbxSwitch; + s.length = 2; + s.client = client->index; + WriteToClient(server->serverClient, sizeof(s), &s); + server->send = client; + } + DBG(DBG_IO, (stderr, "downstream %d len %d\n", client->index, len)); + if (compressed || !server->compHandle) + WriteToClient(server->serverClient, len, buf); + else + UncompressWriteToClient(server->serverClient, len, buf); +} + +void +WriteToServer(client, len, buf, startOfRequest, checkLargeRequest) + ClientPtr client; + int len; + char *buf; + Bool startOfRequest; + Bool checkLargeRequest; +{ + _write_to_server(client, TRUE, len, buf, checkLargeRequest, startOfRequest); +} + +void +WriteToServerUncompressed(client, len, buf, startOfRequest) + ClientPtr client; + int len; + char *buf; + Bool startOfRequest; +{ + _write_to_server(client, FALSE, len, buf, TRUE, startOfRequest); +} + +/* all these requests may need to be swapped back to the order of + * the client they're being executed for + */ +Bool +NewClient(client, setuplen) + ClientPtr client; + int setuplen; +{ + xLbxNewClientReq n; + XServerPtr server = client->server; + + DBG(DBG_CLIENT, (stderr, "new client %d\n", client->index)); + n.reqType = server->lbxReq; + n.lbxReqType = X_LbxNewClient; + n.length = 2 + (setuplen >> 2); + n.client = client->index; + WriteToServer(server->serverClient, sizeof(n), (char *) &n, TRUE, FALSE); + ++server->serverClient->sequence; + return TRUE; +} + +void +CloseClient(client) + ClientPtr client; +{ + xLbxCloseClientReq n; + XServerPtr server = client->server; + + if (!client->server) + return; + + if (client->server->serverClient == client) + return; + if (client->server->serverClient->clientGone) + return; + DBG(DBG_CLIENT, (stderr, "closing down client %d\n", client->index)); + if (client->closeDownMode != DestroyAll) { + n.reqType = server->lbxReq; + n.lbxReqType = X_LbxCloseClient; + n.length = 2; + n.client = client->index; + if (client->swapped) { + SwapCloseClient(&n); + } + WriteReqToServer(client, sizeof(n), (char *) &n, TRUE); + } +} + +void +ModifySequence(client, num) + ClientPtr client; + int num; +{ + xLbxModifySequenceReq req; + XServerPtr server = client->server; + + if (client->server->serverClient == client) + return; + req.reqType = server->lbxReq; + req.lbxReqType = X_LbxModifySequence; + req.length = 2; + req.adjust = num; + if (client->swapped) { + SwapModifySequence(&req); + } + WriteReqToServer(client, sizeof(req), (char *) &req, TRUE); +} + +void +AllowMotion(client, num) + ClientPtr client; + int num; +{ + client->server->motion_allowed += num; +} + +void +SendIncrementPixel(client, cmap, pixel) + ClientPtr client; + XID cmap; + unsigned long pixel; +{ + xLbxIncrementPixelReq req; + XServerPtr server = client->server; + + if (client->server->serverClient == client) + return; + req.reqType = server->lbxReq; + req.lbxReqType = X_LbxIncrementPixel; + req.length = 3; + req.cmap = cmap; + req.pixel = pixel; + if (client->swapped) { + SwapIncrementPixel(&req); + } + WriteReqToServer(client, sizeof(req), (char *) &req, TRUE); +} + +void +SendAllocColor( + ClientPtr client, + XID cmap, + CARD32 pixel, + CARD16 red, + CARD16 green, + CARD16 blue) +{ + xLbxAllocColorReq req; + + req.reqType = client->server->lbxReq; + req.lbxReqType = X_LbxAllocColor; + req.length = sz_xLbxAllocColorReq >> 2; + req.cmap = cmap; + req.pixel = pixel; + req.red = red; + req.green = green; + req.blue = blue; + req.pad = 0; + + if (client->swapped) + SwapAllocColor (&req); + + WriteReqToServer (client, sizeof(req), (char *) &req, TRUE); +} + +void +SendGetModifierMapping(client) + ClientPtr client; +{ + xLbxGetModifierMappingReq req; + XServerPtr server = client->server; + + if (client->server->serverClient == client) + return; + + req.reqType = server->lbxReq; + req.lbxReqType = X_LbxGetModifierMapping; + req.length = 1; + if (client->swapped) { + SwapGetModifierMapping(&req); + } + WriteReqToServer(client, sizeof(req), (char *) &req, TRUE); +} + +void +SendGetKeyboardMapping(client) + ClientPtr client; +{ + xLbxGetKeyboardMappingReq req; + XServerPtr server = client->server; + + if (client->server->serverClient == client) + return; + + /* + * always ask for entire thing so tag always works, and pass on requested + * subset + */ + req.reqType = server->lbxReq; + req.lbxReqType = X_LbxGetKeyboardMapping; + req.length = 2; + req.firstKeyCode = LBXMinKeyCode(client); + req.count = LBXMaxKeyCode(client) - LBXMinKeyCode(client) + 1; + req.pad1 = 0; + if (client->swapped) { + SwapGetKeyboardMapping(&req); + } + WriteReqToServer(client, sizeof(req), (char *) &req, TRUE); +} + +void +SendQueryFont(client, fid) + ClientPtr client; + XID fid; +{ + xLbxQueryFontReq req; + XServerPtr server = client->server; + + if (client->server->serverClient == client) + return; + + req.reqType = server->lbxReq; + req.lbxReqType = X_LbxQueryFont; + req.length = 2; + req.fid = fid; + if (client->swapped) { + SwapQueryFont(&req); + } + WriteReqToServer(client, sizeof(req), (char *) &req, TRUE); +} + +void +SendChangeProperty(client, win, prop, type, format, mode, num) + ClientPtr client; + Window win; + Atom prop, + type; + int format, + mode; + unsigned long num; +{ + xLbxChangePropertyReq req; + XServerPtr server = client->server; + + if (client->server->serverClient == client) + return; + + req.reqType = server->lbxReq; + req.lbxReqType = X_LbxChangeProperty; + req.length = 6; + req.window = win; + req.property = prop; + req.type = type; + req.format = format; + req.mode = mode; + req.nUnits = num; + req.pad[0] = req.pad[1] = 0; + if (client->swapped) { + SwapChangeProperty(&req); + } + WriteReqToServer(client, sizeof(req), (char *) &req, TRUE); +} + +void +SendGetProperty(client, win, prop, type, delete, off, len) + ClientPtr client; + Window win; + Atom prop, + type; + Bool delete; + unsigned long off, + len; +{ + xLbxGetPropertyReq req; + XServerPtr server = client->server; + + if (client->server->serverClient == client) + return; + + req.reqType = server->lbxReq; + req.lbxReqType = X_LbxGetProperty; + req.length = 7; + req.window = win; + req.property = prop; + req.type = type; + req.delete = delete; + req.longOffset = off; + req.longLength = len; + req.pad[0] = req.pad[1] = req.pad[2] = 0; + if (client->swapped) { + SwapGetProperty(&req); + } + WriteReqToServer(client, sizeof(req), (char *) &req, TRUE); +} + +void +SendInvalidateTag(client, tag) + ClientPtr client; + XID tag; +{ + xLbxInvalidateTagReq req; + XServerPtr server; + + if (!servers[0]) /* proxy resetting */ + return; + + server = client->server; + + req.reqType = server->lbxReq; + req.lbxReqType = X_LbxInvalidateTag; + req.length = 2; + req.tag = tag; + /* need tag type ? */ + if (client->swapped) { + SwapInvalidateTag(&req); + } + WriteReqToServer(client, sizeof(req), (char *) &req, TRUE); +} + +void +SendTagData(client, tag, len, data) + ClientPtr client; + XID tag; + unsigned long len; + pointer data; +{ + xLbxTagDataReq req, + *reqp; + int req_len; + XServerPtr server; + + server = client->server; + + req_len = 3 + ((len + 3) >> 2); + if (DELTA_CACHEABLE(&server->outdeltas, req_len << 2)) { + reqp = (xLbxTagDataReq *) xalloc(req_len << 2); + memcpy((pointer) (reqp + 1), data, len); + } else { + reqp = &req; + } + reqp->reqType = server->lbxReq; + reqp->lbxReqType = X_LbxTagData; + reqp->length = req_len; + reqp->real_length = len; + reqp->tag = tag; + /* need tag type ? */ + if (reqp == &req) { + WriteToServer(server->serverClient, + sizeof(req), (char *) &req, TRUE, FALSE); + if (len) + WriteToServer(server->serverClient, + len, (char *) data, FALSE, FALSE); + } else { + WriteReqToServer(server->serverClient, + req_len << 2, (char *) reqp, FALSE); + xfree(reqp); + } +} + +void +SendGetImage(client, drawable, x, y, width, height, planeMask, format) + ClientPtr client; + Drawable drawable; + int x; + int y; + unsigned int width; + unsigned int height; + unsigned long planeMask; + int format; +{ + xLbxGetImageReq req; + XServerPtr server = client->server; + + if (client->server->serverClient == client) + return; + + req.reqType = server->lbxReq; + req.lbxReqType = X_LbxGetImage; + req.length = 6; + req.drawable = drawable; + req.x = x; + req.y = y; + req.width = width; + req.height = height; + req.planeMask = planeMask; + req.format = format; + req.pad1 = 0; + req.pad2 = 0; + + if (client->swapped) { + SwapGetImage(&req); + } + WriteReqToServer(client, sizeof(req), (char *) &req, TRUE); +} + +static Bool +SendInternAtoms (server) + XServerPtr server; +{ + xLbxInternAtomsReq *req; + int reqSize, i, num; + char lenbuf[2]; + char *ptr; + + reqSize = sz_xLbxInternAtomsReq; + num = 0; + for (i = 0; i < server->atom_control_count; i++) { + if (server->atom_control[i].flags & AtomPreInternFlag) { + reqSize += (2 + server->atom_control[i].len); + num++; + } + } + if (!num) + return FALSE; + + if (!(req = (xLbxInternAtomsReq *) xalloc (reqSize))) + return FALSE; + + req->reqType = server->lbxReq; + req->lbxReqType = X_LbxInternAtoms; + req->length = (reqSize + 3) >> 2; + req->num = num; + + ptr = (char *) req + sz_xLbxInternAtomsReq; + + for (i = 0; i < server->atom_control_count; i++) + { + if (server->atom_control[i].flags & AtomPreInternFlag) { + *((CARD16 *) lenbuf) = server->atom_control[i].len; + ptr[0] = lenbuf[0]; + ptr[1] = lenbuf[1]; + ptr += 2; + memcpy (ptr, + server->atom_control[i].name, + server->atom_control[i].len); + ptr += server->atom_control[i].len; + } + } + + WriteToClient(server->serverClient, reqSize, (char *) req); + + xfree (req); + return TRUE; +} + +/*ARGSUSED*/ +static void +InternAtomsReply (server, rep) + XServerPtr server; + xLbxInternAtomsReply *rep; +{ + Atom *atoms = (Atom *) ((char *) rep + sz_xLbxInternAtomsReplyHdr); + int i; + + for (i = 0; i < server->atom_control_count; i++) { + if (server->atom_control[i].flags & AtomPreInternFlag) + (void) LbxMakeAtom (server, + server->atom_control[i].name, + server->atom_control[i].len, + *atoms++, TRUE); + } + + SendInitLBXPackets(server); + + /* + * Now the proxy is ready to accept connections from clients. + */ + + (void) ListenWellKnownSockets (); +} + + +static unsigned long pendingServerReplySequence; +static void (*serverReplyFunc) (); + +static void +ServerReply(server, rep) + XServerPtr server; + xReply *rep; +{ + if (serverReplyFunc && + rep->generic.sequenceNumber == pendingServerReplySequence) { + /* + * We got the reply we were waiting from the server + */ + + (*serverReplyFunc) (server, rep); + + /* + * ExpectServerReply() might have been called within the server + * reply func just processed. + */ + + if (rep->generic.sequenceNumber == pendingServerReplySequence) + serverReplyFunc = 0; + } +} + +static void +ExpectServerReply(server, func) + XServerPtr server; + void (*func) (); +{ + pendingServerReplySequence = server->serverClient->sequence; + serverReplyFunc = func; +} + +extern int (*ServerVector[]) (); + +static unsigned long +ServerRequestLength(req, sc, gotnow, partp) + xReq *req; + ClientPtr sc; + int gotnow; + Bool *partp; +{ + XServerPtr server = servers[sc->lbxIndex]; + ClientPtr client = server->recv; + xReply *rep; + xConnSetupPrefix *pre; + + if (!req) + req = (xReq *) sc->requestBuffer; + if (gotnow < sizeof(xReq)) { + *partp = TRUE; + return sizeof(xReq); + } + if (req->reqType == server->lbxEvent && req->data == LbxDeltaEvent) { + *partp = FALSE; + return req->length << 2; + } + if (req->reqType == server->lbxEvent && req->data == LbxSwitchEvent) { + *partp = FALSE; + return sz_xLbxSwitchEvent; + } + if (req->reqType == server->lbxEvent + LbxQuickMotionDeltaEvent) { + *partp = FALSE; + return sz_lbxQuickMotionDeltaEvent; + } + if (req->reqType == server->lbxEvent && req->data == LbxMotionDeltaEvent) { + *partp = FALSE; + return sz_lbxMotionDeltaEvent; + } + if (client->awaitingSetup) { + if (gotnow < 8) { + *partp = TRUE; + return 8; + } + pre = (xConnSetupPrefix *) req; + *partp = FALSE; + return 8 + (pre->length << 2); + } + if (gotnow < 8) { + *partp = TRUE; + return 8; + } + *partp = FALSE; + rep = (xReply *) req; + if (rep->generic.type != X_Reply) { + return EventLength((xEvent *)rep, server->lbxNegOpt.squish); + } + return sz_xReply + (rep->generic.length << 2); +} + +int +ServerProcStandardEvent(sc) + ClientPtr sc; +{ + xReply *rep; + XServerPtr server = servers[sc->lbxIndex]; + ClientPtr client = server->recv; + int len; + Bool part; + Bool cacheable = (server->initialized) ? TRUE : FALSE; + + rep = (xReply *) sc->requestBuffer; + + /* need to calculate length up from for Delta cache */ + len = RequestLength(rep, sc, 8, &part); + +#ifdef LBX_STATS + delta_in_total++; +#endif + + if (rep->generic.type == server->lbxEvent && + rep->generic.data1 == LbxDeltaEvent) { + xLbxDeltaReq *delta = (xLbxDeltaReq *) rep; + +#ifdef LBX_STATS + delta_in_attempts++; + delta_in_hits++; +#endif + + /* Note that LBXDecodeDelta decodes and adds current msg to the cache */ + len = LBXDecodeDelta(&server->indeltas, + (xLbxDiffItem *)((char *) rep + sz_xLbxDeltaReq), + delta->diffs, delta->cindex, + (unsigned char **)&rep); + + /* Make local copy in case someone writes to the request buffer */ + memcpy(server->tempdeltabuf, (char *) rep, len); + rep = (xReply *) server->tempdeltabuf; + + cacheable = FALSE; + } + + /* stick in delta buffer before LBX code modified things */ + if (cacheable && DELTA_CACHEABLE(&server->indeltas, len)) { + +#ifdef LBX_STATS + delta_in_attempts++; +#endif + + LBXAddDeltaIn(&server->indeltas, (unsigned char *) rep, len); + } + if (rep->generic.type == server->lbxEvent && + rep->generic.data1 != LbxMotionDeltaEvent) { + switch (rep->generic.data1) { + case LbxSwitchEvent: + DBG(DBG_SWITCH, (stderr, "switch upstream to %d\n", + ((xLbxSwitchEvent *)rep)->client)); + client = clients[((xLbxSwitchEvent *)rep)->client]; + server->recv = client; + (void) CheckPendingClientInput(sc); + break; + case LbxCloseEvent: + DBG(DBG_CLIENT, (stderr, "close client %d\n", + ((xLbxCloseEvent *)rep)->client)); + client = clients[((xLbxCloseEvent *)rep)->client]; + client->closeDownMode = DestroyAll; + CloseDownClient(client); + break; + case LbxInvalidateTagEvent: + DBG(DBG_CLIENT, (stderr, "invalidate tag %d type %d\n", + ((xLbxInvalidateTagEvent *)rep)->tag, + ((xLbxInvalidateTagEvent *)rep)->tagType)); + LbxFreeTag(server, + ((xLbxInvalidateTagEvent *)rep)->tag, + ((xLbxInvalidateTagEvent *)rep)->tagType); + break; + case LbxSendTagDataEvent: + DBG(DBG_CLIENT, (stderr, "send tag data %d type %d\n", + ((xLbxSendTagDataEvent *)rep)->tag, + ((xLbxSendTagDataEvent *)rep)->tagType)); + LbxSendTagData(sc, + ((xLbxSendTagDataEvent *)rep)->tag, + ((xLbxSendTagDataEvent *)rep)->tagType); + break; + case LbxListenToOne: + DBG(DBG_CLIENT, (stderr, "listen to one client %d\n", + ((xLbxListenToOneEvent *)rep)->client)); + if (((xLbxListenToOneEvent *)rep)->client == 0xffffffff) + LbxOnlyListenToOneClient(server->serverClient); + else + LbxOnlyListenToOneClient(clients[((xLbxListenToOneEvent *)rep)->client]); + break; + case LbxListenToAll: + DBG(DBG_CLIENT, (stderr, "listen to all clients\n")); + LbxListenToAllClients(server); + break; + case LbxReleaseCmapEvent: + { + Colormap cmap = ((xLbxReleaseCmapEvent *)rep)->colormap; + ColormapPtr pmap; + + pmap = (ColormapPtr) LookupIDByType (client, cmap, RT_COLORMAP); +#ifdef COLOR_DEBUG + fprintf (stderr, "\nGot LbxReleaseCmapEvent, cmap = 0x%x\n\n", cmap); +#endif + if (pmap && pmap->grab_status == CMAP_GRABBED) + ReleaseCmap (client, pmap); + break; + } + case LbxFreeCellsEvent: + { + Colormap cmap = ((xLbxFreeCellsEvent *)rep)->colormap; + Pixel start = ((xLbxFreeCellsEvent *)rep)->pixelStart; + Pixel end = ((xLbxFreeCellsEvent *)rep)->pixelEnd; + ColormapPtr pmap; + + pmap = (ColormapPtr) LookupIDByType (client, cmap, RT_COLORMAP); +#ifdef COLOR_DEBUG + fprintf (stderr, "\nGot LbxFreeCellsEvent, cmap = 0x%x, ", cmap); + fprintf (stderr, "startPixel = %d, endPixel = %d\n\n", + start, end); +#endif + if (pmap && pmap->grab_status == CMAP_GRABBED) + GotServerFreeCellsEvent (pmap, start, end); + break; + } + } + } else if ((rep->generic.type == server->lbxEvent && + rep->generic.data1 == LbxMotionDeltaEvent) || + (rep->generic.type == server->lbxEvent + LbxQuickMotionDeltaEvent)) + { + lbxMotionCache *motionCache = &server->motionCache; + + /* + * We use the motion delta event to generate a real MotionNotify event. + * + * The motion cache contains the last motion event we got from + * the server. + * + * The following are always stored in the cache in the proxy's + * byte order: + * sequenceNumber, time, rootX, rootY, eventX, eventY + * This is because when constructing the MotionNotify event using + * the delta event, we must do arithmetic in the proxy's byte order. + * + * The following are stored in the byte order of the latest client + * receiving a motion event (indicated by motionCache->swapped): + * root, event, child, state + * The assumption is that a client will receive a series of motion + * events, and we don't want to unnecessarily swap these fields. + * If the next motion event goes to a client with a byte order + * different from the previous client, we will have to swap these + * fields. + */ + + AllowMotion(client, 1); + + if (rep->generic.type == server->lbxEvent) + { + lbxMotionDeltaEvent *mev = (lbxMotionDeltaEvent *) rep; + + motionCache->sequenceNumber += mev->deltaSequence; + motionCache->time += mev->deltaTime; + motionCache->rootX += mev->deltaX; + motionCache->rootY += mev->deltaY; + motionCache->eventX += mev->deltaX; + motionCache->eventY += mev->deltaY; + } + else + { + lbxQuickMotionDeltaEvent *qmev = (lbxQuickMotionDeltaEvent *) rep; + + motionCache->time += qmev->deltaTime; + motionCache->rootX += qmev->deltaX; + motionCache->rootY += qmev->deltaY; + motionCache->eventX += qmev->deltaX; + motionCache->eventY += qmev->deltaY; + } + + if (!client->clientGone) { + xEvent ev; + int n; + + if (motionCache->swapped != client->swapped) + { + swapl (&motionCache->root, n); + swapl (&motionCache->event, n); + swapl (&motionCache->child, n); + swaps (&motionCache->state, n); + motionCache->swapped = client->swapped; + } + + ev.u.u.type = MotionNotify; + ev.u.u.detail = motionCache->detail; + ev.u.u.sequenceNumber = motionCache->sequenceNumber; + ev.u.keyButtonPointer.time = motionCache->time; + ev.u.keyButtonPointer.rootX = motionCache->rootX; + ev.u.keyButtonPointer.rootY = motionCache->rootY; + ev.u.keyButtonPointer.eventX = motionCache->eventX; + ev.u.keyButtonPointer.eventY = motionCache->eventY; + ev.u.keyButtonPointer.root = motionCache->root; + ev.u.keyButtonPointer.event = motionCache->event; + ev.u.keyButtonPointer.child = motionCache->child; + ev.u.keyButtonPointer.state = motionCache->state; + ev.u.keyButtonPointer.sameScreen = motionCache->sameScreen; + + if (client->swapped) { + swaps (&ev.u.u.sequenceNumber, n); + swapl (&ev.u.keyButtonPointer.time, n); + swaps (&ev.u.keyButtonPointer.rootX, n); + swaps (&ev.u.keyButtonPointer.rootY, n); + swaps (&ev.u.keyButtonPointer.eventX, n); + swaps (&ev.u.keyButtonPointer.eventY, n); + } + /* + * Write the reply + */ + + DoLBXReply (client, (char *) &ev, sz_xEvent); + } + + } else { + len = RequestLength(rep, sc, 8, &part); + DBG(DBG_IO, (stderr, "upstream %d len %d\n", client->index, len)); + if (client->index == 0) { + ServerReply(server, rep); + } else { + xEvent ev; + char *rp; + int n; + + if (!client->awaitingSetup && UnsquishEvent(rep, &ev, &len)) + rp = (char *) &ev; + else + rp = (char *) rep; + + if (rep->generic.type == MotionNotify) { + xEvent *mev = (xEvent *) rp; + lbxMotionCache *motionCache = &server->motionCache; + + AllowMotion(client, 1); + motionCache->swapped = client->swapped; + motionCache->detail = mev->u.u.detail; + motionCache->root = mev->u.keyButtonPointer.root; + motionCache->event = mev->u.keyButtonPointer.event; + motionCache->child = mev->u.keyButtonPointer.child; + motionCache->state = mev->u.keyButtonPointer.state; + motionCache->sameScreen = mev->u.keyButtonPointer.sameScreen; + motionCache->sequenceNumber = mev->u.u.sequenceNumber; + motionCache->time = mev->u.keyButtonPointer.time; + motionCache->rootX = mev->u.keyButtonPointer.rootX; + motionCache->rootY = mev->u.keyButtonPointer.rootY; + motionCache->eventX = mev->u.keyButtonPointer.eventX; + motionCache->eventY = mev->u.keyButtonPointer.eventY; + if (client->swapped) + { + swaps(&motionCache->sequenceNumber, n); + swapl(&motionCache->time, n); + swaps(&motionCache->rootX, n); + swaps(&motionCache->rootY, n); + swaps(&motionCache->eventX, n); + swaps(&motionCache->eventY, n); + } + } + + /* + * Write the reply + */ + + if (!client->clientGone) + DoLBXReply (client, rp, len); + client->awaitingSetup = FALSE; + } + } + + return Success; +} + +static void +LbxIgnoreAllClients(server) + XServerPtr server; +{ + if (!server->lbxIgnoringAll) { + if (GrabInProgress) { + server->lbxGrabInProgress = GrabInProgress; + ListenToAllClients(); + } + OnlyListenToOneClient(server->serverClient); + server->lbxIgnoringAll = TRUE; + } +} + +/* ARGSUSED */ +static void +LbxAttendAllClients(server) + XServerPtr server; +{ + if (server->lbxIgnoringAll) { + ListenToAllClients(); + server->lbxIgnoringAll = FALSE; + if (server->lbxGrabInProgress) { + OnlyListenToOneClient(clients[server->lbxGrabInProgress]); + server->lbxGrabInProgress = 0; + } + } +} + +/* ARGSUSED */ +static void +LbxOnlyListenToOneClient(client) + ClientPtr client; +{ + /* + * For a multi-display proxy, there is no need to do anything - + * don't want one server grab to impact the clients for a + * different server. + */ + return; +} + +/* ARGSUSED */ +static void +LbxListenToAllClients(server) + XServerPtr server; +{ + /* + * For a multi-display proxy, there is no need to do anything - + * don't want one server grab to impact the clients for a + * different server. + */ + return; +} + +/* ARGSUSED */ +static Bool +ProxyWorkProc(dummy, index) + pointer dummy; + int index; +{ + XServerPtr server; + xLbxAllowMotionReq req; + + if ((server = servers[index]) == 0) + return TRUE; + if (!server->initialized) + return TRUE; + + if (server->motion_allowed) { + DBG(DBG_CLIENT, (stderr, "allow %d motion events\n", + server->motion_allowed)); + req.reqType = server->lbxReq; + req.lbxReqType = X_LbxAllowMotion; + req.length = 2; + req.num = server->motion_allowed; + server->motion_allowed = 0; + WriteToClient(server->serverClient, sizeof(req), &req); + } + /* Need to flush the output buffers before we flush compression buffer */ + if (NewOutputPending) + FlushAllOutput(); + + if (server->compHandle) { + if (server->lbxNegOpt.streamOpts.streamCompInputAvail(server->fd)) + AvailableClientInput(server->serverClient); + if (server->lbxNegOpt.streamOpts.streamCompFlush(server->fd) != 0) + MarkConnectionWriteBlocked(server->serverClient); + } + /* + * If we've got stuff remaining in the output buffers to the server, then + * don't allow reads from any other clients, otherwise we could overflow. + */ + if (PendingClientOutput(server->serverClient)) + LbxIgnoreAllClients(server); + else + LbxAttendAllClients(server); + + return FALSE; +} + +Bool reconnectAfterCloseServer = FALSE; + +void +CloseServer(client) + ClientPtr client; /* This client is connected to a display server */ +{ + XServerPtr server; + int i; + int found; + + DBG(DBG_CLOSE, (stderr, "closing down server\n")); + + server = client->server; + servers[server->index] = 0; + LBXFreeDeltaCache(&server->indeltas); + LBXFreeDeltaCache(&server->outdeltas); + if (server->compHandle) + server->lbxNegOpt.streamOpts.streamCompFreeHandle(server->compHandle); + + /* + * If another server is still active, don't terminate + */ + for (found = 0, i = 0; i < lbxMaxServers; i++) { + if (servers[i]) { + found = 1; + break; + } + } + if (!found && !reconnectAfterCloseServer) + dispatchException |= DE_TERMINATE; + + /* + * Close all of the "real" clients for this server + */ + for (i = 1; i < currentMaxClients; i++) { + if (clients[i] && + clients[i] != client && + clients[i]->server == server) { + + client->clientGone = TRUE; + CloseClient (clients[i]); + FreeClientResources (clients[i]); + CloseDownConnection (clients[i]); + if (clients[i]->index < nextFreeClientID) + nextFreeClientID = clients[i]->index; + clients[i] = NullClient; + xfree (clients[i]); + --nClients; + while (!clients[currentMaxClients-1]) + currentMaxClients--; + } + } + + /* + * Need to remove this server's listen port(s) + */ + for (i=0; i < MAXTRANSPORTS; i++) + if (server->listen_fds[i] != -1) { + close (server->listen_fds[i]); + FD_CLR (server->listen_fds[i], &WellKnownConnections); + FD_CLR (server->listen_fds[i], &AllSockets); + } + + /* remove all back pointers */ + for (i = 1; i < currentMaxClients; i++) { + if (clients[i] && clients[i]->server == server) + clients[i]->server = NULL; + } + + /* + * Try to reconnect to this server + */ + if (reconnectAfterCloseServer && !ConnectToServer (server->display_name)) { + + fprintf (stderr, "could not reconnect to '%s'\n", server->display_name); + + if (!found && !proxyMngr) + /* + * There is no need to continue if there is no proxyManager + */ + dispatchException |= DE_TERMINATE; + } + + if (server->display_name) + free (server->display_name); + if (server->proxy_name) + free (server->proxy_name); + xfree (server->requestVector); + xfree(server); + + CloseDownFileDescriptor(client); + + isItTimeToYield = 1; +} + + +static void +StartProxyReply(server, rep) + XServerPtr server; + xLbxStartReply *rep; +{ + int replylen; + + replylen = (rep->length << 2) + sz_xLbxStartReply - sz_xLbxStartReplyHdr; + if (rep->nOpts == 0xff) { + fprintf(stderr, "WARNING: option negotiation failed - using defaults\n"); + LbxOptInit(server); + } else if (LbxOptParseReply(server, rep->nOpts, + (unsigned char *)&rep->optDataStart, replylen) < 0) { + FatalError("Bad options from server"); + } + +#ifdef OPTDEBUG + fprintf(stderr, "server: N = %d, maxlen = %d, proxy: N = %d, maxlen = %d\n", + server->lbxNegOpt.serverDeltaN, server->lbxNegOpt.serverDeltaMaxLen, + server->lbxNegOpt.proxyDeltaN, server->lbxNegOpt.proxyDeltaMaxLen); +#endif + + LBXInitDeltaCache(&server->indeltas, server->lbxNegOpt.serverDeltaN, + server->lbxNegOpt.serverDeltaMaxLen); + LBXInitDeltaCache(&server->outdeltas, server->lbxNegOpt.proxyDeltaN, + server->lbxNegOpt.proxyDeltaMaxLen); + QueueWorkProc(ProxyWorkProc, NULL, (pointer)(long) server->index); + +#ifdef OPTDEBUG + fprintf(stderr, "squishing = %d\n", server->lbxNegOpt.squish); + fprintf(stderr, "useTags = %d\n", server->lbxNegOpt.useTags); +#endif + + TagsInit(server, server->lbxNegOpt.useTags); + + if (!server->lbxNegOpt.useTags) + { + ProcVector[X_GetModifierMapping] = ProcStandardRequest; + ProcVector[X_GetKeyboardMapping] = ProcStandardRequest; + ProcVector[X_QueryFont] = ProcStandardRequest; + ProcVector[X_ChangeProperty] = ProcStandardRequest; + ProcVector[X_GetProperty] = ProcStandardRequest; + } + + if (server->lbxNegOpt.streamOpts.streamCompInit) { + unsigned char *extra = (unsigned char *) rep; + int len = sizeof(xReply) + (rep->length << 2); + int left = BytesInClientBuffer(server->serverClient); + + server->compHandle = + (*server->lbxNegOpt.streamOpts.streamCompInit) ( + server->fd, server->lbxNegOpt.streamOpts.streamCompArg); + SwitchConnectionFuncs(server->serverClient, + server->lbxNegOpt.streamOpts.streamCompRead, + server->lbxNegOpt.streamOpts.streamCompWriteV); + extra += len; + server->lbxNegOpt.streamOpts.streamCompStuffInput(server->fd, + extra, + left); + SkipInClientBuffer(server->serverClient, left + len, 0); + StartOutputCompression(server->serverClient, + server->lbxNegOpt.streamOpts.streamCompOn, + server->lbxNegOpt.streamOpts.streamCompOff); + } + server->initialized = TRUE; + MakeClientGrabImpervious(server->serverClient); + + if (SendInternAtoms(server)) + ExpectServerReply (server, InternAtomsReply); + else + { + SendInitLBXPackets(server); + + /* + * Now the proxy is ready to accept connections from clients. + */ + + (void) ListenWellKnownSockets (); + } +} + +static void +StartProxy(server) + XServerPtr server; +{ + char buf[1024]; + int reqlen; + xLbxStartProxyReq *n = (xLbxStartProxyReq *) buf; + + LbxOptInit(server); + n->reqType = server->lbxReq; + n->lbxReqType = X_LbxStartProxy; + reqlen = LbxOptBuildReq(server, buf + sz_xLbxStartProxyReq); + assert(reqlen > 0 && reqlen + sz_xLbxStartProxyReq <= 1024); + n->length = (reqlen + sz_xLbxStartProxyReq + 3) >> 2; + /* + * Don't call WriteToServer because we don't want to switch. + */ + WriteToClient(server->serverClient, n->length << 2, (char *) n); + server->serverClient->sequence++; + ExpectServerReply(server, StartProxyReply); + while (NewOutputPending) + FlushAllOutput(); +} + +static Bool +InitServer (dpy_name, i, server, sequencep) + char* dpy_name; + int i; + XServerPtr server; + int* sequencep; +{ + server->index = i; + + DBG(DBG_IO, (stderr, "making server connection\n")); + server->dpy = DisplayOpen (dpy_name, + &server->lbxReq, + &server->lbxEvent, + &server->lbxError, + sequencep); + if (!server->dpy) return FALSE; + + server->fd = DisplayConnectionNumber (server->dpy); + server->compHandle = NULL; + server->initialized = FALSE; + server->prev_exec = clients[0]; + server->send = clients[0]; + server->recv = clients[0]; + server->motion_allowed = 0; + server->wm_running = FALSE; + server->extensions = NULL; + + /* + * Initialize the atom fields + */ + server->atom_control_count = 0; + server->atom_control = NULL; + LBXReadAtomsFile(server); + + /* + * Initialize global and property caches + */ + server->num_caches = 0; + server->seed = 0; + + /* + * The ProcVector table contains the default functions plus any + * changes that were made when the command line options were + * parsed. + * + * In multi-display lbxproxy, each server may have different + * lbx options that are negotiated. Consequently, a version + * of ProcVector must be maintained for each server. The field + * requestVector is used for this purpose. + * + * When a client connects, its requestVector will be set to its + * server's requestVector. + */ + server->requestVector = (int (**)()) xalloc (sizeof (ProcVector)); + if (!server->requestVector) return FALSE; + memcpy (server->requestVector, ProcVector, sizeof (ProcVector)); + + /* + * Initialize the resource fields + */ + server->lastLbxClientIndexLookup = NULL; + + /* + * Initialize the grab state variables + */ + server->lbxIgnoringAll = 0; + server->lbxGrabInProgress = 0; + + return TRUE; +} + +Bool +ConnectToServer(dpy_name) + char *dpy_name; +{ + int i, j; + XServerPtr server; + int sequence; + ClientPtr sc; + static int been_there; + static char my_host[250]; + char proxy_address[250+6]; + +#ifdef NEED_UTSNAME + struct utsname name; +#endif + + for (i = 0; i < lbxMaxServers; i++) + if (!servers[i]) + break; + if (i == lbxMaxServers) { + if (proxyMngr) + SendGetProxyAddrReply( PM_iceConn, PM_Unable, NULL, + "too many servers" ); + return FALSE; + } + server = (XServerPtr) xalloc(sizeof(XServerRec)); + if (!server) { + if (proxyMngr) + SendGetProxyAddrReply( PM_iceConn, PM_Unable, NULL, + "memory allocation failure"); + return FALSE; + } + bzero(server, sizeof(XServerRec)); + + if (!InitServer (dpy_name, i, server, &sequence)) { + if (proxyMngr) { + (void) snprintf (proxy_address, sizeof(proxy_address), + "could not connect to server '%s'", + dpy_name); + SendGetProxyAddrReply( PM_iceConn, PM_Failure, NULL, proxy_address); + } + xfree(server); + return FALSE; + } + + /* + * Create the socket(s) this display will listen on + */ + for (j=0; j < MAXTRANSPORTS; j++) + server->listen_fds[j] = -1; + CreateServerSockets(server->listen_fds); + + /* + * Generate the proxy address and save the host name part + */ + if (!been_there || i == 0) { + been_there++; + + clients[0]->server = server; + +#ifdef NEED_UTSNAME + uname (&name); + (void) snprintf(my_host,sizeof(my_host),"%s",name.nodename); +#else + (void) gethostname (my_host,sizeof(my_host)); +#endif + } + if (snprintf (proxy_address, sizeof(proxy_address) ,"%s:%s", my_host, + display) >= sizeof(proxy_address)) { + (void) snprintf (proxy_address, sizeof(proxy_address), + "display name too long"); + SendGetProxyAddrReply( PM_iceConn, PM_Failure, NULL, proxy_address); + return FALSE; + } + + servers[i] = server; + + sc = AllocNewConnection(server->fd, -1, TRUE, NULL); + sc->server = server; + sc->public.requestLength = ServerRequestLength; + sc->lbxIndex = i; + sc->requestVector = ServerVector; + sc->awaitingSetup = FALSE; + sc->sequence = sequence; + + /* + * AllocNewConn didn't initialize the client resources so + * it needs to be done here + */ + InitClientResources(sc); + + server->serverClient = sc; + server->proxy_name = strdup (proxy_address); + if (dpy_name) + server->display_name = strdup (dpy_name); + + StartProxy(server); + + if (proxyMngr) { + SendGetProxyAddrReply( PM_iceConn, PM_Success, proxy_address, NULL ); + } + + return TRUE; +} diff --git a/app/lbxproxy/di/zeropad.c b/app/lbxproxy/di/zeropad.c new file mode 100644 index 000000000..e57f5479e --- /dev/null +++ b/app/lbxproxy/di/zeropad.c @@ -0,0 +1,605 @@ +/* $Xorg: zeropad.c,v 1.4 2001/02/09 02:05:32 xorgcvs Exp $ */ + +/* + +Copyright 1996, 1998 The Open Group + +Permission to use, copy, modify, distribute, and sell this software and its +documentation for any purpose is hereby granted without fee, provided that +the above copyright notice appear in all copies and that both that +copyright notice and this permission notice appear in supporting +documentation. + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR +OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the name of The Open Group shall +not be used in advertising or otherwise to promote the sale, use or +other dealings in this Software without prior written authorization +from The Open Group. + +*/ + +/* + * This module handles zeroing out unused pad bytes in X requests. + * This will hopefully improve both stream and delta compression, + * since we are removing the random values in pad bytes. + */ + +#include + +static void +ZeroEmptyReq (req) + xReq *req; +{ + req->data = 0; +} + +#define ZeroGetInputFocusReq ZeroEmptyReq +#define ZeroGetFontPathReq ZeroEmptyReq +#define ZeroGetKeyboardControlReq ZeroEmptyReq +#define ZeroGetPointerControlReq ZeroEmptyReq +#define ZeroGetPointerMappingReq ZeroEmptyReq +#define ZeroGetScreenSaverReq ZeroEmptyReq +#define ZeroGrabServerReq ZeroEmptyReq +#define ZeroListExtensionsReq ZeroEmptyReq +#define ZeroNoOperationReq ZeroEmptyReq +#define ZeroGetModifierMappingReq ZeroEmptyReq +#define ZeroQueryKeymapReq ZeroEmptyReq +#define ZeroUngrabServerReq ZeroEmptyReq + + +static void +ZeroResourceReq (req) + xResourceReq *req; +{ + req->pad = 0; +} + +#define ZeroFreePixmapReq ZeroResourceReq +#define ZeroGetAtomNameReq ZeroResourceReq +#define ZeroDestroySubwindowsReq ZeroResourceReq +#define ZeroDestroyWindowReq ZeroResourceReq +#define ZeroCloseFontReq ZeroResourceReq +#define ZeroQueryFontReq ZeroResourceReq +#define ZeroFreeCursorReq ZeroResourceReq +#define ZeroFreeGCReq ZeroResourceReq +#define ZeroGetGeometryReq ZeroResourceReq +#define ZeroGetSelectionOwnerReq ZeroResourceReq +#define ZeroGetWindowAttributesReq ZeroResourceReq +#define ZeroInstallColormapReq ZeroResourceReq +#define ZeroListInstalledColormapsReq ZeroResourceReq +#define ZeroListPropertiesReq ZeroResourceReq +#define ZeroMapSubwindowsReq ZeroResourceReq +#define ZeroMapWindowReq ZeroResourceReq +#define ZeroQueryPointerReq ZeroResourceReq +#define ZeroQueryTreeReq ZeroResourceReq +#define ZeroUngrabKeyboardReq ZeroResourceReq +#define ZeroUngrabPointerReq ZeroResourceReq +#define ZeroUninstallColormapReq ZeroResourceReq +#define ZeroUnmapSubwindowsReq ZeroResourceReq +#define ZeroUnmapWindowReq ZeroResourceReq +#define ZeroKillClientReq ZeroResourceReq +#define ZeroFreeColormapReq ZeroResourceReq + + +static void +ZeroChangeWindowAttributesReq (req) + xChangeWindowAttributesReq *req; +{ + req->pad = 0; +} + +static void +ZeroReparentWindowReq (req) + xReparentWindowReq *req; +{ + req->pad = 0; +} + +static void +ZeroConfigureWindowReq (req) + xConfigureWindowReq *req; +{ + req->pad = 0; + req->pad2 = 0; +} + +static void +ZeroInternAtomReq (req) + xInternAtomReq *req; +{ + req->pad = 0; +} + +static void +ZeroChangePropertyReq (req) + xChangePropertyReq *req; +{ + req->pad[0] = 0; + req->pad[1] = 0; + req->pad[2] = 0; +} + +static void +ZeroDeletePropertyReq (req) + xDeletePropertyReq *req; +{ + req->pad = 0; +} + +static void +ZeroSetSelectionOwnerReq (req) + xSetSelectionOwnerReq *req; +{ + req->pad = 0; +} + +static void +ZeroConvertSelectionReq (req) + xConvertSelectionReq *req; +{ + req->pad = 0; +} + +static void +ZeroGrabButtonReq (req) + xGrabButtonReq *req; +{ + req->pad = 0; +} + +static void +ZeroUngrabButtonReq (req) + xUngrabButtonReq *req; +{ + req->pad = 0; +} + +static void +ZeroChangeActivePointerGrabReq (req) + xChangeActivePointerGrabReq *req; +{ + req->pad = 0; + req->pad2 = 0; +} + +static void +ZeroGrabKeyboardReq (req) + xGrabKeyboardReq *req; +{ + req->pad = 0; +} + +static void +ZeroGrabKeyReq (req) + xGrabKeyReq *req; +{ + req->pad1 = 0; + req->pad2 = 0; + req->pad3 = 0; +} + +static void +ZeroUngrabKeyReq (req) + xUngrabKeyReq *req; +{ + req->pad = 0; +} + +static void +ZeroGetMotionEventsReq (req) + xGetMotionEventsReq *req; +{ + req->pad = 0; +} + +static void +ZeroTranslateCoordsReq (req) + xTranslateCoordsReq *req; +{ + req->pad = 0; +} + +static void +ZeroWarpPointerReq (req) + xWarpPointerReq *req; +{ + req->pad = 0; +} + +static void +ZeroOpenFontReq (req) + xOpenFontReq *req; +{ + req->pad = 0; + req->pad1 = 0; + req->pad2 = 0; +} + +static void +ZeroListFontsReq (req) + xListFontsReq *req; +{ + req->pad = 0; +} + +#define ZeroListFontsWithInfoReq ZeroListFontsReq + +static void +ZeroSetFontPathReq (req) + xSetFontPathReq *req; +{ + req->pad = 0; + req->pad1 = 0; + req->pad2 = 0; +} + +static void +ZeroCreateGCReq (req) + xCreateGCReq *req; +{ + req->pad = 0; +} + +static void +ZeroChangeGCReq (req) + xChangeGCReq *req; +{ + req->pad = 0; +} + +static void +ZeroCopyGCReq (req) + xCopyGCReq *req; +{ + req->pad = 0; +} + +static void +ZeroSetDashesReq (req) + xSetDashesReq *req; +{ + req->pad = 0; +} + +static void +ZeroCopyAreaReq (req) + xCopyAreaReq *req; +{ + req->pad = 0; +} + +static void +ZeroCopyPlaneReq (req) + xCopyPlaneReq *req; +{ + req->pad = 0; +} + +static void +ZeroPolySegmentReq (req) + xPolySegmentReq *req; +{ + req->pad = 0; +} + +#define ZeroPolyArcReq ZeroPolySegmentReq +#define ZeroPolyRectangleReq ZeroPolySegmentReq +#define ZeroPolyFillRectangleReq ZeroPolySegmentReq +#define ZeroPolyFillArcReq ZeroPolySegmentReq + +static void +ZeroFillPolyReq (req) + xFillPolyReq *req; +{ + req->pad = 0; + req->pad1 = 0; +} + +static void +ZeroPutImageReq (req) + xPutImageReq *req; +{ + req->pad = 0; +} + +static void +ZeroPolyTextReq (req) + xPolyTextReq *req; +{ + req->pad = 0; +} + +#define ZeroPolyText8Req ZeroPolyTextReq +#define ZeroPolyText16Req ZeroPolyTextReq + +static void +ZeroCopyColormapAndFreeReq (req) + xCopyColormapAndFreeReq *req; +{ + req->pad = 0; +} + +static void +ZeroAllocColorReq (req) + xAllocColorReq *req; +{ + req->pad = 0; + req->pad2 = 0; +} + +static void +ZeroAllocNamedColorReq (req) + xAllocNamedColorReq *req; +{ + req->pad = 0; + req->pad1 = 0; + req->pad2 = 0; +} + +static void +ZeroFreeColorsReq (req) + xFreeColorsReq *req; +{ + req->pad = 0; +} + +static void +ZeroStoreColorsReq (req) + xStoreColorsReq *req; +{ + req->pad = 0; +} + +static void +ZeroStoreNamedColorReq (req) + xStoreNamedColorReq *req; +{ + req->pad1 = 0; + req->pad2 = 0; +} + +static void +ZeroQueryColorsReq (req) + xQueryColorsReq *req; +{ + req->pad = 0; +} + +static void +ZeroLookupColorReq (req) + xLookupColorReq *req; +{ + req->pad = 0; + req->pad1 = 0; + req->pad2 = 0; +} + +static void +ZeroCreateCursorReq (req) + xCreateCursorReq *req; +{ + req->pad = 0; +} + +static void +ZeroCreateGlyphCursorReq (req) + xCreateGlyphCursorReq *req; +{ + req->pad = 0; +} + +static void +ZeroRecolorCursorReq (req) + xRecolorCursorReq *req; +{ + req->pad = 0; +} + +static void +ZeroQueryExtensionReq (req) + xQueryExtensionReq *req; +{ + req->pad = 0; + req->pad1 = 0; + req->pad2 = 0; +} + +static void +ZeroGetKeyboardMappingReq (req) + xGetKeyboardMappingReq *req; +{ + req->pad = 0; + req->pad1 = 0; +} + +static void +ZeroChangeKeyboardMappingReq (req) + xChangeKeyboardMappingReq *req; +{ + req->pad1 = 0; +} + +static void +ZeroChangeKeyboardControlReq (req) + xChangeKeyboardControlReq *req; +{ + req->pad = 0; +} + +static void +ZeroChangePointerControlReq (req) + xChangePointerControlReq *req; +{ + req->pad = 0; +} + +static void +ZeroSetScreenSaverReq (req) + xSetScreenSaverReq *req; +{ + req->pad = 0; + req->pad2 = 0; +} + +static void +ZeroChangeHostsReq (req) + xChangeHostsReq *req; +{ + req->pad = 0; +} + +static void +ZeroListHostsReq (req) + xListHostsReq *req; +{ + req->pad = 0; +} + +static void +ZeroRotatePropertiesReq (req) + xRotatePropertiesReq *req; +{ + req->pad = 0; +} + +void (*ZeroPadReqVector[128]) () = +{ + 0, + 0, /* CreateWindowReq */ + ZeroChangeWindowAttributesReq, + ZeroGetWindowAttributesReq, + ZeroDestroyWindowReq, + ZeroDestroySubwindowsReq, /* 5 */ + 0, /* ChangeSaveSetReq */ + ZeroReparentWindowReq, + ZeroMapWindowReq, + ZeroMapSubwindowsReq, + ZeroUnmapWindowReq, /* 10 */ + ZeroUnmapSubwindowsReq, + ZeroConfigureWindowReq, + 0, /* CirculateWindowReq */ + ZeroGetGeometryReq, + ZeroQueryTreeReq, /* 15 */ + ZeroInternAtomReq, + ZeroGetAtomNameReq, + ZeroChangePropertyReq, + ZeroDeletePropertyReq, + 0, /* GetPropertyReq */ /* 20 */ + ZeroListPropertiesReq, + ZeroSetSelectionOwnerReq, + ZeroGetSelectionOwnerReq, + ZeroConvertSelectionReq, + 0, /* SendEventReq */ /* 25 */ + 0, /* GrabPointerReq */ + ZeroUngrabPointerReq, + ZeroGrabButtonReq, + ZeroUngrabButtonReq, + ZeroChangeActivePointerGrabReq, /* 30 */ + ZeroGrabKeyboardReq, + ZeroUngrabKeyboardReq, + ZeroGrabKeyReq, + ZeroUngrabKeyReq, + 0, /* AllowEventsReq */ /* 35 */ + ZeroGrabServerReq, + ZeroUngrabServerReq, + ZeroQueryPointerReq, + ZeroGetMotionEventsReq, + ZeroTranslateCoordsReq, /* 40 */ + ZeroWarpPointerReq, + 0, /* SetInputFocusReq */ + ZeroGetInputFocusReq, + ZeroQueryKeymapReq, + ZeroOpenFontReq, /* 45 */ + ZeroCloseFontReq, + ZeroQueryFontReq, + 0, /* QueryTextExtentsReq */ + ZeroListFontsReq, + ZeroListFontsWithInfoReq, /* 50 */ + ZeroSetFontPathReq, + ZeroGetFontPathReq, + 0, /* CreatePixmapReq */ + ZeroFreePixmapReq, + ZeroCreateGCReq, /* 55 */ + ZeroChangeGCReq, + ZeroCopyGCReq, + ZeroSetDashesReq, + 0, /* SetClipRectanglesReq */ + ZeroFreeGCReq, /* 60 */ + 0, /* ClearToBackgroundReq */ + ZeroCopyAreaReq, + ZeroCopyPlaneReq, + 0, /* PolyPointReq */ + 0, /* PolyLineReq */ /* 65 */ + ZeroPolySegmentReq, + ZeroPolyRectangleReq, + ZeroPolyArcReq, + ZeroFillPolyReq, + ZeroPolyFillRectangleReq, /* 70 */ + ZeroPolyFillArcReq, + ZeroPutImageReq, + 0, /* GetImageReq */ + ZeroPolyText8Req, + ZeroPolyText16Req, /* 75 */ + 0, /* ImageText8Req */ + 0, /* ImageText16Req */ + 0, /* CreateColormapReq */ + ZeroFreeColormapReq, + ZeroCopyColormapAndFreeReq, /* 80 */ + ZeroInstallColormapReq, + ZeroUninstallColormapReq, + ZeroListInstalledColormapsReq, + ZeroAllocColorReq, + ZeroAllocNamedColorReq, /* 85 */ + 0, /* AllocColorCellsReq */ + 0, /* AllocColorPlanesReq */ + ZeroFreeColorsReq, + ZeroStoreColorsReq, + ZeroStoreNamedColorReq, /* 90 */ + ZeroQueryColorsReq, + ZeroLookupColorReq, + ZeroCreateCursorReq, + ZeroCreateGlyphCursorReq, + ZeroFreeCursorReq, /* 95 */ + ZeroRecolorCursorReq, + 0, /* QueryBestSizeReq */ + ZeroQueryExtensionReq, + ZeroListExtensionsReq, + ZeroChangeKeyboardMappingReq, /* 100 */ + ZeroGetKeyboardMappingReq, + ZeroChangeKeyboardControlReq, + ZeroGetKeyboardControlReq, + 0, /* BellReq */ + ZeroChangePointerControlReq, /* 105 */ + ZeroGetPointerControlReq, + ZeroSetScreenSaverReq, + ZeroGetScreenSaverReq, + ZeroChangeHostsReq, + ZeroListHostsReq, /* 110 */ + 0, /* ChangeAccessControlReq */ + 0, /* ChangeCloseDownModeReq */ + ZeroKillClientReq, + ZeroRotatePropertiesReq, + 0, /* ForceScreenSaverReq */ /* 115 */ + 0, /* SetPointerMappingReq */ + ZeroGetPointerMappingReq, + 0, /* SetModifierMappingReq */ + ZeroGetModifierMappingReq, + 0, /* 120 */ + 0, + 0, + 0, + 0, + 0, /* 125 */ + 0, + ZeroNoOperationReq +}; diff --git a/app/lbxproxy/include/assert.h b/app/lbxproxy/include/assert.h new file mode 100644 index 000000000..3e0b8c278 --- /dev/null +++ b/app/lbxproxy/include/assert.h @@ -0,0 +1,34 @@ +/* $Xorg: assert.h,v 1.3 2000/08/17 19:53:57 cpqbld Exp $ */ +/* + * Copyright 1994 Network Computing Devices, Inc. + * + * Permission to use, copy, modify, distribute, and sell this software and + * its documentation for any purpose is hereby granted without fee, provided + * that the above copyright notice appear in all copies and that both that + * copyright notice and this permission notice appear in supporting + * documentation, and that the name Network Computing Devices, Inc. not be + * used in advertising or publicity pertaining to distribution of this + * software without specific, written prior permission. + * + * THIS SOFTWARE IS PROVIDED `AS-IS'. NETWORK COMPUTING DEVICES, INC., + * DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING WITHOUT + * LIMITATION ALL IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A + * PARTICULAR PURPOSE, OR NONINFRINGEMENT. IN NO EVENT SHALL NETWORK + * COMPUTING DEVICES, INC., BE LIABLE FOR ANY DAMAGES WHATSOEVER, INCLUDING + * SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES, INCLUDING LOSS OF USE, DATA, + * OR PROFITS, EVEN IF ADVISED OF THE POSSIBILITY THEREOF, AND REGARDLESS OF + * WHETHER IN AN ACTION IN CONTRACT, TORT OR NEGLIGENCE, ARISING OUT OF OR IN + * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + * + * $NCDId$ + */ +#ifdef DEBUG +#include +#ifdef SABER +#define assert(ex) {if (!(ex)){(void)fprintf(stderr,"Assertion \"ex\" failed: file \"%s\", line %d\n", __FILE__, __LINE__);saber_stop();}} +#else +#define assert(ex) {if (!(ex)){(void)fprintf(stderr,"Assertion \"ex\" failed: file \"%s\", line %d\n", __FILE__, __LINE__);abort();}} +#endif +#else +#define assert(ex) +#endif diff --git a/app/lbxproxy/include/atomcache.h b/app/lbxproxy/include/atomcache.h new file mode 100644 index 000000000..b70f792ca --- /dev/null +++ b/app/lbxproxy/include/atomcache.h @@ -0,0 +1,98 @@ +/* $Xorg: atomcache.h,v 1.4 2001/02/09 02:05:32 xorgcvs Exp $ */ +/* + +Copyright 1998 The Open Group + +Permission to use, copy, modify, distribute, and sell this software and its +documentation for any purpose is hereby granted without fee, provided that +the above copyright notice appear in all copies and that both that +copyright notice and this permission notice appear in supporting +documentation. + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the name of The Open Group shall not be +used in advertising or otherwise to promote the sale, use or other dealings +in this Software without prior written authorization from The Open Group. + +*/ +/* + * Copyright 1994 Network Computing Devices, Inc. + * + * Permission to use, copy, modify, distribute, and sell this software and + * its documentation for any purpose is hereby granted without fee, provided + * that the above copyright notice appear in all copies and that both that + * copyright notice and this permission notice appear in supporting + * documentation, and that the name Network Computing Devices, Inc. not be + * used in advertising or publicity pertaining to distribution of this + * software without specific, written prior permission. + * + * THIS SOFTWARE IS PROVIDED `AS-IS'. NETWORK COMPUTING DEVICES, INC., + * DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING WITHOUT + * LIMITATION ALL IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A + * PARTICULAR PURPOSE, OR NONINFRINGEMENT. IN NO EVENT SHALL NETWORK + * COMPUTING DEVICES, INC., BE LIABLE FOR ANY DAMAGES WHATSOEVER, INCLUDING + * SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES, INCLUDING LOSS OF USE, DATA, + * OR PROFITS, EVEN IF ADVISED OF THE POSSIBILITY THEREOF, AND REGARDLESS OF + * WHETHER IN AN ACTION IN CONTRACT, TORT OR NEGLIGENCE, ARISING OUT OF OR IN + * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + * + */ +/* $XFree86$ */ + +#ifndef _ATOMCACHE_H_ +#define _ATOMCACHE_H_ + +#define AtomPreInternFlag 0x1 +#define AtomWMCacheFlag 0x2 +#define AtomNoCacheFlag 0x4 + +typedef struct { + unsigned char flags; + int len; + char *name; +} AtomControlRec, *AtomControlPtr; + +typedef struct _AtomList { + char *name; + unsigned char flags; + int len; + int hash; + Atom atom; +} AtomListRec, *AtomListPtr; + +#define DEF_KEEP_PROP_SIZE 8 + +extern int min_keep_prop_size; + +extern Atom LbxMakeAtom( + XServerPtr /*server*/, + char * /*string*/, + unsigned /*len*/, + Atom /*atom*/, + int /*makeit*/ +); + +extern char *NameForAtom( + XServerPtr /*server*/, + Atom /*atom*/ +); + +extern unsigned FlagsForAtom( + XServerPtr /*server*/, + Atom /*atom*/ +); + +extern void FreeAtoms( + void +); + +#endif /* _ATOMCACHE_H_ */ diff --git a/app/lbxproxy/include/cache.h b/app/lbxproxy/include/cache.h new file mode 100644 index 000000000..c8ffdff03 --- /dev/null +++ b/app/lbxproxy/include/cache.h @@ -0,0 +1,114 @@ +/* $Xorg: cache.h,v 1.4 2001/02/09 02:05:32 xorgcvs Exp $ */ +/* +Copyright 1994, 1998 The Open Group + +Permission to use, copy, modify, distribute, and sell this software and its +documentation for any purpose is hereby granted without fee, provided that +the above copyright notice appear in all copies and that both that +copyright notice and this permission notice appear in supporting +documentation. + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR +OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the name of The Open Group shall +not be used in advertising or otherwise to promote the sale, use or +other dealings in this Software without prior written authorization +from The Open Group. + +*/ +/* + * Copyright 1990, 1991 Network Computing Devices; + * Portions Copyright 1987 by Digital Equipment Corporation + * + * Permission to use, copy, modify, distribute, and sell this software and its + * documentation for any purpose is hereby granted without fee, provided that + * the above copyright notice appear in all copies and that both that + * copyright notice and this permission notice appear in supporting + * documentation, and that the names of Network Computing Devices + * or Digital not be used in advertising or + * publicity pertaining to distribution of the software without specific, + * written prior permission. Network Computing Devices and Digital + * make no representations about the + * suitability of this software for any purpose. It is provided "as is" + * without express or implied warranty. + * + * NETWORK COMPUTING DEVICES AND DIGITAL DISCLAIM ALL WARRANTIES WITH + * REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY + * AND FITNESS, IN NO EVENT SHALL NETWORK COMPUTING DEVICES OR DIGITAL BE + * LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION + * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN + * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + * + */ +/* $XFree86$ */ + +#ifndef _CACHE_H_ +#define _CACHE_H_ + +#define CacheWasReset 1 +#define CacheEntryFreed 2 +#define CacheEntryOld 3 + +#define MAX_NUM_CACHES 2 + +typedef unsigned long CacheID; +typedef unsigned long Cache; +typedef void (*CacheFree) (); + +typedef struct _cache *CachePtr; + +extern Cache CacheInit( + XServerPtr /*server*/, + unsigned long /*maxsize*/ +); + +extern void CacheFreeCache( + XServerPtr /*server*/, + Cache /*cid*/ +); + +extern Bool CacheTrimNeeded( + XServerPtr /*server*/, + Cache /*cid*/ +); + +extern void CacheTrim( + XServerPtr /*server*/, + Cache /*cid*/ +); + +extern Bool CacheStoreMemory( + XServerPtr /*server*/, + Cache /*cid*/, + CacheID /*id*/, + pointer /*data*/, + unsigned long /*size*/, + CacheFree /*free_func*/, + Bool /*can_flush*/ +); + +extern pointer CacheFetchMemory( + XServerPtr /*server*/, + Cache /*cid*/, + CacheID /*id*/, + Bool /*update*/ +); + +extern void CacheFreeMemory( + XServerPtr /*server*/, + Cache /*cacheid*/, + CacheID /*cid*/, + Bool /*notify*/ +); + +#endif /* _CACHE_H_ */ diff --git a/app/lbxproxy/include/colormap.h b/app/lbxproxy/include/colormap.h new file mode 100644 index 000000000..425abd279 --- /dev/null +++ b/app/lbxproxy/include/colormap.h @@ -0,0 +1,283 @@ +/* $Xorg: colormap.h,v 1.4 2001/02/09 02:05:32 xorgcvs Exp $ */ +/* + +Copyright 1998 The Open Group + +Permission to use, copy, modify, distribute, and sell this software and its +documentation for any purpose is hereby granted without fee, provided that +the above copyright notice appear in all copies and that both that +copyright notice and this permission notice appear in supporting +documentation. + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the name of The Open Group shall not be +used in advertising or otherwise to promote the sale, use or other dealings +in this Software without prior written authorization from The Open Group. + +*/ +/* + * Copyright 1994 Network Computing Devices, Inc. + * + * Permission to use, copy, modify, distribute, and sell this software and + * its documentation for any purpose is hereby granted without fee, provided + * that the above copyright notice appear in all copies and that both that + * copyright notice and this permission notice appear in supporting + * documentation, and that the name Network Computing Devices, Inc. not be + * used in advertising or publicity pertaining to distribution of this + * software without specific, written prior permission. + * + * THIS SOFTWARE IS PROVIDED `AS-IS'. NETWORK COMPUTING DEVICES, INC., + * DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING WITHOUT + * LIMITATION ALL IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A + * PARTICULAR PURPOSE, OR NONINFRINGEMENT. IN NO EVENT SHALL NETWORK + * COMPUTING DEVICES, INC., BE LIABLE FOR ANY DAMAGES WHATSOEVER, INCLUDING + * SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES, INCLUDING LOSS OF USE, DATA, + * OR PROFITS, EVEN IF ADVISED OF THE POSSIBILITY THEREOF, AND REGARDLESS OF + * WHETHER IN AN ACTION IN CONTRACT, TORT OR NEGLIGENCE, ARISING OUT OF OR IN + * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + * + */ +/* $XFree86: xc/programs/lbxproxy/include/colormap.h,v 1.6 2001/12/14 20:00:55 dawes Exp $ */ + +#ifndef COLORMAP_H_ +#define COLORMAP_H_ + +typedef struct _rgbentry { + char *name; + int namelen; + VisualID visual; + CARD16 xred, + xblue, + xgreen; /* exact */ + CARD16 vred, + vblue, + vgreen; /* visual */ +} RGBEntryRec, *RGBEntryPtr; + +typedef struct _RGBEntry { + struct _RGBEntry *next; + RGBEntryRec color; +} RGBCacheEntryRec, *RGBCacheEntryPtr; + +#define NBUCKETS 16 + +typedef CARD32 Pixel; + +#define PIXEL_FREE 0 +#define PIXEL_PRIVATE 1 +#define PIXEL_SHARED 2 + +typedef struct _entry { + CARD16 red, + green, + blue; + char status; + char server_ref; + int refcnt; + Pixel pixel; +} Entry; + + +#define CMAP_NOT_GRABBED 0 +#define CMAP_GRAB_REQUESTED 1 +#define CMAP_GRABBED 2 + +#define DynamicClass 1 + +typedef struct _visual { + int class; + VisualID id; + int depth; + int bitsPerRGB; + int colormapEntries; + CARD32 redMask, greenMask, blueMask; + int offsetRed, offsetGreen, offsetBlue; +} LbxVisualRec, *LbxVisualPtr; + +#define NUMRED(pv) (((pv)->redMask >> (pv)->offsetRed) + 1) +#define NUMGREEN(pv) (((pv)->greenMask >> (pv)->offsetGreen) + 1) +#define NUMBLUE(pv) (((pv)->blueMask >> (pv)->offsetBlue) + 1) +#define REDPART(pv,pix) (((pix) & (pv)->redMask) >> (pv)->offsetRed) +#define GREENPART(pv,pix) (((pix) & (pv)->greenMask) >> (pv)->offsetGreen) +#define BLUEPART(pv,pix) (((pix) & (pv)->blueMask) >> (pv)->offsetBlue) + +typedef struct _cmap { + Colormap id; + LbxVisualPtr pVisual; + Bool grab_status; + Entry *red; + Entry *green; + Entry *blue; + int *numPixelsRed; + int *numPixelsGreen; + int *numPixelsBlue; + Pixel **clientPixelsRed; + Pixel **clientPixelsGreen; + Pixel **clientPixelsBlue; +} ColormapRec, *ColormapPtr; + + +extern void (* LbxResolveColor)( + LbxVisualPtr /* pVisual */, + CARD16* /* red */, + CARD16* /* green */, + CARD16* /* blue */ +); + +extern void ResolveColor( + LbxVisualPtr /* pVisual */, + CARD16* /* red */, + CARD16* /* green */, + CARD16* /* blue */ +); + +extern Pixel (* LbxFindFreePixel)( + ColormapPtr /* pmap */, + CARD32 /* red */, + CARD32 /* green */, + CARD32 /* blue */ +); + +extern Pixel FindFreePixel( + ColormapPtr /* pmap */, + CARD32 /* red */, + CARD32 /* green */, + CARD32 /* blue */ +); + +extern Entry * (* LbxFindBestPixel)( + ColormapPtr /* pmap */, + CARD32 /* red */, + CARD32 /* green */, + CARD32 /* blue */, + int /* channels */ +); + +extern Entry * FindBestPixel( + ColormapPtr /* pmap */, + CARD32 /* red */, + CARD32 /* green */, + CARD32 /* blue */, + int /* channels */ +); + +extern void ReleaseCmap( + ClientPtr /* client */, + ColormapPtr /* pmap */ +); + +extern int CreateColormap( + ClientPtr /*client*/, + Colormap /*cmap*/, + VisualID /*visual*/ +); + +extern int FreeColormap( + ClientPtr /*client*/, + Colormap /*cmap*/ +); + +extern int CreateVisual( + int /*depth*/, + xVisualType * /*vis*/ +); + +extern LbxVisualPtr GetVisual( + VisualID /*vid*/ +); + +extern Bool InitColors( + void +); + +extern RGBEntryPtr FindColorName( + XServerPtr /*server*/, + char * /*name*/, + int /*len*/, + LbxVisualPtr /*pVisual*/ +); + +extern Bool AddColorName( + XServerPtr /*server*/, + char * /*name*/, + int /*len*/, + RGBEntryRec * /*rgbe*/ +); + +extern void FreeColors( + void +); + +extern int DestroyColormap( + ClientPtr /*client*/, + pointer /*pmap*/, + XID /*id*/ +); + +extern int FindPixel( + ClientPtr /*client*/, + ColormapPtr /*pmap*/, + CARD32 /*red*/, + CARD32 /*green*/, + CARD32 /*blue*/, + Entry ** /*pent*/ +); + +extern int IncrementPixel( + ClientPtr /*pclient*/, + ColormapPtr /*pmap*/, + Entry * /*pent*/, + Bool /*from_server*/ +); + +extern int AllocCell( + ClientPtr /*pclient*/, + ColormapPtr /*pmap*/, + Pixel /*pixel*/ +); + +extern int StorePixel( + ClientPtr /*client*/, + ColormapPtr /*pmap*/, + CARD32 /*red*/, + CARD32 /*green*/, + CARD32 /*blue*/, + Pixel /*pixel*/, + Bool /*from_server*/ +); + +extern void GotServerFreeCellsEvent( + ColormapPtr /* pmap */, + Pixel /* pixel_start */, + Pixel /* pixel_end */ +); + +extern void FreeAllClientPixels( + ColormapPtr /* pmap */, + int /* client */ +); + +extern int FreeClientPixels( + ClientPtr /*client*/, + pointer /*pcr*/, + XID /*id*/ +); + +extern int FreePixels( + ClientPtr /*client*/, + ColormapPtr /*pmap*/, + int /*num*/, + Pixel * /*pixels*/, + Pixel /*mask*/ +); + +#endif /* COLORMAP_H_ */ diff --git a/app/lbxproxy/include/init.h b/app/lbxproxy/include/init.h new file mode 100644 index 000000000..2ac786eff --- /dev/null +++ b/app/lbxproxy/include/init.h @@ -0,0 +1,74 @@ +/* $Xorg: init.h,v 1.4 2001/02/09 02:05:32 xorgcvs Exp $ */ +/* + +Copyright 1996, 1998 The Open Group + +Permission to use, copy, modify, distribute, and sell this software and its +documentation for any purpose is hereby granted without fee, provided that +the above copyright notice appear in all copies and that both that +copyright notice and this permission notice appear in supporting +documentation. + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the name of The Open Group shall not be +used in advertising or otherwise to promote the sale, use or other dealings +in this Software without prior written authorization from The Open Group. + +*/ +/* + * Copyright 1992 Network Computing Devices + * + * Permission to use, copy, modify, distribute, and sell this software and its + * documentation for any purpose is hereby granted without fee, provided that + * the above copyright notice appear in all copies and that both that + * copyright notice and this permission notice appear in supporting + * documentation, and that the name of NCD. not be used in advertising or + * publicity pertaining to distribution of the software without specific, + * written prior permission. NCD. makes no representations about the + * suitability of this software for any purpose. It is provided "as is" + * without express or implied warranty. + * + * NCD. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL NCD. + * BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION + * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN + * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + * + */ +/* $XFree86$ */ + +#ifndef _INIT_H_ +#define _INIT_H_ + +extern struct _XDisplay* DisplayOpen( + char * /*dpy_name*/, + int * /*request*/, + int * /*event*/, + int * /*error*/, + int * /*sequencep*/ +); + +extern int DisplayConnectionNumber( + struct _XDisplay* /* dpy */ +); + +extern void DisplayGetConnSetup ( + struct _XDisplay* /* dpy */, + xConnSetup** /* tag_data */, + int* /* len */, + int /* change_type */, + CARD32* /* changes */, + int /* change_len */ +); + +#endif diff --git a/app/lbxproxy/include/lbx.h b/app/lbxproxy/include/lbx.h new file mode 100644 index 000000000..130d7308a --- /dev/null +++ b/app/lbxproxy/include/lbx.h @@ -0,0 +1,648 @@ +/* $Xorg: lbx.h,v 1.4 2001/02/09 02:05:32 xorgcvs Exp $ */ +/* + +Copyright 1996, 1998 The Open Group + +Permission to use, copy, modify, distribute, and sell this software and its +documentation for any purpose is hereby granted without fee, provided that +the above copyright notice appear in all copies and that both that +copyright notice and this permission notice appear in supporting +documentation. + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the name of The Open Group shall not be +used in advertising or otherwise to promote the sale, use or other dealings +in this Software without prior written authorization from The Open Group. + +*/ +/* + * Copyright 1992 Network Computing Devices + * + * Permission to use, copy, modify, distribute, and sell this software and its + * documentation for any purpose is hereby granted without fee, provided that + * the above copyright notice appear in all copies and that both that + * copyright notice and this permission notice appear in supporting + * documentation, and that the name of NCD. not be used in advertising or + * publicity pertaining to distribution of the software without specific, + * written prior permission. NCD. makes no representations about the + * suitability of this software for any purpose. It is provided "as is" + * without express or implied warranty. + * + * NCD. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL NCD. + * BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION + * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN + * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + * + */ +/* $XFree86: xc/programs/lbxproxy/include/lbx.h,v 1.6 2001/12/14 20:00:55 dawes Exp $ */ + +#ifndef _LBX_H_ +#define _LBX_H_ +#include "misc.h" +#include "os.h" +#include "util.h" +#include + +/* we keep the ifdefs in the code as a guide to what's going on */ +/* but we want the proxy to work with all possible servers */ +#ifndef BIGREQS +#define BIGREQS +#endif + +/* cache stuff */ +#define MAX_ATOM_LENGTH 256 /* screw any large ones */ +#define MAX_COLORNAME_LENGTH 256 /* screw any large ones */ + + +typedef struct proptagdata { + Atom type; + int format; + int length; /* in bytes */ + pointer data; +} PropertyTagDataRec, *PropertyTagDataPtr; + +typedef struct _replystuff *ReplyStuffPtr; + +typedef Bool (*ReplyFunc)( + ClientPtr /*client*/, + ReplyStuffPtr /*nr*/, + char * /*data*/ +); + +typedef struct _replystuff { + int sequenceNumber; /* expected sequence number */ + int major; /* major opcode */ + int minor; /* minor opcode */ + ReplyFunc reply_func; /* function to handle reply */ + union { /* reply data */ + struct intern_data { + int len; + char str[MAX_ATOM_LENGTH]; + } xintern; + struct get_atom { + Atom atom; + } xgetatom; + struct colorname { + char name[MAX_COLORNAME_LENGTH]; + int namelen; + VisualID visual; + } xlookupcolor; + struct allocnamedcolor { + char name[MAX_COLORNAME_LENGTH]; + int namelen; + struct _cmap *pmap; + } xallocnamedcolor; + struct alloccolorcells { + struct _cmap *pmap; + } xalloccolorcells; + struct alloccolorplanes { + struct _cmap *pmap; + } xalloccolorplanes; + struct grabcmap { + struct _cmap *pmap; + Bool alloc_named; + CARD16 vred, + vgreen, + vblue; + CARD16 xred, + xgreen, + xblue; + } lbxgrabcmap; + struct getkeymap { + int count; + int first; + } lbxgetkeymap; + struct getprop { + CARD32 offset; + CARD32 length; + } lbxgetprop; + struct changeprop { + PropertyTagDataRec ptd; + } lbxchangeprop; + struct wingeom { + char got_geom_request; + char got_geom_reply; + CARD8 depth; + Window root B32; + INT16 x B16, y B16; + CARD16 width B16, height B16; + CARD16 borderWidth B16; + } lbxWinGeom; + struct queryextension { + char *name; + } lbxqueryextension; + struct getimage { +#ifdef LBX_STATS + Drawable drawable; + INT16 x; + INT16 y; +#endif + CARD16 width; + CARD16 height; + CARD8 format; + } lbxgetimage; + pointer lbxextensiondata; + } request_info; + ReplyStuffPtr next; +} ReplyStuffRec; + +typedef struct _replydata { + int dlen; + xReply reply; + pointer data; + int delay_seq_no; /* what seq i'm waiting for */ + struct _replydata *next; +} ReplyDataRec, *ReplyDataPtr; + + +#define LBX_LARGE_REQUEST_MIN_SIZE 1024 +#define LBX_LARGE_REQUEST_CHUNK_SIZE 512 + +#define LARGE_REQUEST_QUEUE_LEN 16 + +typedef struct { + ClientPtr client; + Bool compressed; + char *buf; + unsigned totalBytes; + unsigned bytesRead; + unsigned bytesWritten; +} LbxLargeRequestRec; + + +typedef struct _ClientPublic { + int (*writeToClient) (); + int (*uncompressedWriteToClient) (); + unsigned long (*requestLength) (); + int (*readRequest)(); +} ClientPublicRec, *ClientPublicPtr; + +typedef struct _Client { + int index; + XID ridBase; + XID ridMask; + pointer requestBuffer; + pointer osPrivate; /* for OS layer, including scheduler */ + Bool swapped; + void (*pSwapReplyFunc) ( + ClientPtr /* pClient */, + int /* size */, + void * /* pbuf */ +); + XID errorValue; + int sequence; + int closeDownMode; + int clientGone; + int noClientException; /* this client died or needs to be + * killed */ + XServerPtr server; + Drawable serverID; + GContext lastGCID; + pointer *saveSet; + int awaitingSetup; + int (**requestVector) ( + ClientPtr /* pClient */ +); + CARD32 req_len; /* length of current request */ + Bool big_requests; /* supports large requests */ + +#ifdef DEBUG +#define MAX_REQUEST_LOG 100 + unsigned char requestLog[MAX_REQUEST_LOG]; + int requestLogIndex; +#endif + + ClientPublicRec public; + int lbxIndex; + + Bool cache_safe; /* safe to short circuit request? */ + Bool can_delay_reply;/* safe to delay short-circuit request? */ + + int sequenceNumber; /* what we've seen */ + int sequence_lost; /* requests short-circuited */ + int lastForReply; /* last request with reply known coming */ + int lastForResponse;/* last request sent with event or reply */ + int lastResponse; /* last sequence number seen from server */ + + int yanked; /* total requests short-circuited */ + + KeyCode minKeyCode, + maxKeyCode; + + CARD8 imageByteOrder; /* LSBFirst, MSBFirst */ + CARD8 bitmapBitOrder; /* LeastSignificant, MostSign...*/ + CARD8 bitmapScanlineUnit, /* 8, 16, 32 */ + bitmapScanlinePad; /* 8, 16, 32 */ + CARD8 ZbitsPerPixel1; /* for ZPixmap depth 1 */ + Window rootWindow; /* root window of screen 0 */ + + ReplyStuffPtr replylist; /* list of pending replies */ + ReplyDataPtr replydata; /* list of delayed short-circuited replies */ + Drawable drawableCache[GFX_CACHE_SIZE]; + GContext gcontextCache[GFX_CACHE_SIZE]; + + LbxLargeRequestRec *largeRequest; + +} ClientRec; + + +#define WriteToClient(client,len,buf) (((client)->public.writeToClient)(client,len,buf)) +#define ReadRequestFromClient(client) ((client)->public.readRequest(client)) +#define RequestLength(r,client,g,p) (*(client)->public.requestLength) (r,client,g,p) + +#define LBXSequenceNumber(client) ((client->sequenceNumber) & 0xffff) +#define LBXCacheSafe(client) (client->cache_safe) +#define LBXCanDelayReply(client) (client->can_delay_reply) +#define LBXSequenceLost(client) (client->sequence_lost) +#define LBXYanked(client) (client->yanked) +#define LBXLastForReply(client) (client->lastForReply) +#define LBXLastForResponse(client) (client->lastForResponse) +#define LBXLastResponse(client) (client->lastResponse) +#define LBXReplyList(client) (client->replylist) +#define LBXReplyData(client) (client->replydata) +#define LBXMinKeyCode(client) (client->minKeyCode) +#define LBXMaxKeyCode(client) (client->maxKeyCode) +#define LBXImageByteOrder(client) (client->imageByteOrder) +#define LBXBitmapBitOrder(client) (client->bitmapBitOrder) +#define LBXBitmapScanlineUnit(client) (client->bitmapScanlineUnit) +#define LBXBitmapScanlinePad(client) (client->bitmapScanlinePad) +#define LBXZBitsPerPixel1(client) (client->ZbitsPerPixel1) +#define LBXRootWindow(client) (client->rootWindow) +#define LBXDrawableCache(client)(client->drawableCache) +#define LBXGContextCache(client)(client->gcontextCache) + +extern ClientPtr *clients; +#define MAXCLIENTS 128 +#define NullClient ((ClientPtr) 0) +extern int currentMaxClients; + +extern LbxLargeRequestRec *largeRequestQueue[]; +extern int numLargeRequestsInQueue; + +/* + * Notes on request short-circuiting + * + * X guarentees that any replies, events or errors generated by a + * previous request will be sent before those of a later request. + * this means that any requests that can be handled by the proxy + * must have their reply sent after any previous events or errors. + * + * there are 3 possible stages implemented here: + * + * - fully correct protocol, where nothing can be out of order + * - mostly correct protocol, where only errors can be out of order + * - poor protocol, where events & errors can be out of order + * + * for most applications, poor is 'good enough', because they don't + * depend on events coming in order, and instead let Xlib do + * the work. + * + * depending on the type of protocol being used, the cache_safe + * flag in the ClientRec will be set appropriately, and if TRUE, + * the proxy is cleared to short-circuit a request. + * + * for full correct protocol, the flag is set if the previous request + * was a round trip and the reply has come back. + * + * for a mostly correct protocol, the flag is set for the above + * case, and for requests that can generate only errors (mostly + * graphics) + * + * for a 'good enough' protocol, the flag is always on, and we let + * the client sort things out. + * + * (note than in no case do we allow replies to come out of order.) + * + * + * Note on Xlib's handling of sequences: + * + * Xlib usually waits for the reply to sync request before + * issuing another -- its archetecture depends on it. However, + * this is not required. Xlib itself misses this in at least one + * case (XGetWindowAttributes, which uses both the GetWindowAttributes + * and GetGeometry requests). + * + * The upshot is that the proxy has to be able to handle seeing + * another request before it receives an expected reply. + * + * this means we can't assume a single pending reply, but many. + * currently these get tacked onto a list. + * + * + * Notes on how the proxy attempts to solve all of this: + * + * There are 4 request that it will attempt to short-circuit: + * InternAtom, GetAtomName, LookupColor, AllocColor, and AllocNamedColor. + * All the code to do this is in lbxfuncs.c, and all of it works in + * essentially the same way -- whenever possible, it will try to respond + * to the client without sending the request all the way to the X server. + * The goal is to remove a roudn-trip entirely -- even though not a lot of data + * is involved, remving the roundtrip can make this useful. + + * Unfortunately, figuring out *when* its safe is very nasty. First + * there are all the possibile stages outlined above. If the proxy + * isn't waiting, thinking there might be pending data, it can always + * short-circuit the request. However, this is the rare case. When + * the proxy can't immediately respond, it attempts to short-circuit anyways, + * delaying the reply until whatever it was waiting on arrives. Often + * it can't -- if the most paranoid type of checking is turned on, it'll + * never work. The complex part occurs with loose checking. If it knows + * a reply is coming back, it can delay the short-circuit until it gets + * the reply. This works fine for the core protocol, but breaks down + * again for extensions -- to be safe, any unknown extensions are assumed + * to have replies -- but since they may never arrive, the delayed + * short-circuit can never be flushed. To avoid this, whether a reply + * has been guessed at is tracked, and this info is used to decide + * whether a short-circuit can be delayed -- if not, it always needs + * to do the full round-trip. + * + * The complexity really makes me wonder if this stuff is worth the effort... + */ + + +/* short-circuiting protocol */ + +#define PROTOCOL_FULL 0 /* DEFAULT - best w/ accuracy */ +#define PROTOCOL_MOST 1 /* cheat on errors */ +#define PROTOCOL_POOR 2 /* cheat on errors & events */ + +#undef DEBUG + +#undef TRACE + +/* possible states of request handlers. some requests are short-circuited + * (yanked), some are replaced with LBX requests, and some are let through + * unchanged + * + * any replaced request expecting a reply needs to be sure the sequence + * number isn't lagging before its sends its data + */ +#define REQ_PASSTHROUGH 0 /* pass through */ +#define REQ_YANK 1 /* completely remove, reply sent */ +#define REQ_YANKLATE 2 /* completely remove, reply not sent yet */ +#define REQ_REPLACE 3 /* replaced with 1way, reply sent */ +#define REQ_REPLACELATE 4 /* replaced with 1way, reply not sent yet */ + +/* + * size of motion event queue + * + * this specifies the maximum number of motion events that the server + * can spew out at once. the proxy will send it NUM_MOTION_EVENTS + * AllowMotion requests at startup, and then send a new one each time it + * processes a Motion event. this will prevent the wire from being + * swamped by MotionNotify. + */ + +/* XXX this should be a calculation based on the wire latency */ + +#define NUM_MOTION_EVENTS 8 + + +#ifdef LBX_STATS +extern int intern_good, + intern_miss; +extern int getatom_good, + getatom_miss; +extern int luc_good, + luc_miss; +extern int ac_good, + ac_miss; +extern int anc_good, + anc_miss; + +extern int getmodmap_tag, /* tag only */ + getmodmap_full; +extern int getkeymap_tag, /* tag only */ + getkeymap_full; +extern int queryfont_tag, /* tag only */ + queryfont_full; +extern int getsetup_tag, /* tag only */ + getsetup_full; + +extern int getprop_tag, + getprop_full; + +extern int tag_bytes_unsent; /* approx data kept off wire by tags */ + + +extern void DumpOtherStats(); +extern void ZeroOtherStats(); + +#endif /* LBX_STATS */ + +extern void DumpCompressionStats(); +extern void ZeroCompressionStats(); + +/* tables.c */ +extern int ProcLBXInternAtom( + ClientPtr /*client*/ +); + +extern int ProcLBXGetAtomName( + ClientPtr /*client*/ +); + +extern int ProcLBXCreateColormap( + ClientPtr /*client*/ +); + +extern int ProcLBXAllocColor( + ClientPtr /*client*/ +); + +extern int ProcLBXAllocNamedColor( + ClientPtr /*client*/ +); + +extern int ProcLBXFreeColormap( + ClientPtr /*client*/ +); + +extern int ProcLBXCopyColormapAndFree( + ClientPtr /*client*/ +); + +extern int ProcLBXFreeColors( + ClientPtr /*client*/ +); + +extern int ProcLBXLookupColor( + ClientPtr /*client*/ +); + +extern int ProcLBXGetModifierMapping( + ClientPtr /*client*/ +); + +extern int ProcLBXGetKeyboardMapping( + ClientPtr /*client*/ +); + +extern int ProcLBXQueryFont( + ClientPtr /*client*/ +); + +extern void FinishLBXRequest( + ClientPtr /*client*/, + int /*yank*/ +); + +extern void DoLBXReply( + ClientPtr /*client*/, + char * /*data*/, + int /*len*/ +); + +extern void WriteError( + ClientPtr /*client*/, + unsigned /*int majorCode*/, + unsigned /*int minorCode*/, + XID /*resId*/, + int /*errorCode*/ +); + +extern void SendLbxSync( + ClientPtr /*client*/ +); + +/* dispatch.c */ + +extern int Dispatch( + void +); + +extern void SendErrorToClient( + ClientPtr /*client*/, + unsigned int /*majorCode*/, + unsigned int /*minorCode*/, + XID /*resId*/, + int /*errorCode*/ +); + +extern ClientPtr NextAvailableClient( + pointer /*ospriv*/, + int /* connect_fd */ /* the fd the client connected on */ +); + +extern int ProcInitialConnection( + ClientPtr /*client*/ +); + +extern int ProcEstablishConnection( + ClientPtr /*client*/ +); + +extern void CloseDownClient( + ClientPtr /*client*/ +); + +extern int ProcStandardRequest( + ClientPtr /*client*/ +); + +extern int ProcBadRequest( + ClientPtr /*client*/ +); + +extern void AdjustProcVector( + void +); + +/* lbxutil.c */ + +extern ReplyStuffPtr NewReply( + ClientPtr /*client*/, + int /*major*/, + int /*minor*/, + ReplyFunc /*reply_func*/ +); + +extern void RemoveReply( + ClientPtr /*client*/, + ReplyStuffPtr /*rp*/ +); + +extern ReplyStuffPtr GetMatchingReply( + ClientPtr /*client*/, + int /*seqno*/, + Bool /*flush_older*/ +); + +extern Bool AnyReplies( + ClientPtr /*client*/ +); + +extern Bool SaveReplyData( + ClientPtr /*client*/, + xReply * /*rep*/, + int /*len*/, + pointer /*data*/ +); + +extern Bool FlushDelayedReplies( + ClientPtr /*client*/ +); + +extern void BumpSequence( + ClientPtr /*client*/ +); + +extern void ForceSequenceUpdate( + ClientPtr /*client*/ +); + +extern void LbxFreeTag( + XServerPtr /*server*/, + XID /*tag*/, + int /*tagtype*/ +); + +extern void LbxSendTagData( + ClientPtr /*client*/, + XID /*tag*/, + int /*tagtype*/ +); + +extern void SendInitLBXPackets( + XServerPtr /*server*/ +); + +extern void LbxCleanupSession( + void +); + +/* unsquish.c */ + +extern int EventLength( + xEvent * /*ev*/, + Bool /* squish */ +); + +extern Bool UnsquishEvent( + xReply * /*rep*/, + xEvent * /*ev*/, + int * /*lenp*/ +); + +/* props.c */ + +extern int ProcLBXChangeProperty( + ClientPtr /*client*/ +); + +extern int ProcLBXGetProperty( + ClientPtr /*client*/ +); + +#endif diff --git a/app/lbxproxy/include/lbxext.h b/app/lbxproxy/include/lbxext.h new file mode 100644 index 000000000..637ec04e6 --- /dev/null +++ b/app/lbxproxy/include/lbxext.h @@ -0,0 +1,134 @@ +/* $Xorg: lbxext.h,v 1.4 2001/02/09 02:05:32 xorgcvs Exp $ */ +/* + +Copyright 1996, 1998 The Open Group + +Permission to use, copy, modify, distribute, and sell this software and its +documentation for any purpose is hereby granted without fee, provided that +the above copyright notice appear in all copies and that both that +copyright notice and this permission notice appear in supporting +documentation. + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the name of The Open Group shall not be +used in advertising or otherwise to promote the sale, use or other dealings +in this Software without prior written authorization from The Open Group. + +*/ +/* + * Copyright 1994 Network Computing Devices, Inc. + * + * Permission to use, copy, modify, distribute, and sell this software and + * its documentation for any purpose is hereby granted without fee, provided + * that the above copyright notice appear in all copies and that both that + * copyright notice and this permission notice appear in supporting + * documentation, and that the name Network Computing Devices, Inc. not be + * used in advertising or publicity pertaining to distribution of this + * software without specific, written prior permission. + * + * THIS SOFTWARE IS PROVIDED `AS-IS'. NETWORK COMPUTING DEVICES, INC., + * DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING WITHOUT + * LIMITATION ALL IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A + * PARTICULAR PURPOSE, OR NONINFRINGEMENT. IN NO EVENT SHALL NETWORK + * COMPUTING DEVICES, INC., BE LIABLE FOR ANY DAMAGES WHATSOEVER, INCLUDING + * SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES, INCLUDING LOSS OF USE, DATA, + * OR PROFITS, EVEN IF ADVISED OF THE POSSIBILITY THEREOF, AND REGARDLESS OF + * WHETHER IN AN ACTION IN CONTRACT, TORT OR NEGLIGENCE, ARISING OUT OF OR IN + * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + * + */ +/* $XFree86$ */ + +#ifndef _LBXEXT_H_ +#define _LBXEXT_H_ + +typedef int (*ExtensionRequests) ( + ClientPtr /*client*/ +); +typedef int (*ExtensionReplies) ( + ClientPtr /*client*/ +); +typedef int (*ExtensionEvents) ( + ClientPtr /*client*/ +); +typedef int (*ExtensionErrors) ( + ClientPtr /*client*/ +); +typedef int (*SExtensionRequests) ( + ClientPtr /*client*/ +); +typedef int (*SExtensionReplies) ( + ClientPtr /*client*/ +); +typedef int (*SExtensionEvents) ( + ClientPtr /*client*/ +); +typedef int (*SExtensionErrors) ( + ClientPtr /*client*/ +); + +typedef struct _vectors { + char *name; + ExtensionRequests req_vector; + ExtensionReplies rep_vector; + ExtensionEvents ev_vector; + ExtensionErrors err_vector; + SExtensionRequests sreq_vector; +} ExtensionVectors; + +extern int (*ProcVector[256]) ( + ClientPtr /*client*/ +); +extern int (*SwappedProcVector[256]) ( + ClientPtr /*client*/ +); + +typedef struct _LbxQueryExtensionReply *xLbxQueryExtensionReplyPtr; + +extern void DeleteExtensions( + XServerPtr /*server*/ +); + +typedef struct _replystuff *_ReplyStuffPtr; + +extern void HandleExtensionError( + ClientPtr /*client*/, + xError * /*err*/, + _ReplyStuffPtr /*nr*/ +); + +extern void HandleExtensionEvent( + ClientPtr /*client*/, + xEvent * /*ev*/ +); + +extern Bool HandleExtensionReply( + ClientPtr /*client*/, + xReply * /*reply*/, + _ReplyStuffPtr * /*nr*/ +); + +extern Bool CheckExtensionForEvents( + ClientPtr /*client*/, + xReq * /*req*/ +); + +extern Bool CheckExtensionForReplies( + ClientPtr /*client*/, + xReq * /*req*/ +); + +extern int ProcLBXQueryExtension( + ClientPtr /*client*/ +); + +#endif /* _LBXEXT_H_ */ diff --git a/app/lbxproxy/include/misc.h b/app/lbxproxy/include/misc.h new file mode 100644 index 000000000..3b7ee483b --- /dev/null +++ b/app/lbxproxy/include/misc.h @@ -0,0 +1,119 @@ +/* $Xorg: misc.h,v 1.4 2001/02/09 02:05:32 xorgcvs Exp $ */ +/* $XdotOrg: $ */ + +/* + +Copyright 1995, 1998 The Open Group + +Permission to use, copy, modify, distribute, and sell this software and its +documentation for any purpose is hereby granted without fee, provided that +the above copyright notice appear in all copies and that both that +copyright notice and this permission notice appear in supporting +documentation. + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR +OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the name of The Open Group shall +not be used in advertising or otherwise to promote the sale, use or +other dealings in this Software without prior written authorization +from The Open Group. + +*/ +/* $XFree86: xc/programs/lbxproxy/include/misc.h,v 1.6 2001/08/01 00:45:01 tsi Exp $ */ + +#ifndef MISC_H +#define MISC_H 1 + +#define NEED_EVENTS +#define NEED_REPLIES +#include +#include +#include +#include +#define ALLOCATE_LOCAL_FALLBACK(_size) Xalloc(_size) +#define DEALLOCATE_LOCAL_FALLBACK(_ptr) Xfree(_ptr) +#include +#include +#include +#include + +#ifndef TRUE +#define FALSE 0 +#define TRUE 1 +#endif +typedef struct _XServer *XServerPtr; + +#include +#define DE_RESET 1 +#define DE_TERMINATE 2 +#define MILLI_PER_SECOND (1000) + +/* XXX globals.h? */ +extern int nextFreeClientID; +extern int nClients; +extern char *display_name; +extern volatile char dispatchException; +extern volatile char isItTimeToYield; +extern int MaxClients; + +/* The following byte swapping tools are duplicated in several places. + * Do they deserve their own header file? What else would logically go in + * such a header? + */ + +/* byte swap a 32-bit literal */ +#define lswapl(x) ((((x) & 0xff) << 24) |\ + (((x) & 0xff00) << 8) |\ + (((x) & 0xff0000) >> 8) |\ + (((x) >> 24) & 0xff)) + +/* byte swap a short literal */ +#define lswaps(x) ((((x) & 0xff) << 8) | (((x) >> 8) & 0xff)) + +/* byte swap a 32-bit value */ +#define swapl(x, n) { \ + n = ((char *) (x))[0];\ + ((char *) (x))[0] = ((char *) (x))[3];\ + ((char *) (x))[3] = n;\ + n = ((char *) (x))[1];\ + ((char *) (x))[1] = ((char *) (x))[2];\ + ((char *) (x))[2] = n; } + +/* byte swap a short */ +#define swaps(x, n) { \ + n = ((char *) (x))[0];\ + ((char *) (x))[0] = ((char *) (x))[1];\ + ((char *) (x))[1] = n; } + +/* copy 32-bit value from src to dst byteswapping on the way */ +#define cpswapl(src, dst) { \ + ((char *)&(dst))[0] = ((char *) &(src))[3];\ + ((char *)&(dst))[1] = ((char *) &(src))[2];\ + ((char *)&(dst))[2] = ((char *) &(src))[1];\ + ((char *)&(dst))[3] = ((char *) &(src))[0]; } + +/* copy short from src to dst byteswapping on the way */ +#define cpswaps(src, dst) { \ + ((char *) &(dst))[0] = ((char *) &(src))[1];\ + ((char *) &(dst))[1] = ((char *) &(src))[0]; } + +#define min(a, b) (((a) < (b)) ? (a) : (b)) +#define lowbit(x) ((x) & (~(x) + 1)) + +#define REQUEST(type) \ + register type *stuff = (type *)client->requestBuffer + +#define REQUEST_SIZE_MATCH(req) \ + if ((sizeof(req) >> 2) != client->req_len) \ + return (BadLength) + +#endif diff --git a/app/lbxproxy/include/os.h b/app/lbxproxy/include/os.h new file mode 100644 index 000000000..4f58fe588 --- /dev/null +++ b/app/lbxproxy/include/os.h @@ -0,0 +1,220 @@ +/* $Xorg: os.h,v 1.4 2001/02/09 02:05:32 xorgcvs Exp $ */ + +/* + +Copyright 1995, 1998 The Open Group + +Permission to use, copy, modify, distribute, and sell this software and its +documentation for any purpose is hereby granted without fee, provided that +the above copyright notice appear in all copies and that both that +copyright notice and this permission notice appear in supporting +documentation. + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR +OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the name of The Open Group shall +not be used in advertising or otherwise to promote the sale, use or +other dealings in this Software without prior written authorization +from The Open Group. + +*/ +/* $XFree86: xc/programs/lbxproxy/include/os.h,v 1.7 2001/12/14 20:00:55 dawes Exp $ */ + +#ifndef OS_H +#define OS_H + +#include + +extern fd_set AllSockets; +extern fd_set AllClients; +extern fd_set LastSelectMask; +extern fd_set WellKnownConnections; +extern fd_set ClientsWithInput; +extern fd_set ClientsWriteBlocked; +extern fd_set OutputPending; + +/* WaitFor.c */ + +extern int WaitForSomething( + int * /*pClientsReady*/, + Bool /* poll */ +); + +/* connection.c */ + +extern Bool NewOutputPending; +extern Bool AnyClientsWriteBlocked; +extern int GrabInProgress; + +extern void InitConnectionLimits( + void +); + +extern void CreateServerSockets( + int * /*listen_fds[]*/ +); + +extern void CloseServerSockets( + void +); + +extern void CreateWellKnownSockets( + void +); + +extern void ListenToProxyManager ( + void +); + +extern void ListenWellKnownSockets ( + void +); + +extern void ResetWellKnownSockets( + void +); + +extern void AvailableClientInput( + ClientPtr /*client*/ +); + +extern ClientPtr AllocNewConnection( + int /*fd*/, /* the fd to the display */ + int /*connect_fd*/, /* the fd the client connected on */ + Bool /*to_server*/, + XtransConnInfo /*trans_conn*/ +); + +extern void SwitchConnectionFuncs( + ClientPtr /*client*/, + int (* /*Read*/)(), + int (* /*Writev*/)() +); + +extern void StartOutputCompression( + ClientPtr /*client*/, + void (* /*CompressOn*/)(), + void (* /*CompressOff*/)() +); + +extern Bool EstablishNewConnections( + ClientPtr /*clientUnused*/, + pointer /*closure*/ +); + +extern void CloseDownFileDescriptor( + ClientPtr /*client*/ +); + +extern void CheckConnections( + void +); + +extern void CloseDownConnection( + ClientPtr /*client*/ +); + +extern void OnlyListenToOneClient( + ClientPtr /*client*/ +); + +extern void ListenToAllClients( + void +); + +extern void IgnoreClient( + ClientPtr /*client*/ +); + +extern void AttendClient( + ClientPtr /*client*/ +); + +extern void MakeClientGrabImpervious( + ClientPtr /*client*/ +); + +extern void MakeClientGrabPervious( + ClientPtr /*client*/ +); + +/* io.c */ + +extern unsigned long StandardRequestLength( + xReq * /*req*/, + ClientPtr /*client*/, + int /*got*/, + Bool * /*partp*/ +); + +extern int StandardReadRequestFromClient( + ClientPtr /*client*/ +); + +extern int PendingClientOutput( + ClientPtr /*client*/ +); + +extern int CheckPendingClientInput( + ClientPtr /*client*/ +); + +extern void MarkConnectionWriteBlocked( + ClientPtr /*client*/ +); + +extern int BytesInClientBuffer( + ClientPtr /*client*/ +); + +extern void SkipInClientBuffer( + ClientPtr /*client*/, + int /*nbytes*/, + int /*lenLastReq*/ +); + +extern Bool InsertFakeRequest( + ClientPtr /*client*/, + char * /*data*/, + int /*count*/ +); + +extern void ResetCurrentRequest( + ClientPtr /*client*/ +); + +extern void FlushAllOutput( + void +); +extern int StandardWriteToClient( + ClientPtr /*who*/, + int /*count*/, + char * /*buf*/ +); + +extern int UncompressWriteToClient( + ClientPtr /*who*/, + int /*count*/, + char * /*buf*/ +); + +extern void ResetOsBuffers( + void +); + +/* osinit.c */ + +extern void OsInit( + void +); + +#endif diff --git a/app/lbxproxy/include/pm.h b/app/lbxproxy/include/pm.h new file mode 100644 index 000000000..95e71bd37 --- /dev/null +++ b/app/lbxproxy/include/pm.h @@ -0,0 +1,53 @@ +/* $Xorg: pm.h,v 1.4 2001/02/09 02:05:32 xorgcvs Exp $ */ + +/* +Copyright 1996, 1998 The Open Group + +Permission to use, copy, modify, distribute, and sell this software and its +documentation for any purpose is hereby granted without fee, provided that +the above copyright notice appear in all copies and that both that +copyright notice and this permission notice appear in supporting +documentation. + +The above copyright notice and this permission notice shall be included +in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR +OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the name of The Open Group shall +not be used in advertising or otherwise to promote the sale, use or +other dealings in this Software without prior written authorization +from The Open Group. +*/ +/* $XFree86$ */ + +#include + +extern IceConn PM_iceConn; +extern int proxy_manager_fd; +extern Bool proxyMngr; + +extern Bool CheckForProxyManager ( + void +); + +extern void ConnectToProxyManager ( + void +); + +extern void SendGetProxyAddrReply ( + IceConn /*requestor_iceConn*/, + int /*status*/, + char * /*addr*/, + char * /*error*/ +); + +extern void HandleProxyManagerConnection ( + void +); diff --git a/app/lbxproxy/include/pmP.h b/app/lbxproxy/include/pmP.h new file mode 100644 index 000000000..6b9b3ba73 --- /dev/null +++ b/app/lbxproxy/include/pmP.h @@ -0,0 +1,117 @@ +/* $Xorg: pmP.h,v 1.4 2001/02/09 02:05:32 xorgcvs Exp $ */ + +/* +Copyright 1996, 1998 The Open Group + +Permission to use, copy, modify, distribute, and sell this software and its +documentation for any purpose is hereby granted without fee, provided that +the above copyright notice appear in all copies and that both that +copyright notice and this permission notice appear in supporting +documentation. + +The above copyright notice and this permission notice shall be included +in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR +OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the name of The Open Group shall +not be used in advertising or otherwise to promote the sale, use or +other dealings in this Software without prior written authorization +from The Open Group. +*/ + +/* Useful ICE message parsing macros */ + +/* + * Pad to a 64 bit boundary + */ +#define PAD64(_bytes) ((8 - ((unsigned int) (_bytes) % 8)) % 8) + +#define PADDED_BYTES64(_bytes) (_bytes + PAD64 (_bytes)) + +/* + * Number of 8 byte units in _bytes. + */ +#define WORD64COUNT(_bytes) (((unsigned int) ((_bytes) + 7)) >> 3) + +/* + * Compute the number of bytes for a STRING representation + */ +#define STRING_BYTES(_str) (2 + (_str ? strlen (_str) : 0) + \ + PAD64 (2 + (_str ? strlen (_str) : 0))) + +#define SKIP_STRING(_pBuf, _swap) \ +{ \ + CARD16 _len; \ + EXTRACT_CARD16 (_pBuf, _swap, _len); \ + _pBuf += _len; \ + if (PAD64 (2 + _len)) \ + _pBuf += PAD64 (2 + _len); \ +} + +/* + * STORE macros + */ +#define STORE_CARD16(_pBuf, _val) \ +{ \ + *((CARD16 *) _pBuf) = _val; \ + _pBuf += 2; \ +} + +#define STORE_STRING(_pBuf, _string) \ +{ \ + int _len = _string ? strlen (_string) : 0; \ + STORE_CARD16 (_pBuf, _len); \ + if (_len) { \ + memcpy (_pBuf, _string, _len); \ + _pBuf += _len; \ + } \ + if (PAD64 (2 + _len)) \ + _pBuf += PAD64 (2 + _len); \ +} + +/* + * EXTRACT macros + */ +#define EXTRACT_CARD16(_pBuf, _swap, _val) \ +{ \ + _val = *((CARD16 *) _pBuf); \ + _pBuf += 2; \ + if (_swap) \ + _val = lswaps (_val); \ +} + +#define EXTRACT_STRING(_pBuf, _swap, _string) \ +{ \ + CARD16 _len; \ + EXTRACT_CARD16 (_pBuf, _swap, _len); \ + _string = (char *) malloc (_len + 1); \ + memcpy (_string, _pBuf, _len); \ + _string[_len] = '\0'; \ + _pBuf += _len; \ + if (PAD64 (2 + _len)) \ + _pBuf += PAD64 (2 + _len); \ +} + +#define CHECK_AT_LEAST_SIZE(_iceConn, _majorOp, _minorOp, _expected_len, _actual_len, _severity) \ + if ((((_actual_len) - SIZEOF (iceMsg)) >> 3) > _expected_len) \ + { \ + _IceErrorBadLength (_iceConn, _majorOp, _minorOp, _severity); \ + return; \ + } + + +#define CHECK_COMPLETE_SIZE(_iceConn, _majorOp, _minorOp, _expected_len, _actual_len, _pStart, _severity) \ + if (((PADDED_BYTES64((_actual_len)) - SIZEOF (iceMsg)) >> 3) \ + != _expected_len) \ + { \ + _IceErrorBadLength (_iceConn, _majorOp, _minorOp, _severity); \ + IceDisposeCompleteMessage (iceConn, _pStart); \ + return; \ + } diff --git a/app/lbxproxy/include/proxyopts.h b/app/lbxproxy/include/proxyopts.h new file mode 100644 index 000000000..3d29ee267 --- /dev/null +++ b/app/lbxproxy/include/proxyopts.h @@ -0,0 +1,125 @@ +/* $Xorg: proxyopts.h,v 1.4 2001/02/09 02:05:32 xorgcvs Exp $ */ +/* + +Copyright 1998 The Open Group + +Permission to use, copy, modify, distribute, and sell this software and its +documentation for any purpose is hereby granted without fee, provided that +the above copyright notice appear in all copies and that both that +copyright notice and this permission notice appear in supporting +documentation. + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the name of The Open Group shall not be +used in advertising or otherwise to promote the sale, use or other dealings +in this Software without prior written authorization from The Open Group. + +*/ +/* + * Copyright 1994 Network Computing Devices, Inc. + * + * Permission to use, copy, modify, distribute, and sell this software and + * its documentation for any purpose is hereby granted without fee, provided + * that the above copyright notice appear in all copies and that both that + * copyright notice and this permission notice appear in supporting + * documentation, and that the name Network Computing Devices, Inc. not be + * used in advertising or publicity pertaining to distribution of this + * software without specific, written prior permission. + * + * THIS SOFTWARE IS PROVIDED `AS-IS'. NETWORK COMPUTING DEVICES, INC., + * DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING WITHOUT + * LIMITATION ALL IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A + * PARTICULAR PURPOSE, OR NONINFRINGEMENT. IN NO EVENT SHALL NETWORK + * COMPUTING DEVICES, INC., BE LIABLE FOR ANY DAMAGES WHATSOEVER, INCLUDING + * SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES, INCLUDING LOSS OF USE, DATA, + * OR PROFITS, EVEN IF ADVISED OF THE POSSIBILITY THEREOF, AND REGARDLESS OF + * WHETHER IN AN ACTION IN CONTRACT, TORT OR NEGLIGENCE, ARISING OUT OF OR IN + * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + * + */ +/* $XFree86$ */ + +#ifndef _LBX_PROXYOPTS_H_ +#define _LBX_PROXYOPTS_H_ + +#include +#include + +typedef struct _LbxNegOpts { + short proxyDeltaN; + short proxyDeltaMaxLen; + short serverDeltaN; + short serverDeltaMaxLen; + LbxStreamOpts streamOpts; + int numBitmapCompMethods; + char *bitmapCompMethods; /* array of indices returned by server*/ + int numPixmapCompMethods; + char *pixmapCompMethods; /* array of indices returned by server*/ + Bool squish; + Bool useTags; +} LbxNegOptsRec; + +typedef LbxNegOptsRec *LbxNegOptsPtr; + +extern LbxNegOptsRec lbxNegOpt; + +/* options.c */ + +extern void LbxOptInit( + XServerPtr /*server*/ +); + +extern int LbxOptBuildReq( + XServerPtr /*server*/, + char * /*buf*/ +); + +extern int LbxOptParseReply( + XServerPtr /*server*/, + int /*nopts*/, + unsigned char * /*preply*/, + int /*replylen*/ +); + +extern void LbxNoDelta( + void +); + +extern void LbxNoComp( + void +); + +extern void LbxNoSquish( + void +); + +extern LbxBitmapCompMethod *LbxLookupBitmapCompMethod ( + XServerPtr /*server*/, + int /* methodOpCode */ +); + +extern LbxPixmapCompMethod *LbxLookupPixmapCompMethod ( + XServerPtr /*server*/, + int /* methodOpCode */ +); + +extern LbxBitmapCompMethod *LbxFindPreferredBitmapCompMethod ( + XServerPtr /*server*/ +); + +extern LbxPixmapCompMethod *LbxFindPreferredPixmapCompMethod ( + XServerPtr /*server*/, + int /* format */, + int /* depth */ +); + +#endif /* _LBX_PROXYOPTS_H_ */ diff --git a/app/lbxproxy/include/reqtype.h b/app/lbxproxy/include/reqtype.h new file mode 100644 index 000000000..2968824a0 --- /dev/null +++ b/app/lbxproxy/include/reqtype.h @@ -0,0 +1,68 @@ +/* $Xorg: reqtype.h,v 1.4 2001/02/09 02:05:32 xorgcvs Exp $ */ +/* + +Copyright 1998 The Open Group + +Permission to use, copy, modify, distribute, and sell this software and its +documentation for any purpose is hereby granted without fee, provided that +the above copyright notice appear in all copies and that both that +copyright notice and this permission notice appear in supporting +documentation. + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the name of The Open Group shall not be +used in advertising or otherwise to promote the sale, use or other dealings +in this Software without prior written authorization from The Open Group. + +*/ +/* + * Copyright 1994 Network Computing Devices, Inc. + * + * Permission to use, copy, modify, distribute, and sell this software and + * its documentation for any purpose is hereby granted without fee, provided + * that the above copyright notice appear in all copies and that both that + * copyright notice and this permission notice appear in supporting + * documentation, and that the name Network Computing Devices, Inc. not be + * used in advertising or publicity pertaining to distribution of this + * software without specific, written prior permission. + * + * THIS SOFTWARE IS PROVIDED `AS-IS'. NETWORK COMPUTING DEVICES, INC., + * DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING WITHOUT + * LIMITATION ALL IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A + * PARTICULAR PURPOSE, OR NONINFRINGEMENT. IN NO EVENT SHALL NETWORK + * COMPUTING DEVICES, INC., BE LIABLE FOR ANY DAMAGES WHATSOEVER, INCLUDING + * SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES, INCLUDING LOSS OF USE, DATA, + * OR PROFITS, EVEN IF ADVISED OF THE POSSIBILITY THEREOF, AND REGARDLESS OF + * WHETHER IN AN ACTION IN CONTRACT, TORT OR NEGLIGENCE, ARISING OUT OF OR IN + * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + * + */ +/* $XFree86$ */ + +#ifndef _REQTYPE_H_ +#define _REQTYPE_H_ + +#define REQ_TYPE_NO 0 +#define REQ_TYPE_YES 1 +#define REQ_TYPE_MAYBE 2 + +extern Bool GeneratesEvents( + ClientPtr /*client*/, + xReq * /*req*/ +); + +extern int GeneratesReplies( + ClientPtr /*client*/, + xReq * /*req*/ +); + +#endif /* _REQTYPE_H_ */ diff --git a/app/lbxproxy/include/resource.h b/app/lbxproxy/include/resource.h new file mode 100644 index 000000000..a3662ec3a --- /dev/null +++ b/app/lbxproxy/include/resource.h @@ -0,0 +1,118 @@ +/* $Xorg: resource.h,v 1.4 2001/02/09 02:05:32 xorgcvs Exp $ */ + +/* + +Copyright 1995, 1998 The Open Group + +Permission to use, copy, modify, distribute, and sell this software and its +documentation for any purpose is hereby granted without fee, provided that +the above copyright notice appear in all copies and that both that +copyright notice and this permission notice appear in supporting +documentation. + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR +OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the name of The Open Group shall +not be used in advertising or otherwise to promote the sale, use or +other dealings in this Software without prior written authorization +from The Open Group. + +*/ +/* $XFree86$ */ + +#ifndef RESOURCE_H +#define RESOURCE_H 1 + +#define RT_COLORMAP ((RESTYPE)1) +#define RT_CMAPENTRY ((RESTYPE)2) +#define RT_LASTPREDEF ((RESTYPE)2) +#define RT_NONE ((RESTYPE)0) + +#define RC_NEVERRETAIN ((RESTYPE)1<<29) +#define RC_LASTPREDEF RC_NEVERRETAIN +#define RC_ANY (~(RESTYPE)0) + +typedef unsigned long RESTYPE; + +typedef struct _Resource { + struct _Resource *next; + XID id; + RESTYPE type; + pointer value; +} ResourceRec, *ResourcePtr; +#define NullResource ((ResourcePtr)NULL) + +typedef struct _ClientResource { + ResourcePtr *resources; + int elements; + int buckets; + int hashsize; /* log(2)(buckets) */ + XID fakeID; + XID endFakeID; +} ClientResourceRec; + + +/* bits and fields within a resource id */ +#define PROXY_BIT 0x40000000 /* use illegal bit */ + +typedef int (*DeleteType)( + ClientPtr /*client*/, + pointer /*value*/, + XID /*id*/ +); + +extern Bool InitDeleteFuncs( + void +); + +extern Bool InitClientResources( + ClientPtr /*client*/ +); + +extern void FinishInitClientResources( + ClientPtr /*client*/, + XID /*ridBase*/, + XID /*ridMask*/ +); + +extern XID FakeClientID( + int /*client*/ +); + +extern Bool AddResource( + ClientPtr /*client*/, + XID /*id*/, + RESTYPE /*type*/, + pointer /*value*/ +); + +extern void FreeResource( + ClientPtr /*client*/, + XID /*id*/, + RESTYPE /*skipDeleteFuncType*/ +); + +extern void FreeClientResources( + ClientPtr /*client*/ +); + +extern void FreeAllResources( + void +); + +extern pointer LookupIDByType( + ClientPtr /*client*/, + XID /*id*/, + RESTYPE /*rtype*/ +); + +#endif diff --git a/app/lbxproxy/include/swap.h b/app/lbxproxy/include/swap.h new file mode 100644 index 000000000..d52eab495 --- /dev/null +++ b/app/lbxproxy/include/swap.h @@ -0,0 +1,192 @@ +/* + * $Xorg: swap.h,v 1.3 2000/08/17 19:53:58 cpqbld Exp $ + * + * Copyright 1994 Network Computing Devices, Inc. + * + * Permission to use, copy, modify, distribute, and sell this software and + * its documentation for any purpose is hereby granted without fee, provided + * that the above copyright notice appear in all copies and that both that + * copyright notice and this permission notice appear in supporting + * documentation, and that the name Network Computing Devices, Inc. not be + * used in advertising or publicity pertaining to distribution of this + * software without specific, written prior permission. + * + * THIS SOFTWARE IS PROVIDED `AS-IS'. NETWORK COMPUTING DEVICES, INC., + * DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING WITHOUT + * LIMITATION ALL IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A + * PARTICULAR PURPOSE, OR NONINFRINGEMENT. IN NO EVENT SHALL NETWORK + * COMPUTING DEVICES, INC., BE LIABLE FOR ANY DAMAGES WHATSOEVER, INCLUDING + * SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES, INCLUDING LOSS OF USE, DATA, + * OR PROFITS, EVEN IF ADVISED OF THE POSSIBILITY THEREOF, AND REGARDLESS OF + * WHETHER IN AN ACTION IN CONTRACT, TORT OR NEGLIGENCE, ARISING OUT OF OR IN + * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + * + */ +/* $XFree86: xc/programs/lbxproxy/include/swap.h,v 1.2 2001/08/01 00:45:01 tsi Exp $ */ + +#ifndef _SWAP_H_ +#define _SWAP_H_ + +extern void SwapConnSetup( + xConnSetup * /*pConnSetup*/, + xConnSetup * /*pConnSetupT*/ +); + +extern void SwapWinRoot( + xWindowRoot * /*pRoot*/, + xWindowRoot * /*pRootT*/ +); + +extern void SwapVisual( + xVisualType * /*pVis*/, + xVisualType * /*pVisT*/ +); + +extern void WriteSConnSetupPrefix( + ClientPtr /* pClient */, + xConnSetupPrefix * /* pcsp */ +); + +extern void WriteSConnectionInfo( + ClientPtr /*pClient*/, + unsigned long /*size*/, + char * /*pInfo*/ +); + +extern void SwapGetPropertyReply( + xGetPropertyReply * /*rep*/ +); + +extern void SwapInternAtomReply( + xInternAtomReply * /*rep*/ +); + +extern void SwapGetAtomNameReply( + xGetAtomNameReply * /*rep*/ +); + +extern void SwapLookupColorReply( + xLookupColorReply * /*rep*/ +); + +extern void SwapAllocColorReply( + xAllocColorReply * /*rep*/ +); + +extern void SwapAllocNamedColorReply( + xAllocNamedColorReply * /*rep*/ +); + +extern void SwapModmapReply( + xGetModifierMappingReply * /*rep*/ +); + +extern void SwapKeymapReply( + xGetKeyboardMappingReply * /*rep*/ +); + +extern void SwapGetImageReply( + xGetImageReply * /*rep*/ +); + +extern void SwapQueryExtensionReply( + xQueryExtensionReply * /*rep*/ +); + +extern void SwapFont( + xQueryFontReply * /*pr*/, + Bool /*native*/ +); + +extern void LbxSwapFontInfo( + xLbxFontInfo * /*pr*/, + Bool /*compressed*/ +); + +extern void SwapLongs( + CARD32 * /*list*/, + unsigned long /*count*/ +); + +extern void SwapShorts( + short * /*list*/, + unsigned long /*count*/ +); + +extern void SwapConnClientPrefix( + xConnClientPrefix * /*pCCP*/ +); + +extern void SwapNewClient( + xLbxNewClientReq * /*r*/ +); + +extern void SwapCloseClient( + xLbxCloseClientReq * /*r*/ +); + +extern void SwapModifySequence( + xLbxModifySequenceReq * /*r*/ +); + +extern void SwapIncrementPixel( + xLbxIncrementPixelReq * /*r*/ +); + +extern void SwapGetModifierMapping( + xLbxGetModifierMappingReq * /*r*/ +); + +extern void SwapGetKeyboardMapping( + xLbxGetKeyboardMappingReq * /*r*/ +); + +extern void SwapQueryFont( + xLbxQueryFontReq * /*r*/ +); + +extern void SwapChangeProperty( + xLbxChangePropertyReq * /*r*/ +); + +extern void SwapGetProperty( + xLbxGetPropertyReq * /*r*/ +); + +extern void SwapGetImage( + xLbxGetImageReq * /*r*/ +); + +extern void SwapInternAtoms( + xLbxInternAtomsReq * /* r */ +); + +extern void SwapInvalidateTag( + xLbxInvalidateTagReq * /*r*/ +); + +extern void SwapTagData( + xLbxTagDataReq * /*r*/ +); + +extern void SwapQueryExtension( + xLbxQueryExtensionReq * /*r*/ +); + +extern void SwapLbxConnSetupPrefix( + xLbxConnSetupPrefix * /*csp*/ +); + +extern void SwapAllocColor( + xLbxAllocColorReq * /* r */ +); + +extern void SwapGrabCmap( + xLbxGrabCmapReq * /* r */ +); + +extern void SwapReleaseCmap( + xLbxReleaseCmapReq * /* r */ +); + +#endif /* _SWAP_H_ */ diff --git a/app/lbxproxy/include/tags.h b/app/lbxproxy/include/tags.h new file mode 100644 index 000000000..866a5b8eb --- /dev/null +++ b/app/lbxproxy/include/tags.h @@ -0,0 +1,119 @@ +/* $Xorg: tags.h,v 1.4 2001/02/09 02:05:32 xorgcvs Exp $ */ +/* + +Copyright 1998 The Open Group + +Permission to use, copy, modify, distribute, and sell this software and its +documentation for any purpose is hereby granted without fee, provided that +the above copyright notice appear in all copies and that both that +copyright notice and this permission notice appear in supporting +documentation. + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the name of The Open Group shall not be +used in advertising or otherwise to promote the sale, use or other dealings +in this Software without prior written authorization from The Open Group. + +*/ +/* + * Copyright 1993 Network Computing Devices, Inc. + * + * Permission to use, copy, modify, distribute, and sell this software and + * its documentation for any purpose is hereby granted without fee, provided + * that the above copyright notice appear in all copies and that both that + * copyright notice and this permission notice appear in supporting + * documentation, and that the name Network Computing Devices, Inc. not be + * used in advertising or publicity pertaining to distribution of this + * software without specific, written prior permission. + * + * THIS SOFTWARE IS PROVIDED `AS-IS'. NETWORK COMPUTING DEVICES, INC., + * DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING WITHOUT + * LIMITATION ALL IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A + * PARTICULAR PURPOSE, OR NONINFRINGEMENT. IN NO EVENT SHALL NETWORK + * COMPUTING DEVICES, INC., BE LIABLE FOR ANY DAMAGES WHATSOEVER, INCLUDING + * SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES, INCLUDING LOSS OF USE, DATA, + * OR PROFITS, EVEN IF ADVISED OF THE POSSIBILITY THEREOF, AND REGARDLESS OF + * WHETHER IN AN ACTION IN CONTRACT, TORT OR NEGLIGENCE, ARISING OUT OF OR IN + * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + * + */ +/* $XFree86$ */ + +#ifndef _TAGS_H_ +#define _TAGS_H_ + +#include "cache.h" + +typedef struct _tagdata { + XID tid; + int data_type; + unsigned long size; + pointer tdata; +} TagDataRec; + +typedef struct _tagdata *TagData; + +extern void TagsInit( + XServerPtr /*server*/, + Bool /*useTags*/ +); + +extern void FreeTags( + void +); + +extern Bool TagStoreData( + XServerPtr /*server*/, + Cache /*cache*/, + CacheID /*id*/, + int /*size*/, + int /*dtype*/, + pointer /*data*/ +); + +extern Bool TagStoreDataNC( + XServerPtr /*server*/, + Cache /*cache*/, + CacheID /*id*/, + int /*size*/, + int /*dtype*/, + pointer /*data*/ +); + +extern TagData TagGetTag( + XServerPtr /*server*/, + Cache /*cache*/, + CacheID /*id*/ +); + +extern pointer TagGetData( + XServerPtr /*server*/, + Cache /*cache*/, + CacheID /*id*/ +); + +extern void TagFreeData( + XServerPtr /*server*/, + Cache /*cache*/, + CacheID /*id*/, + Bool /*notify*/ +); + +extern Bool AnyTagBearingReplies( + XServerPtr /*server*/, + Cache /*cache*/ +); + +extern Cache global_cache; +extern Cache prop_cache; + +#endif /* _TAGS_H_ */ diff --git a/app/lbxproxy/include/util.h b/app/lbxproxy/include/util.h new file mode 100644 index 000000000..178459ec5 --- /dev/null +++ b/app/lbxproxy/include/util.h @@ -0,0 +1,187 @@ +/* $Xorg: util.h,v 1.4 2001/02/09 02:05:32 xorgcvs Exp $ */ +/* + +Copyright 1998 The Open Group + +Permission to use, copy, modify, distribute, and sell this software and its +documentation for any purpose is hereby granted without fee, provided that +the above copyright notice appear in all copies and that both that +copyright notice and this permission notice appear in supporting +documentation. + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the name of The Open Group shall not be +used in advertising or otherwise to promote the sale, use or other dealings +in this Software without prior written authorization from The Open Group. + +*/ +/* + * Copyright 1994 Network Computing Devices, Inc. + * + * Permission to use, copy, modify, distribute, and sell this software and + * its documentation for any purpose is hereby granted without fee, provided + * that the above copyright notice appear in all copies and that both that + * copyright notice and this permission notice appear in supporting + * documentation, and that the name Network Computing Devices, Inc. not be + * used in advertising or publicity pertaining to distribution of this + * software without specific, written prior permission. + * + * THIS SOFTWARE IS PROVIDED `AS-IS'. NETWORK COMPUTING DEVICES, INC., + * DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING WITHOUT + * LIMITATION ALL IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A + * PARTICULAR PURPOSE, OR NONINFRINGEMENT. IN NO EVENT SHALL NETWORK + * COMPUTING DEVICES, INC., BE LIABLE FOR ANY DAMAGES WHATSOEVER, INCLUDING + * SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES, INCLUDING LOSS OF USE, DATA, + * OR PROFITS, EVEN IF ADVISED OF THE POSSIBILITY THEREOF, AND REGARDLESS OF + * WHETHER IN AN ACTION IN CONTRACT, TORT OR NEGLIGENCE, ARISING OUT OF OR IN + * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + * + */ +/* $XFree86: xc/programs/lbxproxy/include/util.h,v 1.7 2001/12/14 20:00:56 dawes Exp $ */ + +#ifndef _UTIL_H_ +#define _UTIL_H_ + +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif + +#ifdef RETSIGTYPE /* autoconf AC_TYPE_SIGNAL */ +# define SIGVAL RETSIGTYPE +#else /* Imake */ +#ifdef SIGNALRETURNSINT +#define SIGVAL int +#else +#define SIGVAL void +#endif +#endif /* RETSIGTYPE */ + +typedef SIGVAL (*OsSigHandlerPtr)( + int /* sig */ +); + +extern OsSigHandlerPtr OsSignal( + int /*sig*/, + OsSigHandlerPtr /*handler*/ +); + +extern void AutoResetServer( + int /*sig*/ +); + +extern void GiveUp( + int /*sig*/ +); + +extern void Error( + char * /*str*/ +); + +extern CARD32 GetTimeInMillis( + void +); + +extern int AdjustWaitForDelay( + pointer /*waitTime*/, + unsigned long /*newdelay*/ +); + +extern void UseMsg( + void +); + +extern void ProcessCommandLine( + int /*argc*/, + char * /*argv*/[] +); + +#define xalloc(size) Xalloc((unsigned long)(size)) +#define xcalloc(size) Xcalloc((unsigned long)(size)) +#define xrealloc(ptr, size) Xrealloc((pointer)(ptr), (unsigned long)(size)) +#define xfree(ptr) Xfree((pointer)(ptr)) + +extern unsigned long *Xalloc( + unsigned long /*amount*/ +); + +extern unsigned long *Xcalloc( + unsigned long /*amount*/ +); + +extern unsigned long *Xrealloc( + pointer /*ptr*/, + unsigned long /*amount*/ +); + +extern void Xfree( + pointer /*ptr*/ +); + +extern void OsInitAllocator( + void +); + +extern void AuditF( + const char * /*f*/, + ... +); + +extern void FatalError( + const char * /*f*/, + ... +); + +extern void ErrorF( + const char * /*f*/, + ... +); + +extern char *strnalloc( + char * /*str*/, + int /*len*/ +); + +typedef struct _WorkQueue *WorkQueuePtr; + +extern void ProcessWorkQueue( + void +); + +extern Bool QueueWorkProc( + Bool (* /*function*/)(), + ClientPtr /*client*/, + pointer /*closure*/ +); + +extern Bool ClientSleep( + ClientPtr /*client*/, + Bool (* /*function*/)(), + pointer /*closure*/ +); + +extern Bool ClientSignal( + ClientPtr /*client*/ +); + +extern void ClientWakeup( + ClientPtr /*client*/ +); + +extern Bool ClientIsAsleep( + ClientPtr /*client*/ +); + +extern void LBXReadAtomsFile( + XServerPtr /*server*/ +); + +#endif /* _UTIL_H_ */ diff --git a/app/lbxproxy/include/wire.h b/app/lbxproxy/include/wire.h new file mode 100644 index 000000000..2bdd54ee0 --- /dev/null +++ b/app/lbxproxy/include/wire.h @@ -0,0 +1,381 @@ +/* $Xorg: wire.h,v 1.4 2001/02/09 02:05:32 xorgcvs Exp $ */ +/* + +Copyright 1998 The Open Group + +Permission to use, copy, modify, distribute, and sell this software and its +documentation for any purpose is hereby granted without fee, provided that +the above copyright notice appear in all copies and that both that +copyright notice and this permission notice appear in supporting +documentation. + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the name of The Open Group shall not be +used in advertising or otherwise to promote the sale, use or other dealings +in this Software without prior written authorization from The Open Group. + +*/ +/* + * Copyright 1992 Network Computing Devices + * + * Permission to use, copy, modify, distribute, and sell this software and its + * documentation for any purpose is hereby granted without fee, provided that + * the above copyright notice appear in all copies and that both that + * copyright notice and this permission notice appear in supporting + * documentation, and that the name of NCD. not be used in advertising or + * publicity pertaining to distribution of the software without specific, + * written prior permission. NCD. makes no representations about the + * suitability of this software for any purpose. It is provided "as is" + * without express or implied warranty. + * + * NCD. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL NCD. + * BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION + * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN + * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + * + */ +/* $XFree86: xc/programs/lbxproxy/include/wire.h,v 1.7 2001/12/14 20:00:56 dawes Exp $ */ + +#ifdef DEBUG /* Need this here because lbx.h undef's DEBUG */ +extern int lbxDebug; +#endif + +#include "misc.h" +#include "lbx.h" +#include +#include +#include "proxyopts.h" +#include "colormap.h" +#include "atomcache.h" +#include "cache.h" +#include "resource.h" + +typedef struct _extinfo *ExtensionInfoPtr; + +/* + * NOTES on the implementation of the multi-display lbxproxy. + * + * o Each display has its own listen port(s). + * + * o Depending on how the proxy is compiled, it may support multiple + * transports thus more than one fd may be associated with a display. + * + * o When a new client connects, the proxy must be able to determine + * which display the client is interested in. To facilitate this, when + * a display's listen port(s) are created, a list of the display's + * fd's is cached in the field listen_fds. + * + * o When accept is called, the listen_fds in the servers array is + * searched to find the client's display. + */ + +/* + * MAXTRANSPORTS is the maximum number of transports or listen + * ports that a proxy can support. The number is determine at compile + * by the xtrans library but there is no public interface to this + * number. See lib/xtrans/Xtrans.c for more information. + */ +#define MAXTRANSPORTS 13 + +/* + * The maximum number of options that is negotiable. + */ +#define MAX_NEG_OPTS 8 + +typedef struct _LbxOptionsListRec { + CARD8 optcode; + Bool negotiate; + int (*req)(); + int (*reply)(); +} LbxOptionsListRec; + +typedef struct _LbxDeltaOptionsRec { + CARD8 minN; /* min cache size */ + CARD8 maxN; /* max cache size */ + CARD8 prefN; /* preferred cache size */ + CARD8 minMaxMsgLen; /* min max-message-len / 4 */ + CARD8 maxMaxMsgLen; /* max max-message-len / 4 */ + CARD8 prefMaxMsgLen; /* preferred max-message-len / 4 */ +} LbxDeltaOptionsRec; + +typedef struct _LbxStreamComp { + int typelen; + char *type; + int (*req)(); + int (*reply)(); +} LbxStreamCompRec; + +typedef struct _LbxCmapAllMethod { + char *methodName; + void (*resolver)( + LbxVisualPtr /* pVisual */, + CARD16* /* red */, + CARD16* /* green */, + CARD16* /* blue */ + ); + Pixel (*findfree)( + ColormapPtr /* pmap */, + CARD32 /* red */, + CARD32 /* green */, + CARD32 /* blue */ + ); + Entry * (* findbest)( + ColormapPtr /* pmap */, + CARD32 /* red */, + CARD32 /* green */, + CARD32 /* blue */, + int /* channels */ + ); + +} LbxCmapAllMethod; + +typedef struct _XServer { + int index; + int fd; + int lbxReq; + int lbxEvent; + int lbxError; + Bool initialized; + char *display_name; /* The name as requested by the client*/ + char *proxy_name; /* The actual name used by the proxy */ + int listen_fds[MAXTRANSPORTS]; + ClientPtr prev_exec; + ClientPtr send, recv; + ClientPtr serverClient; + int recv_expect; + int motion_allowed; + Bool wm_running; + pointer compHandle; + lbxMotionCache motionCache; + ExtensionInfoPtr extensions; + LBXDeltasRec indeltas; + LBXDeltasRec outdeltas; + + /* + * The following fields are needed to handle the option + * negotiation for a multi-display proxy. + */ + LbxOptionsListRec LbxOptions[MAX_NEG_OPTS]; + int optcount; /* Number of options actually negotiated */ + int optlist[MAX_NEG_OPTS]; + LbxNegOptsRec lbxNegOpt; + LbxDeltaOptionsRec proxyDeltaOpt; + LbxDeltaOptionsRec serverDeltaOpt; + LbxStreamCompRec LbxStreamComp[1]; + LbxBitmapCompMethod LbxBitmapCompMethods[1]; + LbxPixmapCompMethod LbxPixmapCompMethods[1]; + LbxCmapAllMethod LbxCmapAllMethods[1]; + + /* + * requestVector is the function table to be used by the + * "real" clients associated with this server. + */ + int (**requestVector) ( + ClientPtr /* pClient */ + ); + + /* + * The following fields are needed to handle the atom + * cache for a multi-display proxy. + */ + AtomControlPtr atom_control; + int atom_control_count; + AtomListPtr *hashTable; + int hashSize; + int hashUsed; + int hashMask; + int rehash; + AtomListPtr *reverseMap; + int reverseMapSize; + Atom lastAtom; + + /* + * The following fields are needed for each server's + * global and property caches. + */ + Cache global_cache; + Cache prop_cache; + CachePtr caches[MAX_NUM_CACHES + 1]; + int num_caches; + unsigned long seed; + + /* + * The following fields are needed for each server's + * colormap caches. + */ + RGBCacheEntryPtr rgb_cache[NBUCKETS]; + RGBEntryRec rgb_buf; + Entry rgb_ent; + + /* + * Server-specific temporary delta buffer + */ + unsigned char tempdeltabuf[256]; + + /* + * The following fields are used to mange a server's resources + */ + ClientResourceRec clientTable[MAXCLIENTS]; + ClientPtr lastLbxClientIndexLookup; + + /* + * The following fields maintain a server's state for grab's + */ + int lbxIgnoringAll; + int lbxGrabInProgress; + + struct _XDisplay* dpy; + +} XServerRec; + + +/* + * External declarations for global variables defined in main.c + */ +extern XServerPtr * servers; +extern char * display; +extern int lbxMaxServers; + +extern void WriteReqToServer( + ClientPtr /*client*/, + int /*len*/, + char * /*buf*/, + Bool /*checkLargeRequest*/ +); + +extern void _write_to_server( + ClientPtr /*client*/, + Bool /*compressed*/, + int /*len*/, + char* /*buf*/, + Bool /*checkLarge*/, + Bool /*startOfRequest*/ +); + +extern void WriteToServer( + ClientPtr /*client*/, + int /*len*/, + char * /*buf*/, + Bool /*startOfRequest*/, + Bool /*checkLargeRequest*/ +); + +extern void WriteToServerUncompressed( + ClientPtr /*client*/, + int /*len*/, + char * /*buf*/, + Bool /* startOfRequest */ +); + +extern Bool NewClient( + ClientPtr /*client*/, + int /*setuplen*/ +); + +extern void CloseClient( + ClientPtr /*client*/ +); + +extern void ModifySequence( + ClientPtr /*client*/, + int /*num*/ +); + +extern void AllowMotion( + ClientPtr /*client*/, + int /*num*/ +); + +extern void SendIncrementPixel( + ClientPtr /*client*/, + XID /*cmap*/, + unsigned long /*pixel*/ +); + +extern void SendAllocColor( + ClientPtr /* pClient */, + XID /* cmap */, + CARD32 /* pixel */, + CARD16 /* red */, + CARD16 /* green */, + CARD16 /* blue */ +); + +extern void SendGetModifierMapping( + ClientPtr /*client*/ +); + +extern void SendGetKeyboardMapping( + ClientPtr /*client*/ +); + +extern void SendQueryFont( + ClientPtr /*client*/, + XID /*fid*/ +); + +extern void SendChangeProperty( + ClientPtr /*client*/, + Window /*win*/, + Atom /*prop*/, + Atom /*type*/, + int /*format*/, + int /*mode*/, + unsigned long /*num*/ +); + +extern void SendGetProperty( + ClientPtr /*client*/, + Window /*win*/, + Atom /*prop*/, + Atom /*type*/, + Bool /*delete*/, + unsigned long /*off*/, + unsigned long /*len*/ +); + +extern void SendInvalidateTag( + ClientPtr /*client*/, + XID /*tag*/ +); + +extern void SendTagData( + ClientPtr /*client*/, + XID /*tag*/, + unsigned long /*len*/, + pointer /*data*/ +); + +extern void SendGetImage( + ClientPtr /*client*/, + Drawable /*drawable*/, + int /*x*/, + int /*y*/, + unsigned int /*width*/, + unsigned int /*height*/, + unsigned long /*planeMask*/, + int /*format*/ +); + +extern int ServerProcStandardEvent( + ClientPtr /*sc*/ +); + +extern void CloseServer( + ClientPtr /*client*/ +); + +extern Bool ConnectToServer( + char * /*dpy_name*/ +); diff --git a/app/lbxproxy/install-sh b/app/lbxproxy/install-sh new file mode 100644 index 000000000..6ce63b9f7 --- /dev/null +++ b/app/lbxproxy/install-sh @@ -0,0 +1,294 @@ +#!/bin/sh +# +# install - install a program, script, or datafile +# +# This originates from X11R5 (mit/util/scripts/install.sh), which was +# later released in X11R6 (xc/config/util/install.sh) with the +# following copyright and license. +# +# Copyright (C) 1994 X Consortium +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC- +# TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +# +# Except as contained in this notice, the name of the X Consortium shall not +# be used in advertising or otherwise to promote the sale, use or other deal- +# ings in this Software without prior written authorization from the X Consor- +# tium. +# +# +# FSF changes to this file are in the public domain. +# +# Calling this script install-sh is preferred over install.sh, to prevent +# `make' implicit rules from creating a file called install from it +# when there is no Makefile. +# +# This script is compatible with the BSD install script, but was written +# from scratch. It can only install one file at a time, a restriction +# shared with many OS's install programs. + + +# set DOITPROG to echo to test this script + +# Don't use :- since 4.3BSD and earlier shells don't like it. +doit="${DOITPROG-}" + + +# put in absolute paths if you don't have them in your path; or use env. vars. + +mvprog="${MVPROG-mv}" +cpprog="${CPPROG-cp}" +chmodprog="${CHMODPROG-chmod}" +chownprog="${CHOWNPROG-chown}" +chgrpprog="${CHGRPPROG-chgrp}" +stripprog="${STRIPPROG-strip}" +rmprog="${RMPROG-rm}" +mkdirprog="${MKDIRPROG-mkdir}" + +transformbasename="" +transform_arg="" +instcmd="$mvprog" +chmodcmd="$chmodprog 0755" +chowncmd="" +chgrpcmd="" +stripcmd="" +rmcmd="$rmprog -f" +mvcmd="$mvprog" +src="" +dst="" +dir_arg="" + +while [ x"$1" != x ]; do + case $1 in + -c) instcmd=$cpprog + shift + continue;; + + -d) dir_arg=true + shift + continue;; + + -m) chmodcmd="$chmodprog $2" + shift + shift + continue;; + + -o) chowncmd="$chownprog $2" + shift + shift + continue;; + + -g) chgrpcmd="$chgrpprog $2" + shift + shift + continue;; + + -s) stripcmd=$stripprog + shift + continue;; + + -t=*) transformarg=`echo $1 | sed 's/-t=//'` + shift + continue;; + + -b=*) transformbasename=`echo $1 | sed 's/-b=//'` + shift + continue;; + + *) if [ x"$src" = x ] + then + src=$1 + else + # this colon is to work around a 386BSD /bin/sh bug + : + dst=$1 + fi + shift + continue;; + esac +done + +if [ x"$src" = x ] +then + echo "$0: no input file specified" >&2 + exit 1 +else + : +fi + +if [ x"$dir_arg" != x ]; then + dst=$src + src="" + + if [ -d "$dst" ]; then + instcmd=: + chmodcmd="" + else + instcmd=$mkdirprog + fi +else + +# Waiting for this to be detected by the "$instcmd $src $dsttmp" command +# might cause directories to be created, which would be especially bad +# if $src (and thus $dsttmp) contains '*'. + + if [ -f "$src" ] || [ -d "$src" ] + then + : + else + echo "$0: $src does not exist" >&2 + exit 1 + fi + + if [ x"$dst" = x ] + then + echo "$0: no destination specified" >&2 + exit 1 + else + : + fi + +# If destination is a directory, append the input filename; if your system +# does not like double slashes in filenames, you may need to add some logic + + if [ -d "$dst" ] + then + dst=$dst/`basename "$src"` + else + : + fi +fi + +## this sed command emulates the dirname command +dstdir=`echo "$dst" | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'` + +# Make sure that the destination directory exists. +# this part is taken from Noah Friedman's mkinstalldirs script + +# Skip lots of stat calls in the usual case. +if [ ! -d "$dstdir" ]; then +defaultIFS=' + ' +IFS="${IFS-$defaultIFS}" + +oIFS=$IFS +# Some sh's can't handle IFS=/ for some reason. +IFS='%' +set - `echo "$dstdir" | sed -e 's@/@%@g' -e 's@^%@/@'` +IFS=$oIFS + +pathcomp='' + +while [ $# -ne 0 ] ; do + pathcomp=$pathcomp$1 + shift + + if [ ! -d "$pathcomp" ] ; + then + $mkdirprog "$pathcomp" + else + : + fi + + pathcomp=$pathcomp/ +done +fi + +if [ x"$dir_arg" != x ] +then + $doit $instcmd "$dst" && + + if [ x"$chowncmd" != x ]; then $doit $chowncmd "$dst"; else : ; fi && + if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd "$dst"; else : ; fi && + if [ x"$stripcmd" != x ]; then $doit $stripcmd "$dst"; else : ; fi && + if [ x"$chmodcmd" != x ]; then $doit $chmodcmd "$dst"; else : ; fi +else + +# If we're going to rename the final executable, determine the name now. + + if [ x"$transformarg" = x ] + then + dstfile=`basename "$dst"` + else + dstfile=`basename "$dst" $transformbasename | + sed $transformarg`$transformbasename + fi + +# don't allow the sed command to completely eliminate the filename + + if [ x"$dstfile" = x ] + then + dstfile=`basename "$dst"` + else + : + fi + +# Make a couple of temp file names in the proper directory. + + dsttmp=$dstdir/_inst.$$_ + rmtmp=$dstdir/_rm.$$_ + +# Trap to clean up temp files at exit. + + trap 'status=$?; rm -f "$dsttmp" "$rmtmp" && exit $status' 0 + trap '(exit $?); exit' 1 2 13 15 + +# Move or copy the file name to the temp name + + $doit $instcmd "$src" "$dsttmp" && + +# and set any options; do chmod last to preserve setuid bits + +# If any of these fail, we abort the whole thing. If we want to +# ignore errors from any of these, just make sure not to ignore +# errors from the above "$doit $instcmd $src $dsttmp" command. + + if [ x"$chowncmd" != x ]; then $doit $chowncmd "$dsttmp"; else :;fi && + if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd "$dsttmp"; else :;fi && + if [ x"$stripcmd" != x ]; then $doit $stripcmd "$dsttmp"; else :;fi && + if [ x"$chmodcmd" != x ]; then $doit $chmodcmd "$dsttmp"; else :;fi && + +# Now remove or move aside any old file at destination location. We try this +# two ways since rm can't unlink itself on some systems and the destination +# file might be busy for other reasons. In this case, the final cleanup +# might fail but the new file should still install successfully. + +{ + if [ -f "$dstdir/$dstfile" ] + then + $doit $rmcmd -f "$dstdir/$dstfile" 2>/dev/null || + $doit $mvcmd -f "$dstdir/$dstfile" "$rmtmp" 2>/dev/null || + { + echo "$0: cannot unlink or rename $dstdir/$dstfile" >&2 + (exit 1); exit + } + else + : + fi +} && + +# Now rename the file to the real destination. + + $doit $mvcmd "$dsttmp" "$dstdir/$dstfile" + +fi && + +# The final little trick to "correctly" pass the exit status to the exit trap. + +{ + (exit 0); exit +} diff --git a/app/lbxproxy/lbxproxy.def b/app/lbxproxy/lbxproxy.def new file mode 100644 index 000000000..3c0f3af60 --- /dev/null +++ b/app/lbxproxy/lbxproxy.def @@ -0,0 +1,4 @@ +NAME lbxproxy WINDOWCOMPAT +DESCRIPTION "X11R6 XFree86 3.2A lbxproxy server EMX09C Version=6.3" +PROTMODE +EXETYPE OS2 diff --git a/app/lbxproxy/lbxproxy.man b/app/lbxproxy/lbxproxy.man new file mode 100644 index 000000000..9ff91f984 --- /dev/null +++ b/app/lbxproxy/lbxproxy.man @@ -0,0 +1,236 @@ +.\" $Xorg: lbxproxy.man,v 1.4 2001/02/09 02:05:31 xorgcvs Exp $ +.\" Copyright 1996, 1998 The Open Group +.\" +.\" Permission to use, copy, modify, distribute, and sell this software and its +.\" documentation for any purpose is hereby granted without fee, provided that +.\" the above copyright notice appear in all copies and that both that +.\" copyright notice and this permission notice appear in supporting +.\" documentation. +.\" +.\" The above copyright notice and this permission notice shall be included +.\" in all copies or substantial portions of the Software. +.\" +.\" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +.\" OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +.\" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +.\" IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR +.\" OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +.\" ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +.\" OTHER DEALINGS IN THE SOFTWARE. +.\" +.\" Except as contained in this notice, the name of The Open Group shall +.\" not be used in advertising or otherwise to promote the sale, use or +.\" other dealings in this Software without prior written authorization +.\" from The Open Group. +.\" +.\" +.\" $XFree86: xc/programs/lbxproxy/lbxproxy.man,v 1.8 2001/12/14 20:00:49 dawes Exp $ +.\" +.TH LBXPROXY 1 __xorgversion__ +.SH NAME +lbxproxy - Low BandWidth X proxy +.SH SYNOPSIS +.B lbxproxy [:] [option] +.SH DESCRIPTION +Applications that would like to take advantage of the Low Bandwidth +extension to X (LBX) must make their connections to an lbxproxy. These +applications need to know nothing about LBX, they simply connect to the +lbxproxy as if were a regular server. The lbxproxy accepts client +connections, multiplexes them over a single connection to the X server, and +performs various optimizations on the X protocol to make it faster over low +bandwidth and/or high latency connections. +.PP +With regard to authentication/authorization, lbxproxy simply passes along +to the server the credentials presented by the client. Since X clients will +connect to lbxproxy, it is important that the user's .Xauthority file contain +entries with valid keys associated with the network ID of the proxy. lbxproxy +does not get involved with how these entries are added to the .Xauthority file. +The user is responsible for setting it up. +.PP +The lbxproxy program has various options, all of which are optional. +.PP +If +.B : +is specified, the proxy will use the given display port when +listening for connections. The display port is an offset from port 6000, +identical to the way in which regular X display connections are specified. +If no port is specified on the command line option, lbxproxy will default +to port 63. If the port number that the proxy tries to listen on is in +use, the proxy will attempt to use another port number. If +the proxy is not using the Proxy Manager and the default +port number cannot be used, the port number that is used +will be written to stderr. +.PP +The other command line options that can be specified are: +.PP +.TP 8 +.B \-help +Prints a brief help message about the command line options. +.TP 8 +.B \-display \fIdpy\fP +Specifies the address of the X server supporting the LBX extension. +If this option is not specified, the display is obtained by the +DISPLAY environment variable. +.TP 8 +.B \-motion \fIcount\fP +A limited number of pointer motion events are allowed to be in flight +between the server and the proxy at any given time. The maximum +number of motion events that can be in flight is set with this option; +the default is 8. +.TP 8 +.B \-maxservers \fInumber\fP +The default behavior of lbxproxy is to manage a single server. +However, lbxproxy can manage more than one server. The default +maximum number of servers is 20. The number of servers can be +overridden by setting the environment variable LBXPROXY_MAXSERVERS +to the desired number. The order of precedence from highest +to lowest: command line, environment variable, default number. +.TP 8 +.B \-[terminate|reset] +The default behavior of lbxproxy is to continue running as usual when +it's last client exits. The +.B \-terminate +option will cause lbxproxy to +exit when the last client exits. The +.B \-reset +option will cause +lbxproxy to reset itself when the last client exits. Resetting causes +lbxproxy to clean up it's state and reconnect to the server. +.TP 8 +.B \-reconnect +The default behavior of lbxproxy is to exit when its connection to the +server is broken. The +.B \-reconnect +option will cause lbxproxy to just reset instead (see +.B \-reset +above) and attempt to reconnect to the server. +.TP 8 +.B \-I +Causes all remaining arguments to be ignored. +.TP 8 +.B \-nolbx +Disables all LBX optimizations. +.TP 8 +.B \-nocomp +Disables stream compression. +.TP 8 +.B \-nodelta +Disables delta request substitutions. +.TP 8 +.B \-notags +Disables usage of tags. +.TP 8 +.B \-nogfx +Disables reencoding of graphics requests (not including image +related requests). +.TP 8 +.B \-noimage +Disables image compression. +.TP 8 +.B \-nosquish +Disables squishing of X events. +.TP 8 +.B \-nointernsc +Disables short circuiting of InternAtom requests. +.TP 8 +.B \-noatomsfile +Disables reading of the atoms control file. See the section on +"Atom Control" for more details. +.TP 8 +.B \-atomsfile \fIfile\fP +Overrides the default AtomControl file. See the section on +"Atom Control" for more details. +.TP 8 +.B \-nowinattr +Disables GetWindowAttributes/GetGeometry grouping into one round trip. +.TP 8 +.B \-nograbcmap +Disables colormap grabbing. +.TP 8 +.B \-norgbfile +Disables color name to RGB resolution in proxy. +.TP 8 +.B \-rgbfile \fIpath\fP +Specifies an alternate RGB database for color name to RGB resolution. +.TP 8 +.B \-tagcachesize +Set the size of the proxy's tag cache (in bytes). +.TP 8 +.B \-zlevel \fIlevel\fP +Set the Zlib compression level (used for stream compression). +.br +default is 6 +.br +1 = worst compression, fastest +.br +9 = best compression, slowest +.TP 8 +.B \-compstats +Report stream compression statistics every time the proxy resets +or receives a SIGHUP signal. +.TP 8 +.B \-nozeropad +Don't zero out unused pad bytes in X requests, replies, and events. +.TP 8 +.B \-cheaterrors +Allows cheating on X protocol for the sake of improved performance. +The X protocol guarantees that any replies, events or +errors generated by a previous request will be sent before those of +a later request. This puts substantial restrictions on when lbxproxy +can short circuit a request. The -cheaterrors option allows lbxproxy to +violate X protocol rules with respect to errors. Use at your own risk. +.TP 8 +.B \-cheatevents +The -cheatevents option allows lbxproxy to violate X protocol rules with +respect to events as well as errors. Use at your own risk. +.PP +.SH ATOM CONTROL +.PP +At startup, lbxproxy "pre-interns" a configurable list of +atoms. This allows lbxproxy to intern a group of atoms in a single round +trip and immediately store the results in its cache. +.PP +While running, lbxproxy uses heuristics to decide when to delay +sending window property data to the server. The heuristics depend +on the size of the data, the name of the property, and whether a +window manager is running through the same lbxproxy. +.PP +Atom control is specified in the "AtomControl" file, set +up during installation of lbxproxy, with command line overrides. +.PP +The file is a simple text file. There are three forms of lines: +comments, length control, and name control. Lines starting with +a '!' are treated as comments. A line of the form +.sp +.in +4 +.nf +z \fIlength\fP +.fi +.in -4 +.sp +specifies the minimum length in bytes before property data will be +delayed. A line of the form +.sp +.in +4 +.nf +\fIoptions\fP \fIatomname\fP +.fi +.in -4 +.sp +controls the given atom, where \fIoptions\fP is any combination +of the following characters: 'i' means the atom should be pre-interned; +'n' means data for properties with this name should never be delayed; +and 'w' means data for properties with this name should be delayed only +if a window manager is also running through the same lbxproxy. +.PP +.SH BUGS +.PP +When the authorization protocol XDM-AUTHORIZATION-1 is used: +.PP +.in +4 +A client must be on the same host as lbxproxy for the client to be +authorized to connect to the server. +.PP +.in +4 +If a client is not on the same host as lbxproxy, the client will +not be authorized to connect to the server. diff --git a/app/lbxproxy/missing b/app/lbxproxy/missing new file mode 100644 index 000000000..fc54c64ec --- /dev/null +++ b/app/lbxproxy/missing @@ -0,0 +1,336 @@ +#! /bin/sh +# Common stub for a few missing GNU programs while installing. +# Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003 Free Software Foundation, Inc. +# Originally by Fran,cois Pinard , 1996. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +# 02111-1307, USA. + +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +if test $# -eq 0; then + echo 1>&2 "Try \`$0 --help' for more information" + exit 1 +fi + +run=: + +# In the cases where this matters, `missing' is being run in the +# srcdir already. +if test -f configure.ac; then + configure_ac=configure.ac +else + configure_ac=configure.in +fi + +case "$1" in +--run) + # Try to run requested program, and just exit if it succeeds. + run= + shift + "$@" && exit 0 + ;; +esac + +# If it does not exist, or fails to run (possibly an outdated version), +# try to emulate it. +case "$1" in + + -h|--h|--he|--hel|--help) + echo "\ +$0 [OPTION]... PROGRAM [ARGUMENT]... + +Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an +error status if there is no known handling for PROGRAM. + +Options: + -h, --help display this help and exit + -v, --version output version information and exit + --run try to run the given command, and emulate it if it fails + +Supported PROGRAM values: + aclocal touch file \`aclocal.m4' + autoconf touch file \`configure' + autoheader touch file \`config.h.in' + automake touch all \`Makefile.in' files + bison create \`y.tab.[ch]', if possible, from existing .[ch] + flex create \`lex.yy.c', if possible, from existing .c + help2man touch the output file + lex create \`lex.yy.c', if possible, from existing .c + makeinfo touch the output file + tar try tar, gnutar, gtar, then tar without non-portable flags + yacc create \`y.tab.[ch]', if possible, from existing .[ch]" + ;; + + -v|--v|--ve|--ver|--vers|--versi|--versio|--version) + echo "missing 0.4 - GNU automake" + ;; + + -*) + echo 1>&2 "$0: Unknown \`$1' option" + echo 1>&2 "Try \`$0 --help' for more information" + exit 1 + ;; + + aclocal*) + if test -z "$run" && ($1 --version) > /dev/null 2>&1; then + # We have it, but it failed. + exit 1 + fi + + echo 1>&2 "\ +WARNING: \`$1' is missing on your system. You should only need it if + you modified \`acinclude.m4' or \`${configure_ac}'. You might want + to install the \`Automake' and \`Perl' packages. Grab them from + any GNU archive site." + touch aclocal.m4 + ;; + + autoconf) + if test -z "$run" && ($1 --version) > /dev/null 2>&1; then + # We have it, but it failed. + exit 1 + fi + + echo 1>&2 "\ +WARNING: \`$1' is missing on your system. You should only need it if + you modified \`${configure_ac}'. You might want to install the + \`Autoconf' and \`GNU m4' packages. Grab them from any GNU + archive site." + touch configure + ;; + + autoheader) + if test -z "$run" && ($1 --version) > /dev/null 2>&1; then + # We have it, but it failed. + exit 1 + fi + + echo 1>&2 "\ +WARNING: \`$1' is missing on your system. You should only need it if + you modified \`acconfig.h' or \`${configure_ac}'. You might want + to install the \`Autoconf' and \`GNU m4' packages. Grab them + from any GNU archive site." + files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}` + test -z "$files" && files="config.h" + touch_files= + for f in $files; do + case "$f" in + *:*) touch_files="$touch_files "`echo "$f" | + sed -e 's/^[^:]*://' -e 's/:.*//'`;; + *) touch_files="$touch_files $f.in";; + esac + done + touch $touch_files + ;; + + automake*) + if test -z "$run" && ($1 --version) > /dev/null 2>&1; then + # We have it, but it failed. + exit 1 + fi + + echo 1>&2 "\ +WARNING: \`$1' is missing on your system. You should only need it if + you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'. + You might want to install the \`Automake' and \`Perl' packages. + Grab them from any GNU archive site." + find . -type f -name Makefile.am -print | + sed 's/\.am$/.in/' | + while read f; do touch "$f"; done + ;; + + autom4te) + if test -z "$run" && ($1 --version) > /dev/null 2>&1; then + # We have it, but it failed. + exit 1 + fi + + echo 1>&2 "\ +WARNING: \`$1' is needed, and you do not seem to have it handy on your + system. You might have modified some files without having the + proper tools for further handling them. + You can get \`$1' as part of \`Autoconf' from any GNU + archive site." + + file=`echo "$*" | sed -n 's/.*--output[ =]*\([^ ]*\).*/\1/p'` + test -z "$file" && file=`echo "$*" | sed -n 's/.*-o[ ]*\([^ ]*\).*/\1/p'` + if test -f "$file"; then + touch $file + else + test -z "$file" || exec >$file + echo "#! /bin/sh" + echo "# Created by GNU Automake missing as a replacement of" + echo "# $ $@" + echo "exit 0" + chmod +x $file + exit 1 + fi + ;; + + bison|yacc) + echo 1>&2 "\ +WARNING: \`$1' is missing on your system. You should only need it if + you modified a \`.y' file. You may need the \`Bison' package + in order for those modifications to take effect. You can get + \`Bison' from any GNU archive site." + rm -f y.tab.c y.tab.h + if [ $# -ne 1 ]; then + eval LASTARG="\${$#}" + case "$LASTARG" in + *.y) + SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'` + if [ -f "$SRCFILE" ]; then + cp "$SRCFILE" y.tab.c + fi + SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'` + if [ -f "$SRCFILE" ]; then + cp "$SRCFILE" y.tab.h + fi + ;; + esac + fi + if [ ! -f y.tab.h ]; then + echo >y.tab.h + fi + if [ ! -f y.tab.c ]; then + echo 'main() { return 0; }' >y.tab.c + fi + ;; + + lex|flex) + echo 1>&2 "\ +WARNING: \`$1' is missing on your system. You should only need it if + you modified a \`.l' file. You may need the \`Flex' package + in order for those modifications to take effect. You can get + \`Flex' from any GNU archive site." + rm -f lex.yy.c + if [ $# -ne 1 ]; then + eval LASTARG="\${$#}" + case "$LASTARG" in + *.l) + SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'` + if [ -f "$SRCFILE" ]; then + cp "$SRCFILE" lex.yy.c + fi + ;; + esac + fi + if [ ! -f lex.yy.c ]; then + echo 'main() { return 0; }' >lex.yy.c + fi + ;; + + help2man) + if test -z "$run" && ($1 --version) > /dev/null 2>&1; then + # We have it, but it failed. + exit 1 + fi + + echo 1>&2 "\ +WARNING: \`$1' is missing on your system. You should only need it if + you modified a dependency of a manual page. You may need the + \`Help2man' package in order for those modifications to take + effect. You can get \`Help2man' from any GNU archive site." + + file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'` + if test -z "$file"; then + file=`echo "$*" | sed -n 's/.*--output=\([^ ]*\).*/\1/p'` + fi + if [ -f "$file" ]; then + touch $file + else + test -z "$file" || exec >$file + echo ".ab help2man is required to generate this page" + exit 1 + fi + ;; + + makeinfo) + if test -z "$run" && (makeinfo --version) > /dev/null 2>&1; then + # We have makeinfo, but it failed. + exit 1 + fi + + echo 1>&2 "\ +WARNING: \`$1' is missing on your system. You should only need it if + you modified a \`.texi' or \`.texinfo' file, or any other file + indirectly affecting the aspect of the manual. The spurious + call might also be the consequence of using a buggy \`make' (AIX, + DU, IRIX). You might want to install the \`Texinfo' package or + the \`GNU make' package. Grab either from any GNU archive site." + file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'` + if test -z "$file"; then + file=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'` + file=`sed -n '/^@setfilename/ { s/.* \([^ ]*\) *$/\1/; p; q; }' $file` + fi + touch $file + ;; + + tar) + shift + if test -n "$run"; then + echo 1>&2 "ERROR: \`tar' requires --run" + exit 1 + fi + + # We have already tried tar in the generic part. + # Look for gnutar/gtar before invocation to avoid ugly error + # messages. + if (gnutar --version > /dev/null 2>&1); then + gnutar "$@" && exit 0 + fi + if (gtar --version > /dev/null 2>&1); then + gtar "$@" && exit 0 + fi + firstarg="$1" + if shift; then + case "$firstarg" in + *o*) + firstarg=`echo "$firstarg" | sed s/o//` + tar "$firstarg" "$@" && exit 0 + ;; + esac + case "$firstarg" in + *h*) + firstarg=`echo "$firstarg" | sed s/h//` + tar "$firstarg" "$@" && exit 0 + ;; + esac + fi + + echo 1>&2 "\ +WARNING: I can't seem to be able to run \`tar' with the given arguments. + You may want to install GNU tar or Free paxutils, or check the + command line arguments." + exit 1 + ;; + + *) + echo 1>&2 "\ +WARNING: \`$1' is needed, and you do not seem to have it handy on your + system. You might have modified some files without having the + proper tools for further handling them. Check the \`README' file, + it often tells you about the needed prerequisites for installing + this package. You may also peek at any GNU archive site, in case + some other package would contain this missing \`$1' program." + exit 1 + ;; +esac + +exit 0 diff --git a/app/lbxproxy/mkinstalldirs b/app/lbxproxy/mkinstalldirs new file mode 100644 index 000000000..d2d5f21b6 --- /dev/null +++ b/app/lbxproxy/mkinstalldirs @@ -0,0 +1,111 @@ +#! /bin/sh +# mkinstalldirs --- make directory hierarchy +# Author: Noah Friedman +# Created: 1993-05-16 +# Public domain + +errstatus=0 +dirmode="" + +usage="\ +Usage: mkinstalldirs [-h] [--help] [-m mode] dir ..." + +# process command line arguments +while test $# -gt 0 ; do + case $1 in + -h | --help | --h*) # -h for help + echo "$usage" 1>&2 + exit 0 + ;; + -m) # -m PERM arg + shift + test $# -eq 0 && { echo "$usage" 1>&2; exit 1; } + dirmode=$1 + shift + ;; + --) # stop option processing + shift + break + ;; + -*) # unknown option + echo "$usage" 1>&2 + exit 1 + ;; + *) # first non-opt arg + break + ;; + esac +done + +for file +do + if test -d "$file"; then + shift + else + break + fi +done + +case $# in + 0) exit 0 ;; +esac + +case $dirmode in + '') + if mkdir -p -- . 2>/dev/null; then + echo "mkdir -p -- $*" + exec mkdir -p -- "$@" + fi + ;; + *) + if mkdir -m "$dirmode" -p -- . 2>/dev/null; then + echo "mkdir -m $dirmode -p -- $*" + exec mkdir -m "$dirmode" -p -- "$@" + fi + ;; +esac + +for file +do + set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'` + shift + + pathcomp= + for d + do + pathcomp="$pathcomp$d" + case $pathcomp in + -*) pathcomp=./$pathcomp ;; + esac + + if test ! -d "$pathcomp"; then + echo "mkdir $pathcomp" + + mkdir "$pathcomp" || lasterr=$? + + if test ! -d "$pathcomp"; then + errstatus=$lasterr + else + if test ! -z "$dirmode"; then + echo "chmod $dirmode $pathcomp" + lasterr="" + chmod "$dirmode" "$pathcomp" || lasterr=$? + + if test ! -z "$lasterr"; then + errstatus=$lasterr + fi + fi + fi + fi + + pathcomp="$pathcomp/" + done +done + +exit $errstatus + +# Local Variables: +# mode: shell-script +# sh-indentation: 2 +# End: +# mkinstalldirs ends here diff --git a/app/lbxproxy/os/WaitFor.c b/app/lbxproxy/os/WaitFor.c new file mode 100644 index 000000000..7abda8b8a --- /dev/null +++ b/app/lbxproxy/os/WaitFor.c @@ -0,0 +1,210 @@ +/* $Xorg: WaitFor.c,v 1.4 2001/02/09 02:05:33 xorgcvs Exp $ */ +/*********************************************************** + +Copyright 1987, 1998 The Open Group + +Permission to use, copy, modify, distribute, and sell this software and its +documentation for any purpose is hereby granted without fee, provided that +the above copyright notice appear in all copies and that both that +copyright notice and this permission notice appear in supporting +documentation. + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the name of The Open Group shall not be +used in advertising or otherwise to promote the sale, use or other dealings +in this Software without prior written authorization from The Open Group. + + +Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. + + All Rights Reserved + +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, +provided that the above copyright notice appear in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the name of Digital not be +used in advertising or publicity pertaining to distribution of the +software without specific, written prior permission. + +DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING +ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL +DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR +ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, +ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS +SOFTWARE. + +******************************************************************/ +/* $XFree86: xc/programs/lbxproxy/os/WaitFor.c,v 1.8 2001/10/28 03:34:23 tsi Exp $ */ + +/***************************************************************** + * OS Dependent input routines: + * + * WaitForSomething + * TimerForce, TimerSet, TimerCheck, TimerFree + * + *****************************************************************/ + +#include /* for strings, fcntl, time */ + +#include +#include +#include "misc.h" +#include "util.h" +#include + +#include +#include "osdep.h" +#include "os.h" +#include "pm.h" + +int +mffs(fd_mask mask) +{ + int i; + + if (!mask) return 0; + + i = 1; + while (!(mask & 1)) + { + i++; + mask >>= 1; + } + return i; +} + +/***************** + * WaitForSomething: + * Make the server suspend until there is + * 1. data from clients or + * 2. clients that have buffered replies/events are ready + * + * For more info on ClientsWithInput, see ReadRequestFromClient(). + * pClientsReady is an array to store ready client->index values into. + *****************/ + +int +WaitForSomething(pClientsReady, poll) + int *pClientsReady; + Bool poll; +{ + int i; + struct timeval zerowt = {0, 0}; + struct timeval *wt; + fd_set clientsReadable; + fd_set clientsWritable; + int curclient; + int selecterr; + int nready; + + FD_ZERO(&clientsReadable); + + /* We need a while loop here to handle + crashed connections and the screen saver timeout */ + while (1) + { + /* deal with any blocked jobs */ + if (workQueue) + ProcessWorkQueue(); + + if (XFD_ANYSET(&ClientsWithInput)) + { + XFD_COPYSET(&ClientsWithInput, &clientsReadable); + break; + } + if (poll) + wt = &zerowt; + else + wt = NULL; + XFD_COPYSET(&AllSockets, &LastSelectMask); + if (NewOutputPending) + FlushAllOutput(); + /* keep this check close to select() call to minimize race */ + if (dispatchException) + i = -1; + else if (AnyClientsWriteBlocked) + { + XFD_COPYSET(&ClientsWriteBlocked, &clientsWritable); + i = Select (MaxClients, &LastSelectMask, &clientsWritable, NULL, wt); + } + else + i = Select (MaxClients, &LastSelectMask, NULL, NULL, wt); + selecterr = errno; + + if (poll && i == 0) + return 0; + else if (i <= 0) /* An error or timeout occurred */ + { + + if (dispatchException) + return 0; + FD_ZERO(&clientsWritable); + if (i < 0) { + if (selecterr == EBADF) /* Some client disconnected */ + { + CheckConnections (); + if (! XFD_ANYSET (&AllClients)) + return 0; + } + else if (selecterr != EINTR) + ErrorF("WaitForSomething(): select: errno=%d\n", + selecterr); + } + } + else + { + fd_set tmp_set; + if (AnyClientsWriteBlocked && XFD_ANYSET (&clientsWritable)) + { + NewOutputPending = TRUE; + XFD_ORSET(&OutputPending, &clientsWritable, &OutputPending); + XFD_UNSET(&ClientsWriteBlocked, &clientsWritable); + if (! XFD_ANYSET(&ClientsWriteBlocked)) + AnyClientsWriteBlocked = FALSE; + } + + XFD_ANDSET(&clientsReadable, &LastSelectMask, &AllClients); + XFD_ANDSET(&tmp_set, &LastSelectMask, &WellKnownConnections); + if (XFD_ANYSET(&tmp_set)) + QueueWorkProc(EstablishNewConnections, NULL, + (pointer)&LastSelectMask); + if (proxy_manager_fd >= 0 && + FD_ISSET(proxy_manager_fd, &LastSelectMask)) + HandleProxyManagerConnection (); + + if (XFD_ANYSET (&clientsReadable)) + break; + } + } + + nready = 0; + if (XFD_ANYSET(&clientsReadable)) + { + for (i=0; i +#include +#include +#include /* atoi */ +#include +#include +#include + +#include + +#ifdef hpux +#include +#include +#endif + +#ifdef AIXV3 +#include +#endif + +#ifdef QNX4 +#include +#endif + +#if defined (TCPCONN) || defined(STREAMSCONN) +# include +# if !defined(hpux) +# ifdef apollo +# ifndef NO_TCP_H +# include +# endif +# else +# include +# endif +# endif +#endif + +#include +#include +#include "osdep.h" +#include "os.h" +#include "lbx.h" +#include "util.h" +#include "pm.h" +#include "wire.h" + +#ifdef X_NOT_POSIX +#define Pid_t int +#else +#define Pid_t pid_t +#endif + +#ifdef DNETCONN +#include +#endif /* DNETCONN */ + +int lastfdesc; /* maximum file descriptor */ + +fd_set WellKnownConnections; /* Listener mask */ +fd_set AllSockets; /* select on this */ +fd_set AllClients; /* available clients */ +fd_set LastSelectMask; /* mask returned from last select call */ +fd_set ClientsWithInput; /* clients with FULL requests in buffer */ +fd_set ClientsWriteBlocked; /* clients who cannot receive output */ +fd_set OutputPending; /* clients with reply/event data ready to go */ +int MaxClients = 0; +Bool NewOutputPending; /* not yet attempted to write some new output */ +Bool AnyClientsWriteBlocked; /* true if some client blocked on write */ + +Bool RunFromSmartParent; /* send SIGUSR1 to parent process */ +Bool PartialNetwork; /* continue even if unable to bind all addrs */ +static int ParentProcess; + +static Bool debug_conns = FALSE; + +static fd_set IgnoredClientsWithInput; +static fd_set GrabImperviousClients; +static fd_set SavedAllClients; +static fd_set SavedAllSockets; +static fd_set SavedClientsWithInput; + +static int auditTrailLevel = 1; + +int GrabInProgress = 0; +int *ConnectionTranslation = NULL; +int *ConnectionOutputTranslation = NULL; + +static XtransConnInfo *ListenTransConns = NULL; +static int *ListenTransFds = NULL; +static int ListenTransCount = 0; + +unsigned long raw_stream_out; /* out to server, in from client */ +unsigned long raw_stream_in; /* in from server, out to client */ +extern unsigned long stream_out_plain; +extern unsigned long stream_in_plain; + +static void ErrorConnMax( + XtransConnInfo /* trans_conn */ +); + + +static Bool +PickNewListenDisplay (displayP) + char **displayP; +{ + static char newDisplay[16]; + long displayNum; + + errno = 0; + displayNum = strtol (*displayP, NULL, 10); + if ((displayNum >= 65535) || (displayNum < 0) || (errno != 0)) + return (FALSE); + + sprintf (newDisplay, "%d", displayNum + 1); + *displayP = newDisplay; + + return (TRUE); +} + +static XtransConnInfo +lookup_trans_conn (fd) + int fd; +{ + if (ListenTransFds) + { + int i; + for (i = 0; i < ListenTransCount; i++) + if (ListenTransFds[i] == fd) + return ListenTransConns[i]; + } + + return (NULL); +} + + +/* Set MaxClients and lastfdesc, and allocate ConnectionTranslation */ + +void +InitConnectionLimits() +{ + lastfdesc = -1; + +#ifndef __UNIXOS2__ + +#if !defined(XNO_SYSCONF) && defined(_SC_OPEN_MAX) + lastfdesc = sysconf(_SC_OPEN_MAX) - 1; +#endif + +#ifdef HAS_GETDTABLESIZE + if (lastfdesc < 0) + lastfdesc = getdtablesize() - 1; +#endif + +#ifdef _NFILE + if (lastfdesc < 0) + lastfdesc = _NFILE - 1; +#endif + +#else /* __UNIXOS2__ */ + lastfdesc = 255; +#endif + + /* This is the fallback */ + if (lastfdesc < 0) + lastfdesc = MAXSOCKS; + + if (lastfdesc > MAXSELECT) + lastfdesc = MAXSELECT; + + if (lastfdesc > 2 * MAXCLIENTS) + { + lastfdesc = 2 * MAXCLIENTS; + if (debug_conns) + ErrorF( "REACHED MAXIMUM CLIENTS LIMIT %d\n", MAXCLIENTS); + } + MaxClients = lastfdesc; + + ConnectionTranslation = (int *)xalloc((lastfdesc + 1) * sizeof(int)); + ConnectionOutputTranslation = (int *)xalloc((lastfdesc + 1) * sizeof(int)); + if (ConnectionTranslation == NULL || ConnectionOutputTranslation == NULL) + FatalError("failed to allocate ConnectionTranslation\n"); +} + +/* + * Create the socket(s) that clients will used for one server. + */ +void +CreateServerSockets(fds) + int fds[]; +{ + int done = 0; + int partial; + int tmp_trans_count; + XtransConnInfo *tmp_trans_conns; + + while (!done) + { + + if ((_LBXPROXYTransMakeAllCOTSServerListeners (display, &partial, + &tmp_trans_count, &tmp_trans_conns) >= 0) && + (tmp_trans_count >= 1)) + { + if (!PartialNetwork && partial) + { + (void) fprintf (stderr, "Failed to establish all listening sockets for port number '%s'\n", display); + if (PickNewListenDisplay (&display)) + continue; + } + else + { + int i, num_fds; + + /* + * Create or Re-create the ListenTransFds array + */ + if (!ListenTransFds) { + ListenTransFds = (int *) malloc (tmp_trans_count * + sizeof (int)); + } + else { + ListenTransFds = (int *) + realloc (ListenTransFds, + (ListenTransCount + tmp_trans_count) * + sizeof (int)); + } + if (!ListenTransFds) + FatalError ("Failed to create ListenTransFds"); + + /* + * Create or Re-create the ListenTransConns array + */ + if (!ListenTransConns) + ListenTransConns = tmp_trans_conns; + else { + + ListenTransConns = (XtransConnInfo *) + realloc (ListenTransConns, + (ListenTransCount + tmp_trans_count) * + sizeof (XtransConnInfo)); + if (!ListenTransConns) + FatalError ("Failed to create ListenTransFds"); + + /* + * Add in the new trans' for this server + */ + for (i = 0; i < tmp_trans_count; i++) + ListenTransConns[ListenTransCount + i] = + tmp_trans_conns[i]; + } + + for (i = 0, num_fds = 0; i < tmp_trans_count; i++, num_fds++) + { + int fd; + + fd = _LBXPROXYTransGetConnectionNumber ( + ListenTransConns[i + ListenTransCount]); + + fds[i] = fd; + ListenTransFds[i + ListenTransCount] = fd; + FD_SET (fd, &WellKnownConnections); + } + + ListenTransCount += tmp_trans_count; + + } + } else { + if (PickNewListenDisplay (&display)) + continue; + } + done = 1; + } + + if (!XFD_ANYSET (&WellKnownConnections)) + FatalError ("Cannot establish any listening sockets"); + + /* + * If the Proxy Manager isn't being used and the the default port + * number isn't available, need to advertise the port number that + * clients will use to connect to this server. + */ + if (!proxyMngr && strcmp (display, "63")) + (void) fprintf (stderr, "Using port number '%s'\n", display); +} + +void +CloseServerSockets() +{ + int i; + + for (i = 0; i < ListenTransCount; i++) + _LBXPROXYTransClose (ListenTransConns[i]); +} + +/***************** + * CreateWellKnownSockets + * Initialize the global connection file descriptor arrays + * but don't create the listen sockets until a server is + * requested. + *****************/ +void +CreateWellKnownSockets() +{ + int i; + + FD_ZERO(&AllSockets); + FD_ZERO(&AllClients); + FD_ZERO(&LastSelectMask); + FD_ZERO(&ClientsWithInput); + + for (i=0; i 0) { + kill (ParentProcess, SIGUSR1); + } + } +} + +void +ListenToProxyManager () +{ + if (proxy_manager_fd >= 0) + FD_SET(proxy_manager_fd, &AllSockets); +} + +void +ListenWellKnownSockets () +{ + XFD_ORSET (&AllSockets, &AllSockets, &WellKnownConnections); +} + +void +AvailableClientInput (client) + ClientPtr client; +{ + OsCommPtr oc = (OsCommPtr)client->osPrivate; + + if (FD_ISSET(oc->fd, &AllSockets)) + FD_SET(oc->fd, &ClientsWithInput); +} + +static int +ClientRead (fd, buf, len) + int fd; + char *buf; + int len; +{ + int n; + n = read(fd, buf, len); + if (n > 0) + raw_stream_out += n; + return n; +} + +static int +ClientWritev(fd, iov, iovcnt) + int fd; + struct iovec *iov; + int iovcnt; +{ + int n; + n = writev(fd, iov, iovcnt); + if (n > 0) + raw_stream_in += n; + return n; +} + +static int +ServerRead (fd, buf, len) + int fd; + char *buf; + int len; +{ + int n; + n = read(fd, buf, len); + if (n > 0) + stream_in_plain += n; + return n; +} + +static int +ServerWritev(fd, iov, iovcnt) + int fd; + struct iovec *iov; + int iovcnt; +{ + int n; + n = writev(fd, iov, iovcnt); + if (n > 0) + stream_out_plain += n; + return n; +} + +ClientPtr +AllocNewConnection (fd, connect_fd, to_server, trans_conn) + int fd; + int connect_fd; + Bool to_server; + XtransConnInfo trans_conn; +{ + OsCommPtr oc; + ClientPtr client; + + if (fd >= lastfdesc) + return NullClient; + oc = (OsCommPtr)xalloc(sizeof(OsCommRec)); + if (!oc) + return NullClient; + oc->fd = fd; + oc->trans_conn = trans_conn; + oc->input = (ConnectionInputPtr)NULL; + oc->output = (ConnectionOutputPtr)NULL; + if (to_server) { + oc->Read = ServerRead; + oc->Writev = ServerWritev; + oc->Close = CloseServer; + } else { + oc->Read = ClientRead; + oc->Writev = ClientWritev; + oc->Close = CloseDownFileDescriptor; + } + oc->flushClient = StandardFlushClient; + oc->ofirst = (ConnectionOutputPtr) NULL; + if (!(client = NextAvailableClient((pointer)oc, connect_fd))) + { + xfree (oc); + return NullClient; + } + if (!ConnectionTranslation[fd]) + { + ConnectionTranslation[fd] = client->index; + ConnectionOutputTranslation[fd] = client->index; + if (GrabInProgress) + { + FD_SET(fd, &SavedAllClients); + FD_SET(fd, &SavedAllSockets); + } + else + { + FD_SET(fd, &AllClients); + FD_SET(fd, &AllSockets); + } + } + client->public.readRequest = StandardReadRequestFromClient; + client->public.writeToClient = StandardWriteToClient; + client->public.requestLength = StandardRequestLength; + return client; +} + +void +SwitchConnectionFuncs (client, Read, Writev) + ClientPtr client; + int (*Read)(); + int (*Writev)(); +{ + OsCommPtr oc = (OsCommPtr) client->osPrivate; + + oc->Read = Read; + oc->Writev = Writev; +} + +void +StartOutputCompression(client, CompressOn, CompressOff) + ClientPtr client; + void (*CompressOn)(); + void (*CompressOff)(); +{ + OsCommPtr oc = (OsCommPtr) client->osPrivate; + + oc->compressOn = CompressOn; + oc->compressOff = CompressOff; + oc->flushClient = LbxFlushClient; +} + +/***************** + * EstablishNewConnections + * If anyone is waiting on listened sockets, accept them. + * Returns a mask with indices of new clients. Updates AllClients + * and AllSockets. + *****************/ + +/*ARGSUSED*/ +Bool +EstablishNewConnections(clientUnused, closure) + ClientPtr clientUnused; + pointer closure; +{ + fd_set readyconnections; /* set of listeners that are ready */ + int curconn; /* fd of listener that's ready */ + register int newconn; /* fd of new client */ + register ClientPtr client; + fd_set tmask; + int i; + + XFD_ANDSET(&tmask, (fd_set*)closure, &WellKnownConnections); + XFD_COPYSET(&tmask, &readyconnections); + if (!XFD_ANYSET(&readyconnections)) + return TRUE; + + for (i = 0; i < howmany(XFD_SETSIZE, NFDBITS); i++) + { + while (readyconnections.fds_bits[i]) + { + XtransConnInfo trans_conn, new_trans_conn; + int status; + + curconn = ffs (readyconnections.fds_bits[i]) - 1; + readyconnections.fds_bits[i] &= ~(1L << curconn); + curconn += (i * (sizeof(fd_mask)*8)); + + if ((trans_conn = lookup_trans_conn (curconn)) == NULL) + continue; + + if ((new_trans_conn = _LBXPROXYTransAccept (trans_conn, &status)) == NULL) + continue; + + newconn = _LBXPROXYTransGetConnectionNumber (new_trans_conn); + + _LBXPROXYTransSetOption(new_trans_conn, TRANS_NONBLOCKING, 1); + + client = AllocNewConnection (newconn, curconn, FALSE, new_trans_conn); + if (!client) + { + ErrorConnMax(new_trans_conn); + _LBXPROXYTransClose(new_trans_conn); + return FALSE; + } + } + } + + return TRUE; +} + +#define NOROOM "Maximum number of clients reached" + +/************ + * ErrorConnMax + * Fail a connection due to lack of client or file descriptor space + ************/ + +static void +ErrorConnMax(trans_conn) +XtransConnInfo trans_conn; +{ + register int fd = _LBXPROXYTransGetConnectionNumber (trans_conn); + xConnSetupPrefix csp; + char pad[3]; + struct iovec iov[3]; + char byteOrder = 0; + int whichbyte = 1; + struct timeval waittime; + fd_set mask; + + /* if these seems like a lot of trouble to go to, it probably is */ + waittime.tv_sec = BOTIMEOUT / MILLI_PER_SECOND; + waittime.tv_usec = (BOTIMEOUT % MILLI_PER_SECOND) * + (1000000 / MILLI_PER_SECOND); + FD_ZERO(&mask); + FD_SET(fd, &mask); + (void)Select(fd + 1, &mask, NULL, NULL, &waittime); + /* try to read the byte-order of the connection */ + (void)_LBXPROXYTransRead(trans_conn, &byteOrder, 1); + if ((byteOrder == 'l') || (byteOrder == 'B')) + { + csp.success = xFalse; + csp.lengthReason = sizeof(NOROOM) - 1; + csp.length = (sizeof(NOROOM) + 2) >> 2; + csp.majorVersion = X_PROTOCOL; + csp.minorVersion = X_PROTOCOL_REVISION; + if (((*(char *) &whichbyte) && (byteOrder == 'B')) || + (!(*(char *) &whichbyte) && (byteOrder == 'l'))) + { + swaps(&csp.majorVersion, whichbyte); + swaps(&csp.minorVersion, whichbyte); + swaps(&csp.length, whichbyte); + } + iov[0].iov_len = sz_xConnSetupPrefix; + iov[0].iov_base = (char *) &csp; + iov[1].iov_len = csp.lengthReason; + iov[1].iov_base = NOROOM; + iov[2].iov_len = (4 - (csp.lengthReason & 3)) & 3; + iov[2].iov_base = pad; + (void)_LBXPROXYTransWritev(trans_conn, iov, 3); + } +} + + +/************ + * CloseDownFileDescriptor: + * Remove this file descriptor and it's I/O buffers, etc. + ************/ + +void +CloseDownFileDescriptor(client) + ClientPtr client; +{ + register OsCommPtr oc = (OsCommPtr) client->osPrivate; + int connection = oc->fd; + + if (oc->trans_conn) { + _LBXPROXYTransDisconnect(oc->trans_conn); + _LBXPROXYTransClose(oc->trans_conn); + } + + ConnectionTranslation[connection] = 0; + ConnectionOutputTranslation[connection] = 0; + + FD_CLR(connection, &AllSockets); + FD_CLR(connection, &AllClients); + FD_CLR(connection, &ClientsWithInput); + FD_CLR(connection, &GrabImperviousClients); + if (GrabInProgress) + { + FD_CLR(connection, &SavedAllSockets); + FD_CLR(connection, &SavedAllClients); + FD_CLR(connection, &SavedClientsWithInput); + } + FD_CLR(connection, &ClientsWriteBlocked); + if (!XFD_ANYSET(&ClientsWriteBlocked)) + AnyClientsWriteBlocked = FALSE; + FD_CLR(connection, &OutputPending); +} + +/***************** + * CheckConections + * Some connection has died, go find which one and shut it down + * The file descriptor has been closed, but is still in AllClients. + * If would truly be wonderful if select() would put the bogus + * file descriptors in the exception mask, but nooooo. So we have + * to check each and every socket individually. + *****************/ + +void +CheckConnections() +{ + fd_mask mask; + fd_set tmask; + register int curclient, curoff; + int i; + struct timeval notime; + int r; + + notime.tv_sec = 0; + notime.tv_usec = 0; + + for (i=0; iosPrivate; + + if(!oc) + return; + if (oc->output && oc->output->count) + FlushClient(client, oc, (char *)NULL, 0); + ConnectionTranslation[oc->fd] = 0; + (*oc->Close) (client); + FreeOsBuffers(oc); + xfree(oc); + client->osPrivate = (pointer)NULL; + if (auditTrailLevel > 1) + AuditF("client %d disconnected\n", client->index); +} + +/***************** + * OnlyListenToOneClient: + * Only accept requests from one client. Continue to handle new + * connections, but don't take any protocol requests from the new + * ones. Note that if GrabInProgress is set, EstablishNewConnections + * needs to put new clients into SavedAllSockets and SavedAllClients. + * Note also that there is no timeout for this in the protocol. + * This routine is "undone" by ListenToAllClients() + *****************/ + +void +OnlyListenToOneClient(client) + ClientPtr client; +{ + OsCommPtr oc = (OsCommPtr)client->osPrivate; + int connection = oc->fd; + + if (! GrabInProgress) + { + XFD_COPYSET(&ClientsWithInput, &SavedClientsWithInput); + XFD_ANDSET(&ClientsWithInput, + &ClientsWithInput, &GrabImperviousClients); + if (FD_ISSET(connection, &SavedClientsWithInput)) + { + FD_CLR(connection, &SavedClientsWithInput); + FD_SET(connection, &ClientsWithInput); + } + XFD_UNSET(&SavedClientsWithInput, &GrabImperviousClients); + FD_CLR(connection, &AllSockets); + XFD_COPYSET(&AllSockets, &SavedAllSockets); + FD_CLR(connection, &AllClients); + XFD_COPYSET(&AllClients, &SavedAllClients); + XFD_UNSET(&AllSockets, &AllClients); + XFD_ANDSET(&AllClients, &AllClients, &GrabImperviousClients); + FD_SET(connection, &AllClients); + XFD_ORSET(&AllSockets, &AllSockets, &AllClients); + GrabInProgress = client->index; + } +} + +/**************** + * ListenToAllClients: + * Undoes OnlyListentToOneClient() + ****************/ + +void +ListenToAllClients() +{ + if (GrabInProgress) + { + XFD_ORSET(&AllSockets, &AllSockets, &SavedAllSockets); + XFD_ORSET(&AllClients, &AllClients, &SavedAllClients); + XFD_ORSET(&ClientsWithInput, &ClientsWithInput, &SavedClientsWithInput); + GrabInProgress = 0; + } +} + +/**************** + * IgnoreClient + * Removes one client from input masks. + * Must have cooresponding call to AttendClient. + ****************/ + +void +IgnoreClient (client) + ClientPtr client; +{ + OsCommPtr oc = (OsCommPtr)client->osPrivate; + int connection = oc->fd; + + if (!GrabInProgress || FD_ISSET (connection, &AllClients)) + { + if (FD_ISSET (connection, &ClientsWithInput)) + FD_SET(connection, &IgnoredClientsWithInput); + else + FD_CLR(connection, &IgnoredClientsWithInput); + FD_CLR(connection, &ClientsWithInput); + FD_CLR(connection, &AllSockets); + FD_CLR(connection, &AllClients); + FD_CLR(connection, &LastSelectMask); + } + else + { + if (FD_ISSET (connection, &SavedClientsWithInput)) + FD_SET(connection, &IgnoredClientsWithInput); + else + FD_CLR(connection, &IgnoredClientsWithInput); + FD_CLR(connection, &SavedClientsWithInput); + FD_CLR(connection, &SavedAllSockets); + FD_CLR(connection, &SavedAllClients); + } + isItTimeToYield = TRUE; +} + +/**************** + * AttendClient + * Adds one client back into the input masks. + ****************/ + +void +AttendClient (client) + ClientPtr client; +{ + OsCommPtr oc = (OsCommPtr)client->osPrivate; + int connection = oc->fd; + + if (!GrabInProgress || GrabInProgress == client->index || + FD_ISSET(connection, &GrabImperviousClients)) + { + FD_SET(connection, &AllClients); + FD_SET(connection, &AllSockets); + FD_SET(connection, &LastSelectMask); + if (FD_ISSET (connection, &IgnoredClientsWithInput)) + FD_SET(connection, &ClientsWithInput); + } + else + { + FD_SET(connection, &SavedAllClients); + FD_SET(connection, &SavedAllSockets); + if (FD_ISSET(connection, &IgnoredClientsWithInput)) + FD_SET(connection, &SavedClientsWithInput); + } +} + +/* make client impervious to grabs; assume only executing client calls this */ + +void +MakeClientGrabImpervious(client) + ClientPtr client; +{ + OsCommPtr oc = (OsCommPtr)client->osPrivate; + int connection = oc->fd; + + FD_SET(connection, &GrabImperviousClients); +} + +/* make client pervious to grabs; assume only executing client calls this */ + +void +MakeClientGrabPervious(client) + ClientPtr client; +{ + OsCommPtr oc = (OsCommPtr)client->osPrivate; + int connection = oc->fd; + + FD_CLR(connection, &GrabImperviousClients); + if (GrabInProgress && (GrabInProgress != client->index)) + { + if (FD_ISSET(connection, &ClientsWithInput)) + { + FD_SET(connection, &SavedClientsWithInput); + FD_CLR(connection, &ClientsWithInput); + } + FD_CLR(connection, &AllSockets); + FD_CLR(connection, &AllClients); + isItTimeToYield = TRUE; + } +} diff --git a/app/lbxproxy/os/io.c b/app/lbxproxy/os/io.c new file mode 100644 index 000000000..56604f852 --- /dev/null +++ b/app/lbxproxy/os/io.c @@ -0,0 +1,1231 @@ +/* $Xorg: io.c,v 1.6 2001/02/09 02:05:33 xorgcvs Exp $ */ +/* $XdotOrg: $ */ +/*********************************************************** + +Copyright 1987, 1989, 1998 The Open Group + +Permission to use, copy, modify, distribute, and sell this software and its +documentation for any purpose is hereby granted without fee, provided that +the above copyright notice appear in all copies and that both that +copyright notice and this permission notice appear in supporting +documentation. + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the name of The Open Group shall not be +used in advertising or otherwise to promote the sale, use or other dealings +in this Software without prior written authorization from The Open Group. + + +Copyright 1987, 1989 by Digital Equipment Corporation, Maynard, Massachusetts. + + All Rights Reserved + +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, +provided that the above copyright notice appear in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the name of Digital not be +used in advertising or publicity pertaining to distribution of the +software without specific, written prior permission. + +DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING +ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL +DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR +ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, +ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS +SOFTWARE. + +******************************************************************/ +/* $XFree86: xc/programs/lbxproxy/os/io.c,v 1.10 2001/12/14 20:00:58 dawes Exp $ */ +/***************************************************************** + * i/o functions + * + * WriteToClient, ReadRequestFromClient + * InsertFakeRequest, ResetCurrentRequest + * + *****************************************************************/ + +#include +#include +#include +#include "misc.h" +#include +#include +#include +#include "os.h" +#include +#include "osdep.h" +#include "lbx.h" + +#ifdef BIGREQS +#include +#endif + +/* check for both EAGAIN and EWOULDBLOCK, because some supposedly POSIX + * systems are broken and return EWOULDBLOCK when they should return EAGAIN + */ +#if defined(EAGAIN) && defined(EWOULDBLOCK) +#define ETEST(err) (err == EAGAIN || err == EWOULDBLOCK) +#else +#ifdef EAGAIN +#define ETEST(err) (err == EAGAIN) +#else +#define ETEST(err) (err == EWOULDBLOCK) +#endif +#endif + +extern void MarkClientException(); +static int timesThisConnection = 0; +static ConnectionInputPtr FreeInputs = (ConnectionInputPtr)NULL; +static ConnectionOutputPtr FreeOutputs = (ConnectionOutputPtr)NULL; +static OsCommPtr AvailableInput = (OsCommPtr)NULL; + +static ConnectionInputPtr AllocateInputBuffer( + void +); +static ConnectionOutputPtr AllocateOutputBuffer( + void +); +static ConnectionOutputPtr AllocateUncompBuffer( + int count +); + +#define get_req_len(req,cli) (((cli)->swapped ? \ + lswaps((req)->length) : (req)->length) << 2) + + +unsigned long +StandardRequestLength(req,client,got,partp) + xReq *req; + ClientPtr client; + int got; + Bool *partp; +{ + int len; + + if (got < sizeof (xReq)) + { + *partp = TRUE; + return sizeof (xReq); + } + if (!req) + req = (xReq *) client->requestBuffer; + len = get_req_len(req,client); + if (len > MAXBUFSIZE) + { + *partp = TRUE; + return -1; + } + *partp = FALSE; + return len; +} + +#ifdef BIGREQS +#define get_big_req_len(req,cli) (((cli)->swapped ? \ + lswapl(((xBigReq *)(req))->length) : \ + ((xBigReq *)(req))->length) << 2) + +#endif + +#define MAX_TIMES_PER 10 + + +/* + * A lot of the code in this file manipulates a ConnectionInputPtr: + * + * ----------------------------------------------- + * |------- bufcnt ------->| | | + * | |- gotnow ->| | | + * | |-------- needed ------>| | + * |-----------+--------- size --------+---------->| + * ----------------------------------------------- + * ^ ^ + * | | + * buffer bufptr + * + * buffer is a pointer to the start of the buffer. + * bufptr points to the start of the current request. + * bufcnt counts how many bytes are in the buffer. + * size is the size of the buffer in bytes. + * + * In several of the functions, gotnow and needed are local variables + * that do the following: + * + * gotnow is the number of bytes of the request that we're + * trying to read that are currently in the buffer. + * Typically, gotnow = (buffer + bufcnt) - bufptr + * + * needed = the length of the request that we're trying to + * read in bytes. + */ + + +/***************************************************************** + * ReadRequestFromClient + * Returns one request in client->requestBuffer. The request + * length will be in client->req_len. Return status is: + * + * > 0 if successful, specifies length in bytes of the request + * = 0 if entire request is not yet available + * < 0 if client should be terminated + * + * The request returned must be contiguous so that it can be + * cast in the dispatcher to the correct request type. Because requests + * are variable length, ReadRequestFromClient() must look at the first 4 + * or 8 bytes of a request to determine the length (the request length is + * in the 3rd and 4th bytes of the request unless it is a Big Request + * (see the Big Request Extension), in which case the 3rd and 4th bytes + * are zero and the following 4 bytes are the request length. + * + * Note: in order to make the server scheduler (WaitForSomething()) + * "fair", the ClientsWithInput mask is used. This mask tells which + * clients have FULL requests left in their buffers. Clients with + * partial requests require a read. Basically, client buffers + * are drained before select() is called again. But, we can't keep + * reading from a client that is sending buckets of data (or has + * a partial request) because others clients need to be scheduled. + *****************************************************************/ + +#define YieldControl() \ + { isItTimeToYield = TRUE; \ + timesThisConnection = 0; } +#define YieldControlNoInput() \ + { YieldControl(); \ + FD_CLR(fd, &ClientsWithInput); } +#define YieldControlDeath() \ + { timesThisConnection = 0; } + +int +StandardReadRequestFromClient(client) + ClientPtr client; +{ + OsCommPtr oc = (OsCommPtr)client->osPrivate; + register ConnectionInputPtr oci = oc->input; + int fd = oc->fd; + register int gotnow, needed; + int result; + register xReq *request; + int nextneeds; + Bool part; +#ifdef BIGREQS + Bool move_header; +#endif + + /* If an input buffer was empty, either free it if it is too big + * or link it into our list of free input buffers. This means that + * different clients can share the same input buffer (at different + * times). This was done to save memory. + */ + + if (AvailableInput) + { + if (AvailableInput != oc) + { + register ConnectionInputPtr aci = AvailableInput->input; + if (aci->size > BUFWATERMARK) + { + xfree(aci->buffer); + xfree(aci); + } + else + { + aci->next = FreeInputs; + FreeInputs = aci; + } + AvailableInput->input = (ConnectionInputPtr)NULL; + } + AvailableInput = (OsCommPtr)NULL; + } + + /* make sure we have an input buffer */ + + if (!oci) + { + if ((oci = FreeInputs)) + { + FreeInputs = oci->next; + } + else if (!(oci = AllocateInputBuffer())) + { + YieldControlDeath(); + return -1; + } + oc->input = oci; + } + + /* advance to start of next request */ + + oci->bufptr += oci->lenLastReq; + oci->lenLastReq = 0; + +#ifdef BIGREQS + move_header = FALSE; +#endif + gotnow = oci->bufcnt + oci->buffer - oci->bufptr; + client->requestBuffer = (pointer)oci->bufptr; + needed = RequestLength (NULL, client, gotnow, &part); + +#ifdef BIGREQS + if (!needed && client->big_requests) + { + /* It's a Big Request. */ + move_header = TRUE; + if (gotnow < sizeof(xBigReq)) + { + /* Still need more data to tell just how big. */ + needed = sizeof(xBigReq); + part = TRUE; + } + else + needed = get_big_req_len(client->requestBuffer, client); + } +#endif + + client->req_len = needed >> 2; + if (gotnow < needed || part) + { + /* Need to read more data, either so that we can get a + * complete xReq (if part is TRUE), a complete + * xBigReq (if move_header is TRUE), or the rest of the + * request (if part and move_header are both FALSE). + */ + + if (needed == -1) + { + YieldControlDeath(); + return -1; + } + if ((gotnow == 0) || + ((oci->bufptr - oci->buffer + needed) > oci->size)) + { + /* no data, or the request is too big to fit in the buffer */ + + if ((gotnow > 0) && (oci->bufptr != oci->buffer)) + /* save the data we've already read */ + memmove(oci->buffer, oci->bufptr, gotnow); + if (needed > oci->size) + { + /* make buffer bigger to accomodate request */ + char *ibuf; + + ibuf = (char *)xrealloc(oci->buffer, needed); + if (!ibuf) + { + YieldControlDeath(); + return -1; + } + oci->size = needed; + oci->buffer = ibuf; + } + oci->bufptr = oci->buffer; + oci->bufcnt = gotnow; + } + + if (oc->trans_conn) + result = _LBXPROXYTransRead(oc->trans_conn, + oci->buffer + oci->bufcnt, + oci->size - oci->bufcnt); + else + /* + * trans_conn can be NULL if the read is from an X server + */ + result = (*oc->Read)(fd, oci->buffer + oci->bufcnt, + oci->size - oci->bufcnt); + + if (result <= 0) + { + if ((result < 0) && ETEST(errno)) + { + YieldControlNoInput(); + return 0; + } + YieldControlDeath(); + return -1; + } + oci->bufcnt += result; + gotnow += result; + /* free up some space after huge requests */ + if ((oci->size > BUFWATERMARK) && + (oci->bufcnt < BUFSIZE) && (needed < BUFSIZE)) + { + char *ibuf; + + ibuf = (char *)xrealloc(oci->buffer, BUFSIZE); + if (ibuf) + { + oci->size = BUFSIZE; + oci->buffer = ibuf; + oci->bufptr = ibuf + oci->bufcnt - gotnow; + } + } + client->requestBuffer = (pointer) oci->bufptr; + if (part && gotnow >= needed) + { + /* We wanted an xReq, now we've gotten it. */ + needed = RequestLength (NULL, client, gotnow, &part); +#ifdef BIGREQS + if (!needed && client->big_requests) + { + move_header = TRUE; + if (gotnow < sizeof(xBigReq)) + needed = sizeof(xBigReq); + else + needed = get_big_req_len(client->requestBuffer, client); + } +#endif + client->req_len = needed >> 2; + } + if (gotnow < needed || part) + { + if (needed == -1) + { + YieldControlDeath(); + return -1; + } + /* Still don't have enough; punt. */ + YieldControlNoInput(); + return 0; + } + } + + if (needed == 0) + { +#ifdef BIGREQS + if (client->big_requests) + needed = sizeof(xBigReq); + else +#endif + needed = sizeof(xReq); + } + + oci->lenLastReq = needed; + + /* + * Check to see if client has at least one whole request in the + * buffer beyond the request we're returning to the caller. + * If there is only a partial request, treat like buffer + * is empty so that select() will be called again and other clients + * can get into the queue. + */ + + if (gotnow > needed) + { + request = (xReq *)(oci->bufptr + needed); + nextneeds = RequestLength (request, client, gotnow - needed, &part); + if (gotnow >= needed + nextneeds && !part +#ifdef BIGREQS + && (nextneeds || + (client->big_requests && + (nextneeds >= sizeof(xBigReq) && + nextneeds >= get_big_req_len(request, client)))) +#endif + ) + FD_SET(fd, &ClientsWithInput); + else + YieldControlNoInput(); + } + else + { + AvailableInput = oc; + YieldControlNoInput(); + } + if (++timesThisConnection >= MAX_TIMES_PER) + YieldControl(); +#ifdef BIGREQS + if (move_header) + { + request = (xReq *)oci->bufptr; + oci->bufptr += (sizeof(xBigReq) - sizeof(xReq)); + *(xReq *)oci->bufptr = *request; + oci->lenLastReq -= (sizeof(xBigReq) - sizeof(xReq)); + client->req_len -= (sizeof(xBigReq) - sizeof(xReq)) >> 2; + client->requestBuffer = oci->bufptr; + } +#endif + return needed; +} + +int +PendingClientOutput (client) + ClientPtr client; +{ + OsCommPtr oc = (OsCommPtr) client->osPrivate; + ConnectionOutputPtr oco = oc->output; + + return (oco && oco->count != 0) || oc->ofirst; +} + +int +CheckPendingClientInput (client) + ClientPtr client; +{ + OsCommPtr oc = (OsCommPtr)client->osPrivate; + register ConnectionInputPtr oci = oc->input; + xReq *request; + int gotnow; + int needed; + Bool part; + + if (!oci) + return 0; + needed = oci->lenLastReq; + gotnow = oci->bufcnt + oci->buffer - oci->bufptr; + request = (xReq *) (oci->bufptr + needed); + if (gotnow >= needed + RequestLength(request, client, gotnow - needed, &part) && !part) + { + FD_SET(oc->fd, &ClientsWithInput); + return 1; + } + return 0; +} + +void +MarkConnectionWriteBlocked (client) + ClientPtr client; +{ + OsCommPtr oc = (OsCommPtr)client->osPrivate; + + FD_SET(oc->fd, &ClientsWriteBlocked); + AnyClientsWriteBlocked = TRUE; +} + +int +BytesInClientBuffer (client) + ClientPtr client; +{ + OsCommPtr oc = (OsCommPtr)client->osPrivate; + register ConnectionInputPtr oci = oc->input; + + if (!oci) + return 0; + return oci->bufcnt + oci->buffer - (oci->bufptr + oci->lenLastReq); +} + +void +SkipInClientBuffer (client, nbytes, lenLastReq) + ClientPtr client; + int nbytes; + int lenLastReq; +{ + OsCommPtr oc = (OsCommPtr)client->osPrivate; + register ConnectionInputPtr oci = oc->input; + + if (!oci) + return; + oci->bufptr += nbytes; + oci->lenLastReq = lenLastReq; +} + +/***************************************************************** + * InsertFakeRequest + * Splice a consed up (possibly partial) request in as the next request. + * + **********************/ + +Bool +InsertFakeRequest(client, data, count) + ClientPtr client; + char *data; + int count; +{ + OsCommPtr oc = (OsCommPtr)client->osPrivate; + register ConnectionInputPtr oci = oc->input; + int fd = oc->fd; + register xReq *request; + register int gotnow, moveup; + Bool part; + + if (AvailableInput) + { + if (AvailableInput != oc) + { + register ConnectionInputPtr aci = AvailableInput->input; + if (aci->size > BUFWATERMARK) + { + xfree(aci->buffer); + xfree(aci); + } + else + { + aci->next = FreeInputs; + FreeInputs = aci; + } + AvailableInput->input = (ConnectionInputPtr)NULL; + } + AvailableInput = (OsCommPtr)NULL; + } + if (!oci) + { + if ((oci = FreeInputs)) + FreeInputs = oci->next; + else if (!(oci = AllocateInputBuffer())) + return FALSE; + oc->input = oci; + } + oci->bufptr += oci->lenLastReq; + oci->lenLastReq = 0; + gotnow = oci->bufcnt + oci->buffer - oci->bufptr; + if ((gotnow + count) > oci->size) + { + char *ibuf; + + ibuf = (char *)xrealloc(oci->buffer, gotnow + count); + if (!ibuf) + return(FALSE); + oci->size = gotnow + count; + oci->buffer = ibuf; + oci->bufptr = ibuf + oci->bufcnt - gotnow; + } + moveup = count - (oci->bufptr - oci->buffer); + if (moveup > 0) + { + if (gotnow > 0) + memmove(oci->bufptr + moveup, oci->bufptr, gotnow); + oci->bufptr += moveup; + oci->bufcnt += moveup; + } + memmove(oci->bufptr - count, data, count); + oci->bufptr -= count; + request = (xReq *)oci->bufptr; + gotnow += count; + if (gotnow >= RequestLength (request, client, gotnow, &part) && !part) + FD_SET(fd, &ClientsWithInput); + else + YieldControlNoInput(); + return(TRUE); +} + +/***************************************************************** + * ResetRequestFromClient + * Reset to reexecute the current request, and yield. + * + **********************/ + +void +ResetCurrentRequest(client) + ClientPtr client; +{ + OsCommPtr oc = (OsCommPtr)client->osPrivate; + register ConnectionInputPtr oci = oc->input; + int fd = oc->fd; + register xReq *request; + int gotnow; + Bool part; + + if (AvailableInput == oc) + AvailableInput = (OsCommPtr)NULL; + oci->lenLastReq = 0; + gotnow = oci->bufcnt + oci->buffer - oci->bufptr; + request = (xReq *)oci->bufptr; + if (gotnow >= RequestLength (request, client, gotnow, &part) && !part) + { + FD_SET(fd, &ClientsWithInput); + YieldControl(); + } + else + YieldControlNoInput(); +} + + /* lookup table for adding padding bytes to data that is read from + or written to the X socket. */ +static int padlength[4] = {0, 3, 2, 1}; + + /******************** + * FlushClient() + * If the client isn't keeping up with us, then we try to continue + * buffering the data and set the apropriate bit in ClientsWritable + * (which is used by WaitFor in the select). If the connection yields + * a permanent error, or we can't allocate any more space, we then + * close the connection. + * + **********************/ + +int +StandardFlushClient(who, oc, extraBuf, extraCount) + ClientPtr who; + OsCommPtr oc; + char *extraBuf; + int extraCount; /* do not modify... returned below */ +{ + register ConnectionOutputPtr oco = oc->output; + int connection = oc->fd; + XtransConnInfo trans_conn = oc->trans_conn; + struct iovec iov[3]; + static char padBuffer[3]; + long written; + long padsize; + long notWritten; + long todo; + + if (!oco) + return 0; + written = 0; + padsize = padlength[extraCount & 3]; + notWritten = oco->count + extraCount + padsize; + todo = notWritten; + while (notWritten) { + long before = written; /* amount of whole thing written */ + long remain = todo; /* amount to try this time, <= notWritten */ + int i = 0; + long len; + + /* You could be very general here and have "in" and "out" iovecs + * and write a loop without using a macro, but what the heck. This + * translates to: + * + * how much of this piece is new? + * if more new then we are trying this time, clamp + * if nothing new + * then bump down amount already written, for next piece + * else put new stuff in iovec, will need all of next piece + * + * Note that todo had better be at least 1 or else we'll end up + * writing 0 iovecs. + */ +#define InsertIOV(pointer, length) \ + len = (length) - before; \ + if (len > remain) \ + len = remain; \ + if (len <= 0) { \ + before = (-len); \ + } else { \ + iov[i].iov_len = len; \ + iov[i].iov_base = (pointer) + before; \ + i++; \ + remain -= len; \ + before = 0; \ + } + + InsertIOV ((char *)oco->buf, oco->count) + InsertIOV (extraBuf, extraCount) + InsertIOV (padBuffer, padsize) + + errno = 0; + if (trans_conn) + len = _LBXPROXYTransWritev(trans_conn, iov, i); + else + /* + * trans_conn can be NULL if the read is from an X server + */ + len = (*oc->Writev) (connection, iov, i); + if (len >= 0) + { + written += len; + notWritten -= len; + todo = notWritten; + } + else if (ETEST(errno) +#ifdef SUNSYSV /* check for another brain-damaged OS bug */ + || (errno == 0) +#endif +#ifdef EMSGSIZE /* check for another brain-damaged OS bug */ + || ((errno == EMSGSIZE) && (todo == 1)) +#endif + ) + { + /* If we've arrived here, then the client is stuffed to the gills + and not ready to accept more. Make a note of it and buffer + the rest. */ + FD_SET(connection, &ClientsWriteBlocked); + AnyClientsWriteBlocked = TRUE; + + if (written < oco->count) + { + if (written > 0) + { + oco->count -= written; + memmove((char *)oco->buf, + (char *)oco->buf + written, + oco->count); + written = 0; + } + } + else + { + written -= oco->count; + oco->count = 0; + } + + if (notWritten > oco->size) + { + unsigned char *obuf; + + obuf = (unsigned char *)xrealloc(oco->buf, + notWritten + BUFSIZE); + if (!obuf) + { + _LBXPROXYTransDisconnect(oc->trans_conn); + _LBXPROXYTransClose(oc->trans_conn); + oc->trans_conn = NULL; + MarkClientException(who); + oco->count = 0; + return(-1); + } + oco->size = notWritten + BUFSIZE; + oco->buf = obuf; + } + + /* If the amount written extended into the padBuffer, then the + difference "extraCount - written" may be less than 0 */ + if ((len = extraCount - written) > 0) + memmove ((char *)oco->buf + oco->count, + extraBuf + written, + len); + + oco->count = notWritten; /* this will include the pad */ + /* return only the amount explicitly requested */ + return extraCount; + } +#ifdef EMSGSIZE /* check for another brain-damaged OS bug */ + else if (errno == EMSGSIZE) + { + todo >>= 1; + } +#endif + else + { + if (oc->trans_conn) + { + _LBXPROXYTransDisconnect(oc->trans_conn); + _LBXPROXYTransClose(oc->trans_conn); + oc->trans_conn = NULL; + } + MarkClientException(who); + oco->count = 0; + return(-1); + } + } + + /* everything was flushed out */ + oco->count = 0; + /* check to see if this client was write blocked */ + if (AnyClientsWriteBlocked) + { + FD_CLR(oc->fd, &ClientsWriteBlocked); + if (! XFD_ANYSET(&ClientsWriteBlocked)) + AnyClientsWriteBlocked = FALSE; + } + if (oco->size > BUFWATERMARK) + { + xfree(oco->buf); + xfree(oco); + } + else + { + oco->next = FreeOutputs; + FreeOutputs = oco; + } + oc->output = (ConnectionOutputPtr)NULL; + return extraCount; /* return only the amount explicitly requested */ +} + +static int +ExpandOutputBuffer(oco, len) + ConnectionOutputPtr oco; + int len; +{ + unsigned char *obuf; + + if (len < BUFSIZE) + len = BUFSIZE; + obuf = (unsigned char *)xrealloc(oco->buf, len); + if (!obuf) + { + oco->count = 0; + return(-1); + } + oco->size = len; + oco->buf = obuf; + return 0; +} + +int +LbxFlushClient(who, oc, extraBuf, extraCount) + ClientPtr who; + OsCommPtr oc; + char *extraBuf; + int extraCount; /* do not modify... returned below */ +{ + ConnectionOutputPtr obuf; + register ConnectionOutputPtr oco; + int retval; + + if ((oco = oc->ofirst)) { + obuf = oc->output; + do { + Bool nocomp = oco->nocompress; + oc->output = oco; + oco = (oco != oc->olast) ? oco->next : NULL; + if (nocomp) + (*oc->compressOff)(oc->fd); + retval = StandardFlushClient(who, oc, (char *)NULL, 0); + if (nocomp) + (*oc->compressOn)(oc->fd); + if (retval < 0) { + oc->output = obuf; + return retval; + } + if (oc->output) { + if (extraCount) { + int len = (obuf->count + extraCount + 3) & ~3; + if (ExpandOutputBuffer(obuf, len) < 0) { + if (oc->trans_conn) { + _LBXPROXYTransDisconnect(oc->trans_conn); + _LBXPROXYTransClose(oc->trans_conn); + oc->trans_conn = NULL; + } + MarkClientException(who); + return(-1); + } + memmove((char *)obuf->buf + obuf->count, + extraBuf, extraCount); + obuf->count = len; + oc->olast->next = obuf; + oc->olast = obuf; + obuf = NULL; + } + oc->output = obuf; + return extraCount; + } + } while ((oc->ofirst = oco)); + oc->output = obuf; + } + retval = StandardFlushClient(who, oc, extraBuf, extraCount); + if (retval <= 0) + return retval; + if (oc->output && extraCount) { + oc->ofirst = oc->olast = oc->output; + oc->output = NULL; + } + return retval; +} + + /******************** + * FlushAllOutput() + * Flush all clients with output. However, if some client still + * has input in the queue (more requests), then don't flush. This + * will prevent the output queue from being flushed every time around + * the round robin queue. Now, some say that it SHOULD be flushed + * every time around, but... + * + **********************/ + +void +FlushAllOutput() +{ + register int index, base; + register fd_mask mask; + OsCommPtr oc; + register ClientPtr client; + + if (! NewOutputPending) + return; + + /* + * It may be that some client still has critical output pending, + * but he is not yet ready to receive it anyway, so we will + * simply wait for the select to tell us when he's ready to receive. + */ + NewOutputPending = FALSE; + + for (base = 0; base < howmany(XFD_SETSIZE, NFDBITS); base++) + { + mask = OutputPending.fds_bits[ base ]; + OutputPending.fds_bits[ base ] = 0; + while (mask) + { + index = ffs(mask) - 1; + mask &= ~lowbit(mask); + if ((index = ConnectionOutputTranslation[(base * (sizeof(fd_mask)*8)) + index]) == 0) + continue; + client = clients[index]; + if (client->clientGone) + continue; + oc = (OsCommPtr)client->osPrivate; + if (FD_ISSET(oc->fd, &ClientsWithInput)) + { + FD_SET(oc->fd, &OutputPending); /* set the bit again */ + NewOutputPending = TRUE; + } + else + (void)FlushClient(client, oc, (char *)NULL, 0); + } + } + +} + +/***************** + * WriteToClient + * Copies buf into ClientPtr.buf if it fits (with padding), else + * flushes ClientPtr.buf and buf to client. As of this writing, + * every use of WriteToClient is cast to void, and the result + * is ignored. Potentially, this could be used by requests + * that are sending several chunks of data and want to break + * out of a loop on error. Thus, we will leave the type of + * this routine as int. + *****************/ + +int +StandardWriteToClient (who, count, buf) + ClientPtr who; + char *buf; + int count; +{ + OsCommPtr oc = (OsCommPtr)who->osPrivate; + register ConnectionOutputPtr oco = oc->output; + int padBytes; + + if (!count || !buf) + return(0); + + if (!oco) + { + if ((oco = FreeOutputs)) + { + FreeOutputs = oco->next; + } + else if (!(oco = AllocateOutputBuffer())) + { + if (oc->trans_conn) + { + _LBXPROXYTransDisconnect(oc->trans_conn); + _LBXPROXYTransClose(oc->trans_conn); + oc->trans_conn = NULL; + } + MarkClientException(who); + return -1; + } + oc->output = oco; + } + + padBytes = padlength[count & 3]; + + if (oco->count + count + padBytes > oco->size) + { + FD_CLR(oc->fd, &OutputPending); + NewOutputPending = FALSE; + return FlushClient(who, oc, buf, count); + } + + NewOutputPending = TRUE; + FD_SET(oc->fd, &OutputPending); + memmove((char *)oco->buf + oco->count, buf, count); + oco->count += count; + + if (padBytes) + { + bzero ((char *)oco->buf + oco->count, padBytes); + oco->count += padBytes; + } + return(count); +} + +int +UncompressWriteToClient (who, count, buf) + ClientPtr who; + char *buf; + int count; +{ + OsCommPtr oc = (OsCommPtr)who->osPrivate; + register ConnectionOutputPtr oco; + int paddedLen = count + padlength[count & 3]; + + if (!count) + return(0); + + if ((oco = oc->output)) { + /* + * we're currently filling a buffer, and it must be compressible, + * so put it on the queue + */ + if (oc->ofirst) { + oc->olast->next = oco; + oc->olast = oco; + } + else { + oc->ofirst = oc->olast = oco; + } + oco = oc->output = (ConnectionOutputPtr)NULL; + } + else if (oc->ofirst) { + oco = oc->olast; + if (!oco->nocompress || ((oco->count + paddedLen) > oco->size)) + oco = (ConnectionOutputPtr)NULL; + } + + if (!oco) { + /* + * First try to use the FreeOutputs buffer + */ + oco = FreeOutputs; + if (oco) { + FreeOutputs = oco->next; + + oco->next = 0; + oco->count = 0; + oco->nocompress = TRUE; + + if (oco->size < paddedLen) { + oco->buf = (unsigned char *) xrealloc (oco->buf, paddedLen); + if (!oco->buf) { + if (oc->trans_conn) { + _LBXPROXYTransDisconnect(oc->trans_conn); + _LBXPROXYTransClose(oc->trans_conn); + oc->trans_conn = NULL; + } + MarkClientException(who); + return -1; + } + oco->size = paddedLen; + } + } + else if (!(oco = AllocateUncompBuffer(paddedLen))) { + if (oc->trans_conn) { + _LBXPROXYTransDisconnect(oc->trans_conn); + _LBXPROXYTransClose(oc->trans_conn); + oc->trans_conn = NULL; + } + MarkClientException(who); + return -1; + } + } + memmove((char *)oco->buf + oco->count, buf, count); + oco->count += paddedLen; + + if (oc->ofirst) { + oc->olast->next = oco; + oc->olast = oco; + } + else { + oc->ofirst = oc->olast = oco; + } + + NewOutputPending = TRUE; + FD_SET(oc->fd, &OutputPending); + return(count); +} + +static ConnectionInputPtr +AllocateInputBuffer() +{ + register ConnectionInputPtr oci; + + oci = (ConnectionInputPtr)xalloc(sizeof(ConnectionInput)); + if (!oci) + return (ConnectionInputPtr)NULL; + oci->buffer = (char *)xalloc(BUFSIZE); + if (!oci->buffer) + { + xfree(oci); + return (ConnectionInputPtr)NULL; + } + oci->size = BUFSIZE; + oci->bufptr = oci->buffer; + oci->bufcnt = 0; + oci->lenLastReq = 0; + return oci; +} + +static ConnectionOutputPtr +AllocateOutputBuffer() +{ + register ConnectionOutputPtr oco; + + oco = (ConnectionOutputPtr)xalloc(sizeof(ConnectionOutput)); + if (!oco) + return (ConnectionOutputPtr)NULL; + oco->buf = (unsigned char *) xalloc(BUFSIZE); + if (!oco->buf) + { + xfree(oco); + return (ConnectionOutputPtr)NULL; + } + oco->size = BUFSIZE; + oco->count = 0; + oco->nocompress = FALSE; + return oco; +} + +static ConnectionOutputPtr +AllocateUncompBuffer(count) + int count; +{ + register ConnectionOutputPtr oco; + int len = (count > BUFSIZE) ? count : BUFSIZE; + + oco = (ConnectionOutputPtr)xalloc(sizeof(ConnectionOutput)); + if (!oco) + return (ConnectionOutputPtr)NULL; + oco->buf = (unsigned char *) xalloc(len); + if (!oco->buf) + { + xfree(oco); + return (ConnectionOutputPtr)NULL; + } + oco->size = len; + oco->count = 0; + oco->nocompress = TRUE; + return oco; +} + +void +FreeOsBuffers(oc) + OsCommPtr oc; +{ + register ConnectionInputPtr oci; + register ConnectionOutputPtr oco; + + if (AvailableInput == oc) + AvailableInput = (OsCommPtr)NULL; + if ((oci = oc->input)) + { + if (FreeInputs) + { + xfree(oci->buffer); + xfree(oci); + } + else + { + FreeInputs = oci; + oci->next = (ConnectionInputPtr)NULL; + oci->bufptr = oci->buffer; + oci->bufcnt = 0; + oci->lenLastReq = 0; + } + } + if ((oco = oc->output)) + { + if (FreeOutputs) + { + xfree(oco->buf); + xfree(oco); + } + else + { + FreeOutputs = oco; + oco->next = (ConnectionOutputPtr)NULL; + oco->count = 0; + } + } + if ((oco = oc->ofirst)) { + ConnectionOutputPtr nextoco; + do { + nextoco = oco->next; + xfree(oco->buf); + xfree(oco); + if (oco == oc->olast) + break; + oco = nextoco; + } while (1); + } +} diff --git a/app/lbxproxy/os/lbxproxytrans.c b/app/lbxproxy/os/lbxproxytrans.c new file mode 100644 index 000000000..b6a78cd4e --- /dev/null +++ b/app/lbxproxy/os/lbxproxytrans.c @@ -0,0 +1,33 @@ +/* + * $Id: lbxproxytrans.c,v 1.1.1.1 2006/11/26 14:09:35 matthieu Exp $ + * + * Copyright © 2003 Keith Packard + * + * Permission to use, copy, modify, distribute, and sell this software and its + * documentation for any purpose is hereby granted without fee, provided that + * the above copyright notice appear in all copies and that both that + * copyright notice and this permission notice appear in supporting + * documentation, and that the name of Keith Packard not be used in + * advertising or publicity pertaining to distribution of the software without + * specific, written prior permission. Keith Packard makes no + * representations about the suitability of this software for any purpose. It + * is provided "as is" without express or implied warranty. + * + * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, + * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO + * EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR + * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, + * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER + * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR + * PERFORMANCE OF THIS SOFTWARE. + */ + +#ifdef HAVE_CONFIG_H +#include +#endif + +#define LBXPROXY_t +#define TRANS_CLIENT +#define TRANS_SERVER + +#include diff --git a/app/lbxproxy/os/osdep.h b/app/lbxproxy/os/osdep.h new file mode 100644 index 000000000..88672f229 --- /dev/null +++ b/app/lbxproxy/os/osdep.h @@ -0,0 +1,172 @@ +/* $Xorg: osdep.h,v 1.4 2001/02/09 02:05:33 xorgcvs Exp $ */ +/*********************************************************** + +Copyright 1987, 1998 The Open Group + +Permission to use, copy, modify, distribute, and sell this software and its +documentation for any purpose is hereby granted without fee, provided that +the above copyright notice appear in all copies and that both that +copyright notice and this permission notice appear in supporting +documentation. + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the name of The Open Group shall not be +used in advertising or otherwise to promote the sale, use or other dealings +in this Software without prior written authorization from The Open Group. + + +Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. + + All Rights Reserved + +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, +provided that the above copyright notice appear in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the name of Digital not be +used in advertising or publicity pertaining to distribution of the +software without specific, written prior permission. + +DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING +ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL +DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR +ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, +ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS +SOFTWARE. + +******************************************************************/ +/* $XFree86: xc/programs/lbxproxy/os/osdep.h,v 1.10 2001/12/14 20:00:58 dawes Exp $ */ + +#define BOTIMEOUT 200 /* in milliseconds */ +#define BUFSIZE 4096 +#define BUFWATERMARK 8192 +#define MAXBUFSIZE (1 << 22) + +#include + +#ifndef sgi /* SGI defines OPEN_MAX in a useless way */ +#ifndef X_NOT_POSIX +#ifdef _POSIX_SOURCE +#include +#else +#define _POSIX_SOURCE +#include +#undef _POSIX_SOURCE +#endif +#endif +#endif + +#if defined(__UNIXOS2__) || defined(__QNX__) +#define OPEN_MAX 256 +#endif + +#ifndef OPEN_MAX +#ifdef SVR4 +#define OPEN_MAX 128 +#else +#include +#ifndef OPEN_MAX +#if defined(NOFILE) && !defined(NOFILES_MAX) +#define OPEN_MAX NOFILE +#else +#define OPEN_MAX NOFILES_MAX +#endif +#endif +#endif +#endif + +#include + +/* + * MAXSOCKS is used only for initialising MaxClients when no other method + * like sysconf(_SC_OPEN_MAX) is not supported. + */ + +#if OPEN_MAX <= 128 +#define MAXSOCKS (OPEN_MAX - 1) +#else +#define MAXSOCKS 128 +#endif + +/* MAXSELECT is the number of fds that select() can handle */ +#define MAXSELECT (sizeof(fd_set) * NBBY) + +#if !defined(hpux) && !defined(SVR4) && !defined(SYSV) +#define HAS_GETDTABLESIZE +#endif + +#include + +typedef struct _connectionInput { + struct _connectionInput *next; + char *buffer; /* contains current client input */ + char *bufptr; /* pointer to current start of data */ + int bufcnt; /* count of bytes in buffer */ + int lenLastReq; + int size; +} ConnectionInput, *ConnectionInputPtr; + +typedef struct _connectionOutput { + struct _connectionOutput *next; + int size; + unsigned char *buf; + int count; + Bool nocompress; +} ConnectionOutput, *ConnectionOutputPtr; + +typedef struct _osComm { + int fd; + ConnectionInputPtr input; + ConnectionOutputPtr output; + ConnectionOutputPtr ofirst; + ConnectionOutputPtr olast; + void (*Close) (); + int (*Writev) (); + int (*Read) (); + int (*flushClient) (); + void (*compressOff) (); + void (*compressOn) (); + struct _XtransConnInfo *trans_conn; /* transport connection object */ +} OsCommRec, *OsCommPtr; + +#define FlushClient(who, oc, extraBuf, extraCount) \ + (*((OsCommPtr)((who)->osPrivate))->flushClient)(who, oc, extraBuf, extraCount) + +extern void FreeOsBuffers( + OsCommPtr /*oc*/ +); + +extern int StandardFlushClient( + ClientPtr /*who*/, + OsCommPtr /*oc*/, + char * /*extraBuf*/, + int /*extraCount*/ +); + +extern int LbxFlushClient( + ClientPtr /*who*/, + OsCommPtr /*oc*/, + char * /*extraBuf*/, + int /*extraCount*/ +); + +#include "util.h" + +extern int *ConnectionTranslation; +extern int *ConnectionOutputTranslation; + +extern WorkQueuePtr workQueue; + +#define ffs mffs +extern int mffs(fd_mask); + diff --git a/app/lbxproxy/os/osinit.c b/app/lbxproxy/os/osinit.c new file mode 100644 index 000000000..95a98b9c8 --- /dev/null +++ b/app/lbxproxy/os/osinit.c @@ -0,0 +1,64 @@ +/* $Xorg: osinit.c,v 1.4 2001/02/09 02:05:33 xorgcvs Exp $ */ +/*********************************************************** + +Copyright 1987, 1998 The Open Group + +Permission to use, copy, modify, distribute, and sell this software and its +documentation for any purpose is hereby granted without fee, provided that +the above copyright notice appear in all copies and that both that +copyright notice and this permission notice appear in supporting +documentation. + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the name of The Open Group shall not be +used in advertising or otherwise to promote the sale, use or other dealings +in this Software without prior written authorization from The Open Group. + + +Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. + + All Rights Reserved + +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, +provided that the above copyright notice appear in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the name of Digital not be +used in advertising or publicity pertaining to distribution of the +software without specific, written prior permission. + +DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING +ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL +DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR +ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, +ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS +SOFTWARE. + +******************************************************************/ + +#include +#include "misc.h" +#include "util.h" + +void +OsInit() +{ + static Bool been_here = FALSE; + + if (!been_here) { + fclose(stdin); + fclose(stdout); + been_here = TRUE; + } + OsInitAllocator(); +} diff --git a/app/twm/AUTHORS b/app/twm/AUTHORS new file mode 100644 index 000000000..e69de29bb diff --git a/app/twm/COPYING b/app/twm/COPYING new file mode 100644 index 000000000..7f33cbfd2 --- /dev/null +++ b/app/twm/COPYING @@ -0,0 +1,12 @@ +This is a stub file. This package has not yet had its complete licensing +information compiled. Please see the individual source files for details on +your rights to use and modify this software. + +Please submit updated COPYING files to the Xorg bugzilla: + +https://bugs.freedesktop.org/enter_bug.cgi?product=xorg + +All licensing questions regarding this software should be directed at the +Xorg mailing list: + +http://lists.freedesktop.org/mailman/listinfo/xorg diff --git a/app/twm/ChangeLog b/app/twm/ChangeLog new file mode 100644 index 000000000..5475530ef --- /dev/null +++ b/app/twm/ChangeLog @@ -0,0 +1,73 @@ +2006-06-03 Alan Coopersmith + + * src/session.c (ReadWinConfigEntry): + Coverity #369: If malloc of entry->wm_command fails, error cleanup + was still trying to read pointers from it to free. + +2006-06-02 Alan Coopersmith + + * src/menus.c (ExecuteFunction): + Coverity #1508: Variable "action" not freed or pointed-to + +2005-12-20 Kevin E. Martin + + * configure.ac: + Update package version for X11R7 release. + +2005-12-14 Kevin E. Martin + + * configure.ac: + Update package version number for final X11R7 release candidate. + +2005-12-06 Kevin E. Martin + + * man/Makefile.am: + Change *man_SOURCES ==> *man_PRE to fix autotools warnings. + +2005-12-03 Kevin E. Martin + + * configure.ac: + Update package version number for X11R7 RC3 release. + +2005-11-19 Kevin E. Martin + + * configure.ac: + Update dependencies to work with separate build roots. + +2005-10-18 Kevin E. Martin + + * configure.ac: + Update package version number for RC1 release. + +2005-10-16 Alan Coopersmith + + * src/Makefile.am: + Capitalize O in "X.Org Foundation" + + * configure.ac: + * man/Makefile.am: + Use cpp to substitute variables in man pages + +2005-10-15 Kevin E. Martin + + * src/Makefile.am: Have generated files be cleaned by maintainer + to pass check-tarball test. + +2005-10-09 Alan Coopersmith + + * src/Makefile.am (deftwmrc.c): + * src/deftwmrc.c: + * src/parse.c: + * src/parse.h: + Bug #3755 + twm can't handle 8-bit characters in .twmrc (Tomohiro KUBOITA) + +2005-08-02 Keith Packard + + * src/Makefile.am: +2005-08-02 Keith Packard + + * Makefile.am: + Mark generated files as BUILT_SOURCES and CLEANFILES + to ensure they are regenerated after 'make clean' and + to make parallel builds work right. diff --git a/app/twm/INSTALL b/app/twm/INSTALL new file mode 100644 index 000000000..e69de29bb diff --git a/app/twm/Makefile.am b/app/twm/Makefile.am new file mode 100644 index 000000000..d1b0a2216 --- /dev/null +++ b/app/twm/Makefile.am @@ -0,0 +1,24 @@ +# +# Copyright 2005 Red Hat, Inc. +# +# Permission to use, copy, modify, distribute, and sell this software and its +# documentation for any purpose is hereby granted without fee, provided that +# the above copyright notice appear in all copies and that both that +# copyright notice and this permission notice appear in supporting +# documentation, and that the name of Red Hat not be used in +# advertising or publicity pertaining to distribution of the software without +# specific, written prior permission. Red Hat makes no +# representations about the suitability of this software for any purpose. It +# is provided "as is" without express or implied warranty. +# +# RED HAT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, +# INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO +# EVENT SHALL RED HAT BE LIABLE FOR ANY SPECIAL, INDIRECT OR +# CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, +# DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER +# TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +# PERFORMANCE OF THIS SOFTWARE. + +SUBDIRS = src man + +EXTRA_DIST = sample-twmrc/jim.twmrc sample-twmrc/keith.twmrc sample-twmrc/lemke.twmrc diff --git a/app/twm/Makefile.in b/app/twm/Makefile.in new file mode 100644 index 000000000..8b3166bd1 --- /dev/null +++ b/app/twm/Makefile.in @@ -0,0 +1,624 @@ +# Makefile.in generated by automake 1.9.6 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005 Free Software Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +# +# Copyright 2005 Red Hat, Inc. +# +# Permission to use, copy, modify, distribute, and sell this software and its +# documentation for any purpose is hereby granted without fee, provided that +# the above copyright notice appear in all copies and that both that +# copyright notice and this permission notice appear in supporting +# documentation, and that the name of Red Hat not be used in +# advertising or publicity pertaining to distribution of the software without +# specific, written prior permission. Red Hat makes no +# representations about the suitability of this software for any purpose. It +# is provided "as is" without express or implied warranty. +# +# RED HAT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, +# INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO +# EVENT SHALL RED HAT BE LIABLE FOR ANY SPECIAL, INDIRECT OR +# CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, +# DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER +# TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +# PERFORMANCE OF THIS SOFTWARE. +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +top_builddir = . +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +INSTALL = @INSTALL@ +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \ + $(srcdir)/Makefile.in $(srcdir)/config.h.in \ + $(top_srcdir)/configure AUTHORS COPYING ChangeLog INSTALL NEWS \ + compile config.guess config.sub depcomp install-sh missing +subdir = . +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ + configure.lineno configure.status.lineno +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = config.h +CONFIG_CLEAN_FILES = +SOURCES = +DIST_SOURCES = +RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ + html-recursive info-recursive install-data-recursive \ + install-exec-recursive install-info-recursive \ + install-recursive installcheck-recursive installdirs-recursive \ + pdf-recursive ps-recursive uninstall-info-recursive \ + uninstall-recursive +ETAGS = etags +CTAGS = ctags +DIST_SUBDIRS = $(SUBDIRS) +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +distdir = $(PACKAGE)-$(VERSION) +top_distdir = $(distdir) +am__remove_distdir = \ + { test ! -d $(distdir) \ + || { find $(distdir) -type d ! -perm -200 -exec chmod u+w {} ';' \ + && rm -fr $(distdir); }; } +DIST_ARCHIVES = $(distdir).tar.gz $(distdir).tar.bz2 +GZIP_ENV = --best +distuninstallcheck_listfiles = find . -type f -print +distcleancheck_listfiles = find . -type f -print +ACLOCAL = @ACLOCAL@ +ADMIN_MAN_DIR = @ADMIN_MAN_DIR@ +ADMIN_MAN_SUFFIX = @ADMIN_MAN_SUFFIX@ +AMDEP_FALSE = @AMDEP_FALSE@ +AMDEP_TRUE = @AMDEP_TRUE@ +AMTAR = @AMTAR@ +APP_MAN_DIR = @APP_MAN_DIR@ +APP_MAN_SUFFIX = @APP_MAN_SUFFIX@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPPFLAGS = @CPPFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DRIVER_MAN_DIR = @DRIVER_MAN_DIR@ +DRIVER_MAN_SUFFIX = @DRIVER_MAN_SUFFIX@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EXEEXT = @EXEEXT@ +FILE_MAN_DIR = @FILE_MAN_DIR@ +FILE_MAN_SUFFIX = @FILE_MAN_SUFFIX@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LDFLAGS = @LDFLAGS@ +LEX = @LEX@ +LEXLIB = @LEXLIB@ +LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIB_MAN_DIR = @LIB_MAN_DIR@ +LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@ +LTLIBOBJS = @LTLIBOBJS@ +MAINT = @MAINT@ +MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@ +MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@ +MAKEINFO = @MAKEINFO@ +MISC_MAN_DIR = @MISC_MAN_DIR@ +MISC_MAN_SUFFIX = @MISC_MAN_SUFFIX@ +OBJEXT = @OBJEXT@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PKG_CONFIG = @PKG_CONFIG@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +TWM_CFLAGS = @TWM_CFLAGS@ +TWM_LIBS = @TWM_LIBS@ +VERSION = @VERSION@ +YACC = @YACC@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_STRIP = @ac_ct_STRIP@ +ac_pt_PKG_CONFIG = @ac_pt_PKG_CONFIG@ +am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ +am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +datadir = @datadir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +SUBDIRS = src man +EXTRA_DIST = sample-twmrc/jim.twmrc sample-twmrc/keith.twmrc sample-twmrc/lemke.twmrc +all: config.h + $(MAKE) $(AM_MAKEFLAGS) all-recursive + +.SUFFIXES: +am--refresh: + @: +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + echo ' cd $(srcdir) && $(AUTOMAKE) --gnu '; \ + cd $(srcdir) && $(AUTOMAKE) --gnu \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu Makefile'; \ + cd $(top_srcdir) && \ + $(AUTOMAKE) --gnu Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + echo ' $(SHELL) ./config.status'; \ + $(SHELL) ./config.status;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + $(SHELL) ./config.status --recheck + +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(srcdir) && $(AUTOCONF) +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) + +config.h: stamp-h1 + @if test ! -f $@; then \ + rm -f stamp-h1; \ + $(MAKE) stamp-h1; \ + else :; fi + +stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status + @rm -f stamp-h1 + cd $(top_builddir) && $(SHELL) ./config.status config.h +$(srcdir)/config.h.in: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(top_srcdir) && $(AUTOHEADER) + rm -f stamp-h1 + touch $@ + +distclean-hdr: + -rm -f config.h stamp-h1 +uninstall-info-am: + +# This directory's subdirectories are mostly independent; you can cd +# into them and run `make' without going through this Makefile. +# To change the values of `make' variables: instead of editing Makefiles, +# (1) if the variable is set in `config.status', edit `config.status' +# (which will cause the Makefiles to be regenerated when you run `make'); +# (2) otherwise, pass the desired values on the `make' command line. +$(RECURSIVE_TARGETS): + @failcom='exit 1'; \ + for f in x $$MAKEFLAGS; do \ + case $$f in \ + *=* | --[!k]*);; \ + *k*) failcom='fail=yes';; \ + esac; \ + done; \ + dot_seen=no; \ + target=`echo $@ | sed s/-recursive//`; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + echo "Making $$target in $$subdir"; \ + if test "$$subdir" = "."; then \ + dot_seen=yes; \ + local_target="$$target-am"; \ + else \ + local_target="$$target"; \ + fi; \ + (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || eval $$failcom; \ + done; \ + if test "$$dot_seen" = "no"; then \ + $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ + fi; test -z "$$fail" + +mostlyclean-recursive clean-recursive distclean-recursive \ +maintainer-clean-recursive: + @failcom='exit 1'; \ + for f in x $$MAKEFLAGS; do \ + case $$f in \ + *=* | --[!k]*);; \ + *k*) failcom='fail=yes';; \ + esac; \ + done; \ + dot_seen=no; \ + case "$@" in \ + distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ + *) list='$(SUBDIRS)' ;; \ + esac; \ + rev=''; for subdir in $$list; do \ + if test "$$subdir" = "."; then :; else \ + rev="$$subdir $$rev"; \ + fi; \ + done; \ + rev="$$rev ."; \ + target=`echo $@ | sed s/-recursive//`; \ + for subdir in $$rev; do \ + echo "Making $$target in $$subdir"; \ + if test "$$subdir" = "."; then \ + local_target="$$target-am"; \ + else \ + local_target="$$target"; \ + fi; \ + (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || eval $$failcom; \ + done && test -z "$$fail" +tags-recursive: + list='$(SUBDIRS)'; for subdir in $$list; do \ + test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ + done +ctags-recursive: + list='$(SUBDIRS)'; for subdir in $$list; do \ + test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ + done + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: tags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ + include_option=--etags-include; \ + empty_fix=.; \ + else \ + include_option=--include; \ + empty_fix=; \ + fi; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + test ! -f $$subdir/TAGS || \ + tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \ + fi; \ + done; \ + list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$tags $$unique; \ + fi +ctags: CTAGS +CTAGS: ctags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + test -z "$(CTAGS_ARGS)$$tags$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$tags $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && cd $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) $$here + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + $(am__remove_distdir) + mkdir $(distdir) + $(mkdir_p) $(distdir)/sample-twmrc + @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ + list='$(DISTFILES)'; for file in $$list; do \ + case $$file in \ + $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ + $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ + esac; \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test "$$dir" != "$$file" && test "$$dir" != "."; then \ + dir="/$$dir"; \ + $(mkdir_p) "$(distdir)$$dir"; \ + else \ + dir=''; \ + fi; \ + if test -d $$d/$$file; then \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ + fi; \ + cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ + else \ + test -f $(distdir)/$$file \ + || cp -p $$d/$$file $(distdir)/$$file \ + || exit 1; \ + fi; \ + done + list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + test -d "$(distdir)/$$subdir" \ + || $(mkdir_p) "$(distdir)/$$subdir" \ + || exit 1; \ + distdir=`$(am__cd) $(distdir) && pwd`; \ + top_distdir=`$(am__cd) $(top_distdir) && pwd`; \ + (cd $$subdir && \ + $(MAKE) $(AM_MAKEFLAGS) \ + top_distdir="$$top_distdir" \ + distdir="$$distdir/$$subdir" \ + distdir) \ + || exit 1; \ + fi; \ + done + -find $(distdir) -type d ! -perm -777 -exec chmod a+rwx {} \; -o \ + ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \ + ! -type d ! -perm -400 -exec chmod a+r {} \; -o \ + ! -type d ! -perm -444 -exec $(SHELL) $(install_sh) -c -m a+r {} {} \; \ + || chmod -R a+r $(distdir) +dist-gzip: distdir + tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz + $(am__remove_distdir) +dist-bzip2: distdir + tardir=$(distdir) && $(am__tar) | bzip2 -9 -c >$(distdir).tar.bz2 + $(am__remove_distdir) + +dist-tarZ: distdir + tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z + $(am__remove_distdir) + +dist-shar: distdir + shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz + $(am__remove_distdir) + +dist-zip: distdir + -rm -f $(distdir).zip + zip -rq $(distdir).zip $(distdir) + $(am__remove_distdir) + +dist dist-all: distdir + tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz + tardir=$(distdir) && $(am__tar) | bzip2 -9 -c >$(distdir).tar.bz2 + $(am__remove_distdir) + +# This target untars the dist file and tries a VPATH configuration. Then +# it guarantees that the distribution is self-contained by making another +# tarfile. +distcheck: dist + case '$(DIST_ARCHIVES)' in \ + *.tar.gz*) \ + GZIP=$(GZIP_ENV) gunzip -c $(distdir).tar.gz | $(am__untar) ;;\ + *.tar.bz2*) \ + bunzip2 -c $(distdir).tar.bz2 | $(am__untar) ;;\ + *.tar.Z*) \ + uncompress -c $(distdir).tar.Z | $(am__untar) ;;\ + *.shar.gz*) \ + GZIP=$(GZIP_ENV) gunzip -c $(distdir).shar.gz | unshar ;;\ + *.zip*) \ + unzip $(distdir).zip ;;\ + esac + chmod -R a-w $(distdir); chmod a+w $(distdir) + mkdir $(distdir)/_build + mkdir $(distdir)/_inst + chmod a-w $(distdir) + dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \ + && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ + && cd $(distdir)/_build \ + && ../configure --srcdir=.. --prefix="$$dc_install_base" \ + $(DISTCHECK_CONFIGURE_FLAGS) \ + && $(MAKE) $(AM_MAKEFLAGS) \ + && $(MAKE) $(AM_MAKEFLAGS) dvi \ + && $(MAKE) $(AM_MAKEFLAGS) check \ + && $(MAKE) $(AM_MAKEFLAGS) install \ + && $(MAKE) $(AM_MAKEFLAGS) installcheck \ + && $(MAKE) $(AM_MAKEFLAGS) uninstall \ + && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \ + distuninstallcheck \ + && chmod -R a-w "$$dc_install_base" \ + && ({ \ + (cd ../.. && umask 077 && mkdir "$$dc_destdir") \ + && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \ + && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \ + && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \ + distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \ + } || { rm -rf "$$dc_destdir"; exit 1; }) \ + && rm -rf "$$dc_destdir" \ + && $(MAKE) $(AM_MAKEFLAGS) dist \ + && rm -rf $(DIST_ARCHIVES) \ + && $(MAKE) $(AM_MAKEFLAGS) distcleancheck + $(am__remove_distdir) + @(echo "$(distdir) archives ready for distribution: "; \ + list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \ + sed -e '1{h;s/./=/g;p;x;}' -e '$${p;x;}' +distuninstallcheck: + @cd $(distuninstallcheck_dir) \ + && test `$(distuninstallcheck_listfiles) | wc -l` -le 1 \ + || { echo "ERROR: files left after uninstall:" ; \ + if test -n "$(DESTDIR)"; then \ + echo " (check DESTDIR support)"; \ + fi ; \ + $(distuninstallcheck_listfiles) ; \ + exit 1; } >&2 +distcleancheck: distclean + @if test '$(srcdir)' = . ; then \ + echo "ERROR: distcleancheck can only run from a VPATH build" ; \ + exit 1 ; \ + fi + @test `$(distcleancheck_listfiles) | wc -l` -eq 0 \ + || { echo "ERROR: files left in build directory after distclean:" ; \ + $(distcleancheck_listfiles) ; \ + exit 1; } >&2 +check-am: all-am +check: check-recursive +all-am: Makefile config.h +installdirs: installdirs-recursive +installdirs-am: +install: install-recursive +install-exec: install-exec-recursive +install-data: install-data-recursive +uninstall: uninstall-recursive + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-recursive +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-recursive + +clean-am: clean-generic mostlyclean-am + +distclean: distclean-recursive + -rm -f $(am__CONFIG_DISTCLEAN_FILES) + -rm -f Makefile +distclean-am: clean-am distclean-generic distclean-hdr distclean-tags + +dvi: dvi-recursive + +dvi-am: + +html: html-recursive + +info: info-recursive + +info-am: + +install-data-am: + +install-exec-am: + +install-info: install-info-recursive + +install-man: + +installcheck-am: + +maintainer-clean: maintainer-clean-recursive + -rm -f $(am__CONFIG_DISTCLEAN_FILES) + -rm -rf $(top_srcdir)/autom4te.cache + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-recursive + +mostlyclean-am: mostlyclean-generic + +pdf: pdf-recursive + +pdf-am: + +ps: ps-recursive + +ps-am: + +uninstall-am: uninstall-info-am + +uninstall-info: uninstall-info-recursive + +.PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am am--refresh check \ + check-am clean clean-generic clean-recursive ctags \ + ctags-recursive dist dist-all dist-bzip2 dist-gzip dist-shar \ + dist-tarZ dist-zip distcheck distclean distclean-generic \ + distclean-hdr distclean-recursive distclean-tags \ + distcleancheck distdir distuninstallcheck dvi dvi-am html \ + html-am info info-am install install-am install-data \ + install-data-am install-exec install-exec-am install-info \ + install-info-am install-man install-strip installcheck \ + installcheck-am installdirs installdirs-am maintainer-clean \ + maintainer-clean-generic maintainer-clean-recursive \ + mostlyclean mostlyclean-generic mostlyclean-recursive pdf \ + pdf-am ps ps-am tags tags-recursive uninstall uninstall-am \ + uninstall-info-am + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/app/twm/NEWS b/app/twm/NEWS new file mode 100644 index 000000000..e69de29bb diff --git a/app/twm/README b/app/twm/README new file mode 100644 index 000000000..e69de29bb diff --git a/app/twm/aclocal.m4 b/app/twm/aclocal.m4 new file mode 100644 index 000000000..8fa6fea6d --- /dev/null +++ b/app/twm/aclocal.m4 @@ -0,0 +1,1450 @@ +# generated automatically by aclocal 1.9.6 -*- Autoconf -*- + +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, +# 2005 Free Software Foundation, Inc. +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +# pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*- +# +# Copyright © 2004 Scott James Remnant . +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +# PKG_PROG_PKG_CONFIG([MIN-VERSION]) +# ---------------------------------- +AC_DEFUN([PKG_PROG_PKG_CONFIG], +[m4_pattern_forbid([^_?PKG_[A-Z_]+$]) +m4_pattern_allow([^PKG_CONFIG(_PATH)?$]) +AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])dnl +if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then + AC_PATH_TOOL([PKG_CONFIG], [pkg-config]) +fi +if test -n "$PKG_CONFIG"; then + _pkg_min_version=m4_default([$1], [0.9.0]) + AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version]) + if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then + AC_MSG_RESULT([yes]) + else + AC_MSG_RESULT([no]) + PKG_CONFIG="" + fi + +fi[]dnl +])# PKG_PROG_PKG_CONFIG + +# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) +# +# Check to see whether a particular set of modules exists. Similar +# to PKG_CHECK_MODULES(), but does not set variables or print errors. +# +# +# Similar to PKG_CHECK_MODULES, make sure that the first instance of +# this or PKG_CHECK_MODULES is called, or make sure to call +# PKG_CHECK_EXISTS manually +# -------------------------------------------------------------- +AC_DEFUN([PKG_CHECK_EXISTS], +[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl +if test -n "$PKG_CONFIG" && \ + AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then + m4_ifval([$2], [$2], [:]) +m4_ifvaln([$3], [else + $3])dnl +fi]) + + +# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES]) +# --------------------------------------------- +m4_define([_PKG_CONFIG], +[if test -n "$PKG_CONFIG"; then + if test -n "$$1"; then + pkg_cv_[]$1="$$1" + else + PKG_CHECK_EXISTS([$3], + [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`], + [pkg_failed=yes]) + fi +else + pkg_failed=untried +fi[]dnl +])# _PKG_CONFIG + +# _PKG_SHORT_ERRORS_SUPPORTED +# ----------------------------- +AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED], +[AC_REQUIRE([PKG_PROG_PKG_CONFIG]) +if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then + _pkg_short_errors_supported=yes +else + _pkg_short_errors_supported=no +fi[]dnl +])# _PKG_SHORT_ERRORS_SUPPORTED + + +# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND], +# [ACTION-IF-NOT-FOUND]) +# +# +# Note that if there is a possibility the first call to +# PKG_CHECK_MODULES might not happen, you should be sure to include an +# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac +# +# +# -------------------------------------------------------------- +AC_DEFUN([PKG_CHECK_MODULES], +[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl +AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl +AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl + +pkg_failed=no +AC_MSG_CHECKING([for $1]) + +_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2]) +_PKG_CONFIG([$1][_LIBS], [libs], [$2]) + +m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS +and $1[]_LIBS to avoid the need to call pkg-config. +See the pkg-config man page for more details.]) + +if test $pkg_failed = yes; then + _PKG_SHORT_ERRORS_SUPPORTED + if test $_pkg_short_errors_supported = yes; then + $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "$2"` + else + $1[]_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "$2"` + fi + # Put the nasty error message in config.log where it belongs + echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD + + ifelse([$4], , [AC_MSG_ERROR(dnl +[Package requirements ($2) were not met: + +$$1_PKG_ERRORS + +Consider adjusting the PKG_CONFIG_PATH environment variable if you +installed software in a non-standard prefix. + +_PKG_TEXT +])], + [AC_MSG_RESULT([no]) + $4]) +elif test $pkg_failed = untried; then + ifelse([$4], , [AC_MSG_FAILURE(dnl +[The pkg-config script could not be found or is too old. Make sure it +is in your PATH or set the PKG_CONFIG environment variable to the full +path to pkg-config. + +_PKG_TEXT + +To get pkg-config, see .])], + [$4]) +else + $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS + $1[]_LIBS=$pkg_cv_[]$1[]_LIBS + AC_MSG_RESULT([yes]) + ifelse([$3], , :, [$3]) +fi[]dnl +])# PKG_CHECK_MODULES + +dnl +dnl Copyright 2005-2006 Sun Microsystems, Inc. All rights reserved. +dnl +dnl Permission is hereby granted, free of charge, to any person obtaining a +dnl copy of this software and associated documentation files (the +dnl "Software"), to deal in the Software without restriction, including +dnl without limitation the rights to use, copy, modify, merge, publish, +dnl distribute, and/or sell copies of the Software, and to permit persons +dnl to whom the Software is furnished to do so, provided that the above +dnl copyright notice(s) and this permission notice appear in all copies of +dnl the Software and that both the above copyright notice(s) and this +dnl permission notice appear in supporting documentation. +dnl +dnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +dnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +dnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT +dnl OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR +dnl HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL +dnl INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING +dnl FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, +dnl NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION +dnl WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +dnl +dnl Except as contained in this notice, the name of a copyright holder +dnl shall not be used in advertising or otherwise to promote the sale, use +dnl or other dealings in this Software without prior written authorization +dnl of the copyright holder. + +# XORG_MACROS_VERSION(required-version) +# ------------------------------------- +# Minimum version: 1.1.0 +# +# If you're using a macro added in Version 1.1 or newer, include this in +# your configure.ac with the minimum required version, such as: +# XORG_MACROS_VERSION(1.1) +# +# To force at least a version with this macro defined, also add: +# m4_ifndef([XORG_MACROS_VERSION], [AC_FATAL([must install xorg-macros 1.1 or later before running autoconf/autogen])]) +# +# +# See the "minimum version" comment for each macro you use to see what +# version you require. +AC_DEFUN([XORG_MACROS_VERSION],[ + [XORG_MACROS_needed_version=$1 + XORG_MACROS_needed_major=`echo $XORG_MACROS_needed_version | sed 's/\..*$//'` + XORG_MACROS_needed_minor=`echo $XORG_MACROS_needed_version | sed -e 's/^[0-9]*\.//' -e 's/\..*$//'`] + AC_MSG_CHECKING([if xorg-macros used to generate configure is at least ${XORG_MACROS_needed_major}.${XORG_MACROS_needed_minor}]) + [XORG_MACROS_version=1.1.1 + XORG_MACROS_major=`echo $XORG_MACROS_version | sed 's/\..*$//'` + XORG_MACROS_minor=`echo $XORG_MACROS_version | sed -e 's/^[0-9]*\.//' -e 's/\..*$//'`] + if test $XORG_MACROS_major -ne $XORG_MACROS_needed_major ; then + AC_MSG_ERROR([configure built with incompatible version of xorg-macros.m4 - requires version ${XORG_MACROS_major}.x]) + fi + if test $XORG_MACROS_minor -lt $XORG_MACROS_needed_minor ; then + AC_MSG_ERROR([configure built with too old of a version of xorg-macros.m4 - requires version ${XORG_MACROS_major}.${XORG_MACROS_minor}.0 or newer]) + fi + AC_MSG_RESULT([yes, $XORG_MACROS_version]) +]) # XORG_MACROS_VERSION + +# XORG_PROG_RAWCPP() +# ------------------ +# Minimum version: 1.0.0 +# +# Find cpp program and necessary flags for use in pre-processing text files +# such as man pages and config files +AC_DEFUN([XORG_PROG_RAWCPP],[ +AC_REQUIRE([AC_PROG_CPP]) +AC_PATH_PROGS(RAWCPP, [cpp], [${CPP}], + [$PATH:/bin:/usr/bin:/usr/lib:/usr/libexec:/usr/ccs/lib:/usr/ccs/lbin:/lib]) + +# Check for flag to avoid builtin definitions - assumes unix is predefined, +# which is not the best choice for supporting other OS'es, but covers most +# of the ones we need for now. +AC_MSG_CHECKING([if $RAWCPP requires -undef]) +AC_LANG_CONFTEST([Does cpp redefine unix ?]) +if test `${RAWCPP} < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then + AC_MSG_RESULT([no]) +else + if test `${RAWCPP} -undef < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then + RAWCPPFLAGS=-undef + AC_MSG_RESULT([yes]) + else + AC_MSG_ERROR([${RAWCPP} defines unix with or without -undef. I don't know what to do.]) + fi +fi +rm -f conftest.$ac_ext + +AC_MSG_CHECKING([if $RAWCPP requires -traditional]) +AC_LANG_CONFTEST([Does cpp preserve "whitespace"?]) +if test `${RAWCPP} < conftest.$ac_ext | grep -c 'preserve \"'` -eq 1 ; then + AC_MSG_RESULT([no]) +else + if test `${RAWCPP} -traditional < conftest.$ac_ext | grep -c 'preserve \"'` -eq 1 ; then + RAWCPPFLAGS="${RAWCPPFLAGS} -traditional" + AC_MSG_RESULT([yes]) + else + AC_MSG_ERROR([${RAWCPP} does not preserve whitespace with or without -traditional. I don't know what to do.]) + fi +fi +rm -f conftest.$ac_ext +AC_SUBST(RAWCPPFLAGS) +]) # XORG_PROG_RAWCPP + +# XORG_MANPAGE_SECTIONS() +# ----------------------- +# Minimum version: 1.0.0 +# +# Determine which sections man pages go in for the different man page types +# on this OS - replaces *ManSuffix settings in old Imake *.cf per-os files. +# Not sure if there's any better way than just hardcoding by OS name. +# Override default settings by setting environment variables + +AC_DEFUN([XORG_MANPAGE_SECTIONS],[ +AC_REQUIRE([AC_CANONICAL_HOST]) + +if test x$APP_MAN_SUFFIX = x ; then + APP_MAN_SUFFIX=1 +fi +if test x$APP_MAN_DIR = x ; then + APP_MAN_DIR='$(mandir)/man$(APP_MAN_SUFFIX)' +fi + +if test x$LIB_MAN_SUFFIX = x ; then + LIB_MAN_SUFFIX=3 +fi +if test x$LIB_MAN_DIR = x ; then + LIB_MAN_DIR='$(mandir)/man$(LIB_MAN_SUFFIX)' +fi + +if test x$FILE_MAN_SUFFIX = x ; then + case $host_os in + solaris*) FILE_MAN_SUFFIX=4 ;; + *) FILE_MAN_SUFFIX=5 ;; + esac +fi +if test x$FILE_MAN_DIR = x ; then + FILE_MAN_DIR='$(mandir)/man$(FILE_MAN_SUFFIX)' +fi + +if test x$MISC_MAN_SUFFIX = x ; then + case $host_os in + solaris*) MISC_MAN_SUFFIX=5 ;; + *) MISC_MAN_SUFFIX=7 ;; + esac +fi +if test x$MISC_MAN_DIR = x ; then + MISC_MAN_DIR='$(mandir)/man$(MISC_MAN_SUFFIX)' +fi + +if test x$DRIVER_MAN_SUFFIX = x ; then + case $host_os in + solaris*) DRIVER_MAN_SUFFIX=7 ;; + *) DRIVER_MAN_SUFFIX=4 ;; + esac +fi +if test x$DRIVER_MAN_DIR = x ; then + DRIVER_MAN_DIR='$(mandir)/man$(DRIVER_MAN_SUFFIX)' +fi + +if test x$ADMIN_MAN_SUFFIX = x ; then + case $host_os in + solaris*) ADMIN_MAN_SUFFIX=1m ;; + *) ADMIN_MAN_SUFFIX=8 ;; + esac +fi +if test x$ADMIN_MAN_DIR = x ; then + ADMIN_MAN_DIR='$(mandir)/man$(ADMIN_MAN_SUFFIX)' +fi + + +AC_SUBST([APP_MAN_SUFFIX]) +AC_SUBST([LIB_MAN_SUFFIX]) +AC_SUBST([FILE_MAN_SUFFIX]) +AC_SUBST([MISC_MAN_SUFFIX]) +AC_SUBST([DRIVER_MAN_SUFFIX]) +AC_SUBST([ADMIN_MAN_SUFFIX]) +AC_SUBST([APP_MAN_DIR]) +AC_SUBST([LIB_MAN_DIR]) +AC_SUBST([FILE_MAN_DIR]) +AC_SUBST([MISC_MAN_DIR]) +AC_SUBST([DRIVER_MAN_DIR]) +AC_SUBST([ADMIN_MAN_DIR]) +]) # XORG_MANPAGE_SECTIONS + +# XORG_CHECK_LINUXDOC +# ------------------- +# Minimum version: 1.0.0 +# +# Defines the variable MAKE_TEXT if the necessary tools and +# files are found. $(MAKE_TEXT) blah.sgml will then produce blah.txt. +# Whether or not the necessary tools and files are found can be checked +# with the AM_CONDITIONAL "BUILD_LINUXDOC" +AC_DEFUN([XORG_CHECK_LINUXDOC],[ +AC_CHECK_FILE( + [$prefix/share/X11/sgml/defs.ent], + [DEFS_ENT_PATH=$prefix/share/X11/sgml], + [DEFS_ENT_PATH=] +) + +AC_PATH_PROG(LINUXDOC, linuxdoc) +AC_PATH_PROG(PS2PDF, ps2pdf) + +AC_MSG_CHECKING([Whether to build documentation]) + +if test x$DEFS_ENT_PATH != x && test x$LINUXDOC != x ; then + BUILDDOC=yes +else + BUILDDOC=no +fi + +AM_CONDITIONAL(BUILD_LINUXDOC, [test x$BUILDDOC = xyes]) + +AC_MSG_RESULT([$BUILDDOC]) + +AC_MSG_CHECKING([Whether to build pdf documentation]) + +if test x$PS2PDF != x ; then + BUILDPDFDOC=yes +else + BUILDPDFDOC=no +fi + +AM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes]) + +AC_MSG_RESULT([$BUILDPDFDOC]) + +MAKE_TEXT="SGML_SEARCH_PATH=$DEFS_ENT_PATH GROFF_NO_SGR=y $LINUXDOC -B txt" +MAKE_PS="SGML_SEARCH_PATH=$DEFS_ENT_PATH $LINUXDOC -B latex --papersize=letter --output=ps" +MAKE_PDF="$PS2PDF" +MAKE_HTML="SGML_SEARCH_PATH=$DEFS_ENT_PATH $LINUXDOC -B html --split=0" + +AC_SUBST(MAKE_TEXT) +AC_SUBST(MAKE_PS) +AC_SUBST(MAKE_PDF) +AC_SUBST(MAKE_HTML) +]) # XORG_CHECK_LINUXDOC + +# XORG_CHECK_MALLOC_ZERO +# ---------------------- +# Minimum version: 1.0.0 +# +# Defines {MALLOC,XMALLOC,XTMALLOC}_ZERO_CFLAGS appropriately if +# malloc(0) returns NULL. Packages should add one of these cflags to +# their AM_CFLAGS (or other appropriate *_CFLAGS) to use them. +AC_DEFUN([XORG_CHECK_MALLOC_ZERO],[ +AC_ARG_ENABLE(malloc0returnsnull, + AC_HELP_STRING([--enable-malloc0returnsnull], + [malloc(0) returns NULL (default: auto)]), + [MALLOC_ZERO_RETURNS_NULL=$enableval], + [MALLOC_ZERO_RETURNS_NULL=auto]) + +AC_MSG_CHECKING([whether malloc(0) returns NULL]) +if test "x$MALLOC_ZERO_RETURNS_NULL" = xauto; then + AC_RUN_IFELSE([ +char *malloc(); +char *realloc(); +char *calloc(); +main() { + char *m0, *r0, *c0, *p; + m0 = malloc(0); + p = malloc(10); + r0 = realloc(p,0); + c0 = calloc(0); + exit(m0 == 0 || r0 == 0 || c0 == 0 ? 0 : 1); +}], + [MALLOC_ZERO_RETURNS_NULL=yes], + [MALLOC_ZERO_RETURNS_NULL=no]) +fi +AC_MSG_RESULT([$MALLOC_ZERO_RETURNS_NULL]) + +if test "x$MALLOC_ZERO_RETURNS_NULL" = xyes; then + MALLOC_ZERO_CFLAGS="-DMALLOC_0_RETURNS_NULL" + XMALLOC_ZERO_CFLAGS=$MALLOC_ZERO_CFLAGS + XTMALLOC_ZERO_CFLAGS="$MALLOC_ZERO_CFLAGS -DXTMALLOC_BC" +else + MALLOC_ZERO_CFLAGS="" + XMALLOC_ZERO_CFLAGS="" + XTMALLOC_ZERO_CFLAGS="" +fi + +AC_SUBST([MALLOC_ZERO_CFLAGS]) +AC_SUBST([XMALLOC_ZERO_CFLAGS]) +AC_SUBST([XTMALLOC_ZERO_CFLAGS]) +]) # XORG_CHECK_MALLOC_ZERO + +# XORG_WITH_LINT() +# ---------------- +# Minimum version: 1.1.0 +# +# Sets up flags for source checkers such as lint and sparse if --with-lint +# is specified. (Use --with-lint=sparse for sparse.) +# Sets $LINT to name of source checker passed with --with-lint (default: lint) +# Sets $LINT_FLAGS to flags to pass to source checker +# Sets LINT automake conditional if enabled (default: disabled) +# +AC_DEFUN([XORG_WITH_LINT],[ + +# Allow checking code with lint, sparse, etc. +AC_ARG_WITH(lint, [AC_HELP_STRING([--with-lint], + [Use a lint-style source code checker (default: disabled)])], + [use_lint=$withval], [use_lint=no]) +if test "x$use_lint" = "xyes" ; then + LINT="lint" +else + LINT="$use_lint" +fi +if test "x$LINT_FLAGS" = "x" -a "x$LINT" != "xno" ; then + case $LINT in + lint|*/lint) + case $host_os in + solaris*) + LINT_FLAGS="-u -b -h -erroff=E_INDISTING_FROM_TRUNC2" + ;; + esac + ;; + esac +fi + +AC_SUBST(LINT) +AC_SUBST(LINT_FLAGS) +AM_CONDITIONAL(LINT, [test x$LINT != xno]) + +]) # XORG_WITH_LINT + +# XORG_LINT_LIBRARY(LIBNAME) +# -------------------------- +# Minimum version: 1.1.0 +# +# Sets up flags for building lint libraries for checking programs that call +# functions in the library. +# Disabled by default, enable with --enable-lint-library +# Sets: +# @LINTLIB@ - name of lint library file to make +# MAKE_LINT_LIB - automake conditional +# + +AC_DEFUN([XORG_LINT_LIBRARY],[ +AC_REQUIRE([XORG_WITH_LINT]) +# Build lint "library" for more indepth checks of programs calling this library +AC_ARG_ENABLE(lint-library, [AC_HELP_STRING([--enable-lint-library], + [Create lint library (default: disabled)])], + [make_lint_lib=$enableval], [make_lint_lib=no]) +if test "x$make_lint_lib" != "xno" ; then + if test "x$LINT" = "xno" ; then + AC_MSG_ERROR([Cannot make lint library without --with-lint]) + fi + if test "x$make_lint_lib" = "xyes" ; then + LINTLIB=llib-l$1.ln + else + LINTLIB=$make_lint_lib + fi +fi +AC_SUBST(LINTLIB) +AM_CONDITIONAL(MAKE_LINT_LIB, [test x$make_lint_lib != xno]) + +]) # XORG_LINT_LIBRARY + +dnl Copyright 2005 Red Hat, Inc +dnl +dnl Permission to use, copy, modify, distribute, and sell this software and its +dnl documentation for any purpose is hereby granted without fee, provided that +dnl the above copyright notice appear in all copies and that both that +dnl copyright notice and this permission notice appear in supporting +dnl documentation. +dnl +dnl The above copyright notice and this permission notice shall be included +dnl in all copies or substantial portions of the Software. +dnl +dnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +dnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +dnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +dnl IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR +dnl OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +dnl ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +dnl OTHER DEALINGS IN THE SOFTWARE. +dnl +dnl Except as contained in this notice, the name of the copyright holders shall +dnl not be used in advertising or otherwise to promote the sale, use or +dnl other dealings in this Software without prior written authorization +dnl from the copyright holders. +dnl + +# XORG_RELEASE_VERSION +# -------------------- +# Adds --with/without-release-string and changes the PACKAGE and +# PACKAGE_TARNAME to use "$PACKAGE{_TARNAME}-$RELEASE_VERSION". If +# no option is given, PACKAGE and PACKAGE_TARNAME are unchanged. + +AC_DEFUN([XORG_RELEASE_VERSION],[ + AC_ARG_WITH(release-version, + AC_HELP_STRING([--with-release-version=STRING], + [Use release version string in package name]), + [RELEASE_VERSION="$withval"], + [RELEASE_VERSION=""]) + if test "x$RELEASE_VERSION" != "x"; then + PACKAGE="$PACKAGE-$RELEASE_VERSION" + PACKAGE_TARNAME="$PACKAGE_TARNAME-$RELEASE_VERSION" + AC_MSG_NOTICE([Building with package name set to $PACKAGE]) + fi +]) + +# Copyright (C) 2002, 2003, 2005 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_AUTOMAKE_VERSION(VERSION) +# ---------------------------- +# Automake X.Y traces this macro to ensure aclocal.m4 has been +# generated from the m4 files accompanying Automake X.Y. +AC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version="1.9"]) + +# AM_SET_CURRENT_AUTOMAKE_VERSION +# ------------------------------- +# Call AM_AUTOMAKE_VERSION so it can be traced. +# This function is AC_REQUIREd by AC_INIT_AUTOMAKE. +AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], + [AM_AUTOMAKE_VERSION([1.9.6])]) + +# AM_AUX_DIR_EXPAND -*- Autoconf -*- + +# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets +# $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to +# `$srcdir', `$srcdir/..', or `$srcdir/../..'. +# +# Of course, Automake must honor this variable whenever it calls a +# tool from the auxiliary directory. The problem is that $srcdir (and +# therefore $ac_aux_dir as well) can be either absolute or relative, +# depending on how configure is run. This is pretty annoying, since +# it makes $ac_aux_dir quite unusable in subdirectories: in the top +# source directory, any form will work fine, but in subdirectories a +# relative path needs to be adjusted first. +# +# $ac_aux_dir/missing +# fails when called from a subdirectory if $ac_aux_dir is relative +# $top_srcdir/$ac_aux_dir/missing +# fails if $ac_aux_dir is absolute, +# fails when called from a subdirectory in a VPATH build with +# a relative $ac_aux_dir +# +# The reason of the latter failure is that $top_srcdir and $ac_aux_dir +# are both prefixed by $srcdir. In an in-source build this is usually +# harmless because $srcdir is `.', but things will broke when you +# start a VPATH build or use an absolute $srcdir. +# +# So we could use something similar to $top_srcdir/$ac_aux_dir/missing, +# iff we strip the leading $srcdir from $ac_aux_dir. That would be: +# am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"` +# and then we would define $MISSING as +# MISSING="\${SHELL} $am_aux_dir/missing" +# This will work as long as MISSING is not called from configure, because +# unfortunately $(top_srcdir) has no meaning in configure. +# However there are other variables, like CC, which are often used in +# configure, and could therefore not use this "fixed" $ac_aux_dir. +# +# Another solution, used here, is to always expand $ac_aux_dir to an +# absolute PATH. The drawback is that using absolute paths prevent a +# configured tree to be moved without reconfiguration. + +AC_DEFUN([AM_AUX_DIR_EXPAND], +[dnl Rely on autoconf to set up CDPATH properly. +AC_PREREQ([2.50])dnl +# expand $ac_aux_dir to an absolute path +am_aux_dir=`cd $ac_aux_dir && pwd` +]) + +# AM_CONDITIONAL -*- Autoconf -*- + +# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005 +# Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 7 + +# AM_CONDITIONAL(NAME, SHELL-CONDITION) +# ------------------------------------- +# Define a conditional. +AC_DEFUN([AM_CONDITIONAL], +[AC_PREREQ(2.52)dnl + ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], + [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl +AC_SUBST([$1_TRUE]) +AC_SUBST([$1_FALSE]) +if $2; then + $1_TRUE= + $1_FALSE='#' +else + $1_TRUE='#' + $1_FALSE= +fi +AC_CONFIG_COMMANDS_PRE( +[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then + AC_MSG_ERROR([[conditional "$1" was never defined. +Usually this means the macro was only invoked conditionally.]]) +fi])]) + + +# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005 +# Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 8 + +# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be +# written in clear, in which case automake, when reading aclocal.m4, +# will think it sees a *use*, and therefore will trigger all it's +# C support machinery. Also note that it means that autoscan, seeing +# CC etc. in the Makefile, will ask for an AC_PROG_CC use... + + +# _AM_DEPENDENCIES(NAME) +# ---------------------- +# See how the compiler implements dependency checking. +# NAME is "CC", "CXX", "GCJ", or "OBJC". +# We try a few techniques and use that to set a single cache variable. +# +# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was +# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular +# dependency, and given that the user is not expected to run this macro, +# just rely on AC_PROG_CC. +AC_DEFUN([_AM_DEPENDENCIES], +[AC_REQUIRE([AM_SET_DEPDIR])dnl +AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl +AC_REQUIRE([AM_MAKE_INCLUDE])dnl +AC_REQUIRE([AM_DEP_TRACK])dnl + +ifelse([$1], CC, [depcc="$CC" am_compiler_list=], + [$1], CXX, [depcc="$CXX" am_compiler_list=], + [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'], + [$1], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'], + [depcc="$$1" am_compiler_list=]) + +AC_CACHE_CHECK([dependency style of $depcc], + [am_cv_$1_dependencies_compiler_type], +[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then + # We make a subdir and do the tests there. Otherwise we can end up + # making bogus files that we don't know about and never remove. For + # instance it was reported that on HP-UX the gcc test will end up + # making a dummy file named `D' -- because `-MD' means `put the output + # in D'. + mkdir conftest.dir + # Copy depcomp to subdir because otherwise we won't find it if we're + # using a relative directory. + cp "$am_depcomp" conftest.dir + cd conftest.dir + # We will build objects and dependencies in a subdirectory because + # it helps to detect inapplicable dependency modes. For instance + # both Tru64's cc and ICC support -MD to output dependencies as a + # side effect of compilation, but ICC will put the dependencies in + # the current directory while Tru64 will put them in the object + # directory. + mkdir sub + + am_cv_$1_dependencies_compiler_type=none + if test "$am_compiler_list" = ""; then + am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp` + fi + for depmode in $am_compiler_list; do + # Setup a source with many dependencies, because some compilers + # like to wrap large dependency lists on column 80 (with \), and + # we should not choose a depcomp mode which is confused by this. + # + # We need to recreate these files for each test, as the compiler may + # overwrite some of them when testing with obscure command lines. + # This happens at least with the AIX C compiler. + : > sub/conftest.c + for i in 1 2 3 4 5 6; do + echo '#include "conftst'$i'.h"' >> sub/conftest.c + # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with + # Solaris 8's {/usr,}/bin/sh. + touch sub/conftst$i.h + done + echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf + + case $depmode in + nosideeffect) + # after this tag, mechanisms are not by side-effect, so they'll + # only be used when explicitly requested + if test "x$enable_dependency_tracking" = xyes; then + continue + else + break + fi + ;; + none) break ;; + esac + # We check with `-c' and `-o' for the sake of the "dashmstdout" + # mode. It turns out that the SunPro C++ compiler does not properly + # handle `-M -o', and we need to detect this. + if depmode=$depmode \ + source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \ + depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ + $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \ + >/dev/null 2>conftest.err && + grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && + grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 && + ${MAKE-make} -s -f confmf > /dev/null 2>&1; then + # icc doesn't choke on unknown options, it will just issue warnings + # or remarks (even with -Werror). So we grep stderr for any message + # that says an option was ignored or not supported. + # When given -MP, icc 7.0 and 7.1 complain thusly: + # icc: Command line warning: ignoring option '-M'; no argument required + # The diagnosis changed in icc 8.0: + # icc: Command line remark: option '-MP' not supported + if (grep 'ignoring option' conftest.err || + grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else + am_cv_$1_dependencies_compiler_type=$depmode + break + fi + fi + done + + cd .. + rm -rf conftest.dir +else + am_cv_$1_dependencies_compiler_type=none +fi +]) +AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type]) +AM_CONDITIONAL([am__fastdep$1], [ + test "x$enable_dependency_tracking" != xno \ + && test "$am_cv_$1_dependencies_compiler_type" = gcc3]) +]) + + +# AM_SET_DEPDIR +# ------------- +# Choose a directory name for dependency files. +# This macro is AC_REQUIREd in _AM_DEPENDENCIES +AC_DEFUN([AM_SET_DEPDIR], +[AC_REQUIRE([AM_SET_LEADING_DOT])dnl +AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl +]) + + +# AM_DEP_TRACK +# ------------ +AC_DEFUN([AM_DEP_TRACK], +[AC_ARG_ENABLE(dependency-tracking, +[ --disable-dependency-tracking speeds up one-time build + --enable-dependency-tracking do not reject slow dependency extractors]) +if test "x$enable_dependency_tracking" != xno; then + am_depcomp="$ac_aux_dir/depcomp" + AMDEPBACKSLASH='\' +fi +AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) +AC_SUBST([AMDEPBACKSLASH]) +]) + +# Generate code to set up dependency tracking. -*- Autoconf -*- + +# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005 +# Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +#serial 3 + +# _AM_OUTPUT_DEPENDENCY_COMMANDS +# ------------------------------ +AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], +[for mf in $CONFIG_FILES; do + # Strip MF so we end up with the name of the file. + mf=`echo "$mf" | sed -e 's/:.*$//'` + # Check whether this is an Automake generated Makefile or not. + # We used to match only the files named `Makefile.in', but + # some people rename them; so instead we look at the file content. + # Grep'ing the first line is not enough: some people post-process + # each Makefile.in and add a new line on top of each file to say so. + # So let's grep whole file. + if grep '^#.*generated by automake' $mf > /dev/null 2>&1; then + dirpart=`AS_DIRNAME("$mf")` + else + continue + fi + # Extract the definition of DEPDIR, am__include, and am__quote + # from the Makefile without running `make'. + DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` + test -z "$DEPDIR" && continue + am__include=`sed -n 's/^am__include = //p' < "$mf"` + test -z "am__include" && continue + am__quote=`sed -n 's/^am__quote = //p' < "$mf"` + # When using ansi2knr, U may be empty or an underscore; expand it + U=`sed -n 's/^U = //p' < "$mf"` + # Find all dependency output files, they are included files with + # $(DEPDIR) in their names. We invoke sed twice because it is the + # simplest approach to changing $(DEPDIR) to its actual value in the + # expansion. + for file in `sed -n " + s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ + sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do + # Make sure the directory exists. + test -f "$dirpart/$file" && continue + fdir=`AS_DIRNAME(["$file"])` + AS_MKDIR_P([$dirpart/$fdir]) + # echo "creating $dirpart/$file" + echo '# dummy' > "$dirpart/$file" + done +done +])# _AM_OUTPUT_DEPENDENCY_COMMANDS + + +# AM_OUTPUT_DEPENDENCY_COMMANDS +# ----------------------------- +# This macro should only be invoked once -- use via AC_REQUIRE. +# +# This code is only required when automatic dependency tracking +# is enabled. FIXME. This creates each `.P' file that we will +# need in order to bootstrap the dependency handling code. +AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], +[AC_CONFIG_COMMANDS([depfiles], + [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS], + [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"]) +]) + +# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005 +# Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 8 + +# AM_CONFIG_HEADER is obsolete. It has been replaced by AC_CONFIG_HEADERS. +AU_DEFUN([AM_CONFIG_HEADER], [AC_CONFIG_HEADERS($@)]) + +# Do all the work for Automake. -*- Autoconf -*- + +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 +# Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 12 + +# This macro actually does too much. Some checks are only needed if +# your package does certain things. But this isn't really a big deal. + +# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) +# AM_INIT_AUTOMAKE([OPTIONS]) +# ----------------------------------------------- +# The call with PACKAGE and VERSION arguments is the old style +# call (pre autoconf-2.50), which is being phased out. PACKAGE +# and VERSION should now be passed to AC_INIT and removed from +# the call to AM_INIT_AUTOMAKE. +# We support both call styles for the transition. After +# the next Automake release, Autoconf can make the AC_INIT +# arguments mandatory, and then we can depend on a new Autoconf +# release and drop the old call support. +AC_DEFUN([AM_INIT_AUTOMAKE], +[AC_PREREQ([2.58])dnl +dnl Autoconf wants to disallow AM_ names. We explicitly allow +dnl the ones we care about. +m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl +AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl +AC_REQUIRE([AC_PROG_INSTALL])dnl +# test to see if srcdir already configured +if test "`cd $srcdir && pwd`" != "`pwd`" && + test -f $srcdir/config.status; then + AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) +fi + +# test whether we have cygpath +if test -z "$CYGPATH_W"; then + if (cygpath --version) >/dev/null 2>/dev/null; then + CYGPATH_W='cygpath -w' + else + CYGPATH_W=echo + fi +fi +AC_SUBST([CYGPATH_W]) + +# Define the identity of the package. +dnl Distinguish between old-style and new-style calls. +m4_ifval([$2], +[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl + AC_SUBST([PACKAGE], [$1])dnl + AC_SUBST([VERSION], [$2])], +[_AM_SET_OPTIONS([$1])dnl + AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl + AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl + +_AM_IF_OPTION([no-define],, +[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package]) + AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl + +# Some tools Automake needs. +AC_REQUIRE([AM_SANITY_CHECK])dnl +AC_REQUIRE([AC_ARG_PROGRAM])dnl +AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version}) +AM_MISSING_PROG(AUTOCONF, autoconf) +AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version}) +AM_MISSING_PROG(AUTOHEADER, autoheader) +AM_MISSING_PROG(MAKEINFO, makeinfo) +AM_PROG_INSTALL_SH +AM_PROG_INSTALL_STRIP +AC_REQUIRE([AM_PROG_MKDIR_P])dnl +# We need awk for the "check" target. The system "awk" is bad on +# some platforms. +AC_REQUIRE([AC_PROG_AWK])dnl +AC_REQUIRE([AC_PROG_MAKE_SET])dnl +AC_REQUIRE([AM_SET_LEADING_DOT])dnl +_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])], + [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], + [_AM_PROG_TAR([v7])])]) +_AM_IF_OPTION([no-dependencies],, +[AC_PROVIDE_IFELSE([AC_PROG_CC], + [_AM_DEPENDENCIES(CC)], + [define([AC_PROG_CC], + defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl +AC_PROVIDE_IFELSE([AC_PROG_CXX], + [_AM_DEPENDENCIES(CXX)], + [define([AC_PROG_CXX], + defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl +]) +]) + + +# When config.status generates a header, we must update the stamp-h file. +# This file resides in the same directory as the config header +# that is generated. The stamp files are numbered to have different names. + +# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the +# loop where config.status creates the headers, so we can generate +# our stamp files there. +AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], +[# Compute $1's index in $config_headers. +_am_stamp_count=1 +for _am_header in $config_headers :; do + case $_am_header in + $1 | $1:* ) + break ;; + * ) + _am_stamp_count=`expr $_am_stamp_count + 1` ;; + esac +done +echo "timestamp for $1" >`AS_DIRNAME([$1])`/stamp-h[]$_am_stamp_count]) + +# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_PROG_INSTALL_SH +# ------------------ +# Define $install_sh. +AC_DEFUN([AM_PROG_INSTALL_SH], +[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl +install_sh=${install_sh-"$am_aux_dir/install-sh"} +AC_SUBST(install_sh)]) + +# Copyright (C) 2003, 2005 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 2 + +# Check whether the underlying file-system supports filenames +# with a leading dot. For instance MS-DOS doesn't. +AC_DEFUN([AM_SET_LEADING_DOT], +[rm -rf .tst 2>/dev/null +mkdir .tst 2>/dev/null +if test -d .tst; then + am__leading_dot=. +else + am__leading_dot=_ +fi +rmdir .tst 2>/dev/null +AC_SUBST([am__leading_dot])]) + +# Add --enable-maintainer-mode option to configure. -*- Autoconf -*- +# From Jim Meyering + +# Copyright (C) 1996, 1998, 2000, 2001, 2002, 2003, 2004, 2005 +# Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 4 + +AC_DEFUN([AM_MAINTAINER_MODE], +[AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles]) + dnl maintainer-mode is disabled by default + AC_ARG_ENABLE(maintainer-mode, +[ --enable-maintainer-mode enable make rules and dependencies not useful + (and sometimes confusing) to the casual installer], + USE_MAINTAINER_MODE=$enableval, + USE_MAINTAINER_MODE=no) + AC_MSG_RESULT([$USE_MAINTAINER_MODE]) + AM_CONDITIONAL(MAINTAINER_MODE, [test $USE_MAINTAINER_MODE = yes]) + MAINT=$MAINTAINER_MODE_TRUE + AC_SUBST(MAINT)dnl +] +) + +AU_DEFUN([jm_MAINTAINER_MODE], [AM_MAINTAINER_MODE]) + +# Check to see how 'make' treats includes. -*- Autoconf -*- + +# Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 3 + +# AM_MAKE_INCLUDE() +# ----------------- +# Check to see how make treats includes. +AC_DEFUN([AM_MAKE_INCLUDE], +[am_make=${MAKE-make} +cat > confinc << 'END' +am__doit: + @echo done +.PHONY: am__doit +END +# If we don't find an include directive, just comment out the code. +AC_MSG_CHECKING([for style of include used by $am_make]) +am__include="#" +am__quote= +_am_result=none +# First try GNU make style include. +echo "include confinc" > confmf +# We grep out `Entering directory' and `Leaving directory' +# messages which can occur if `w' ends up in MAKEFLAGS. +# In particular we don't look at `^make:' because GNU make might +# be invoked under some other name (usually "gmake"), in which +# case it prints its new name instead of `make'. +if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then + am__include=include + am__quote= + _am_result=GNU +fi +# Now try BSD make style include. +if test "$am__include" = "#"; then + echo '.include "confinc"' > confmf + if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then + am__include=.include + am__quote="\"" + _am_result=BSD + fi +fi +AC_SUBST([am__include]) +AC_SUBST([am__quote]) +AC_MSG_RESULT([$_am_result]) +rm -f confinc confmf +]) + +# Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- + +# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2005 +# Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 4 + +# AM_MISSING_PROG(NAME, PROGRAM) +# ------------------------------ +AC_DEFUN([AM_MISSING_PROG], +[AC_REQUIRE([AM_MISSING_HAS_RUN]) +$1=${$1-"${am_missing_run}$2"} +AC_SUBST($1)]) + + +# AM_MISSING_HAS_RUN +# ------------------ +# Define MISSING if not defined so far and test if it supports --run. +# If it does, set am_missing_run to use it, otherwise, to nothing. +AC_DEFUN([AM_MISSING_HAS_RUN], +[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl +test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing" +# Use eval to expand $SHELL +if eval "$MISSING --run true"; then + am_missing_run="$MISSING --run " +else + am_missing_run= + AC_MSG_WARN([`missing' script is too old or missing]) +fi +]) + +# Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_PROG_MKDIR_P +# --------------- +# Check whether `mkdir -p' is supported, fallback to mkinstalldirs otherwise. +# +# Automake 1.8 used `mkdir -m 0755 -p --' to ensure that directories +# created by `make install' are always world readable, even if the +# installer happens to have an overly restrictive umask (e.g. 077). +# This was a mistake. There are at least two reasons why we must not +# use `-m 0755': +# - it causes special bits like SGID to be ignored, +# - it may be too restrictive (some setups expect 775 directories). +# +# Do not use -m 0755 and let people choose whatever they expect by +# setting umask. +# +# We cannot accept any implementation of `mkdir' that recognizes `-p'. +# Some implementations (such as Solaris 8's) are not thread-safe: if a +# parallel make tries to run `mkdir -p a/b' and `mkdir -p a/c' +# concurrently, both version can detect that a/ is missing, but only +# one can create it and the other will error out. Consequently we +# restrict ourselves to GNU make (using the --version option ensures +# this.) +AC_DEFUN([AM_PROG_MKDIR_P], +[if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then + # We used to keeping the `.' as first argument, in order to + # allow $(mkdir_p) to be used without argument. As in + # $(mkdir_p) $(somedir) + # where $(somedir) is conditionally defined. However this is wrong + # for two reasons: + # 1. if the package is installed by a user who cannot write `.' + # make install will fail, + # 2. the above comment should most certainly read + # $(mkdir_p) $(DESTDIR)$(somedir) + # so it does not work when $(somedir) is undefined and + # $(DESTDIR) is not. + # To support the latter case, we have to write + # test -z "$(somedir)" || $(mkdir_p) $(DESTDIR)$(somedir), + # so the `.' trick is pointless. + mkdir_p='mkdir -p --' +else + # On NextStep and OpenStep, the `mkdir' command does not + # recognize any option. It will interpret all options as + # directories to create, and then abort because `.' already + # exists. + for d in ./-p ./--version; + do + test -d $d && rmdir $d + done + # $(mkinstalldirs) is defined by Automake if mkinstalldirs exists. + if test -f "$ac_aux_dir/mkinstalldirs"; then + mkdir_p='$(mkinstalldirs)' + else + mkdir_p='$(install_sh) -d' + fi +fi +AC_SUBST([mkdir_p])]) + +# Helper functions for option handling. -*- Autoconf -*- + +# Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 3 + +# _AM_MANGLE_OPTION(NAME) +# ----------------------- +AC_DEFUN([_AM_MANGLE_OPTION], +[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) + +# _AM_SET_OPTION(NAME) +# ------------------------------ +# Set option NAME. Presently that only means defining a flag for this option. +AC_DEFUN([_AM_SET_OPTION], +[m4_define(_AM_MANGLE_OPTION([$1]), 1)]) + +# _AM_SET_OPTIONS(OPTIONS) +# ---------------------------------- +# OPTIONS is a space-separated list of Automake options. +AC_DEFUN([_AM_SET_OPTIONS], +[AC_FOREACH([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) + +# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET]) +# ------------------------------------------- +# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. +AC_DEFUN([_AM_IF_OPTION], +[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) + +# Check to make sure that the build environment is sane. -*- Autoconf -*- + +# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005 +# Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 4 + +# AM_SANITY_CHECK +# --------------- +AC_DEFUN([AM_SANITY_CHECK], +[AC_MSG_CHECKING([whether build environment is sane]) +# Just in case +sleep 1 +echo timestamp > conftest.file +# Do `set' in a subshell so we don't clobber the current shell's +# arguments. Must try -L first in case configure is actually a +# symlink; some systems play weird games with the mod time of symlinks +# (eg FreeBSD returns the mod time of the symlink's containing +# directory). +if ( + set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null` + if test "$[*]" = "X"; then + # -L didn't work. + set X `ls -t $srcdir/configure conftest.file` + fi + rm -f conftest.file + if test "$[*]" != "X $srcdir/configure conftest.file" \ + && test "$[*]" != "X conftest.file $srcdir/configure"; then + + # If neither matched, then we have a broken ls. This can happen + # if, for instance, CONFIG_SHELL is bash and it inherits a + # broken ls alias from the environment. This has actually + # happened. Such a system could not be considered "sane". + AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken +alias in your environment]) + fi + + test "$[2]" = conftest.file + ) +then + # Ok. + : +else + AC_MSG_ERROR([newly created file is older than distributed files! +Check your system clock]) +fi +AC_MSG_RESULT(yes)]) + +# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_PROG_INSTALL_STRIP +# --------------------- +# One issue with vendor `install' (even GNU) is that you can't +# specify the program used to strip binaries. This is especially +# annoying in cross-compiling environments, where the build's strip +# is unlikely to handle the host's binaries. +# Fortunately install-sh will honor a STRIPPROG variable, so we +# always use install-sh in `make install-strip', and initialize +# STRIPPROG with the value of the STRIP variable (set by the user). +AC_DEFUN([AM_PROG_INSTALL_STRIP], +[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl +# Installed binaries are usually stripped using `strip' when the user +# run `make install-strip'. However `strip' might not be the right +# tool to use in cross-compilation environments, therefore Automake +# will honor the `STRIP' environment variable to overrule this program. +dnl Don't test for $cross_compiling = yes, because it might be `maybe'. +if test "$cross_compiling" != no; then + AC_CHECK_TOOL([STRIP], [strip], :) +fi +INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s" +AC_SUBST([INSTALL_STRIP_PROGRAM])]) + +# Check how to create a tarball. -*- Autoconf -*- + +# Copyright (C) 2004, 2005 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 2 + +# _AM_PROG_TAR(FORMAT) +# -------------------- +# Check how to create a tarball in format FORMAT. +# FORMAT should be one of `v7', `ustar', or `pax'. +# +# Substitute a variable $(am__tar) that is a command +# writing to stdout a FORMAT-tarball containing the directory +# $tardir. +# tardir=directory && $(am__tar) > result.tar +# +# Substitute a variable $(am__untar) that extract such +# a tarball read from stdin. +# $(am__untar) < result.tar +AC_DEFUN([_AM_PROG_TAR], +[# Always define AMTAR for backward compatibility. +AM_MISSING_PROG([AMTAR], [tar]) +m4_if([$1], [v7], + [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'], + [m4_case([$1], [ustar],, [pax],, + [m4_fatal([Unknown tar format])]) +AC_MSG_CHECKING([how to create a $1 tar archive]) +# Loop over all known methods to create a tar archive until one works. +_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none' +_am_tools=${am_cv_prog_tar_$1-$_am_tools} +# Do not fold the above two line into one, because Tru64 sh and +# Solaris sh will not grok spaces in the rhs of `-'. +for _am_tool in $_am_tools +do + case $_am_tool in + gnutar) + for _am_tar in tar gnutar gtar; + do + AM_RUN_LOG([$_am_tar --version]) && break + done + am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"' + am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"' + am__untar="$_am_tar -xf -" + ;; + plaintar) + # Must skip GNU tar: if it does not support --format= it doesn't create + # ustar tarball either. + (tar --version) >/dev/null 2>&1 && continue + am__tar='tar chf - "$$tardir"' + am__tar_='tar chf - "$tardir"' + am__untar='tar xf -' + ;; + pax) + am__tar='pax -L -x $1 -w "$$tardir"' + am__tar_='pax -L -x $1 -w "$tardir"' + am__untar='pax -r' + ;; + cpio) + am__tar='find "$$tardir" -print | cpio -o -H $1 -L' + am__tar_='find "$tardir" -print | cpio -o -H $1 -L' + am__untar='cpio -i -H $1 -d' + ;; + none) + am__tar=false + am__tar_=false + am__untar=false + ;; + esac + + # If the value was cached, stop now. We just wanted to have am__tar + # and am__untar set. + test -n "${am_cv_prog_tar_$1}" && break + + # tar/untar a dummy directory, and stop if the command works + rm -rf conftest.dir + mkdir conftest.dir + echo GrepMe > conftest.dir/file + AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar]) + rm -rf conftest.dir + if test -s conftest.tar; then + AM_RUN_LOG([$am__untar /dev/null 2>&1 && break + fi +done +rm -rf conftest.dir + +AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool]) +AC_MSG_RESULT([$am_cv_prog_tar_$1])]) +AC_SUBST([am__tar]) +AC_SUBST([am__untar]) +]) # _AM_PROG_TAR + diff --git a/app/twm/compile b/app/twm/compile new file mode 100644 index 000000000..1b1d23216 --- /dev/null +++ b/app/twm/compile @@ -0,0 +1,142 @@ +#! /bin/sh +# Wrapper for compilers which do not understand `-c -o'. + +scriptversion=2005-05-14.22 + +# Copyright (C) 1999, 2000, 2003, 2004, 2005 Free Software Foundation, Inc. +# Written by Tom Tromey . +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +# This file is maintained in Automake, please report +# bugs to or send patches to +# . + +case $1 in + '') + echo "$0: No command. Try \`$0 --help' for more information." 1>&2 + exit 1; + ;; + -h | --h*) + cat <<\EOF +Usage: compile [--help] [--version] PROGRAM [ARGS] + +Wrapper for compilers which do not understand `-c -o'. +Remove `-o dest.o' from ARGS, run PROGRAM with the remaining +arguments, and rename the output as expected. + +If you are trying to build a whole package this is not the +right script to run: please start by reading the file `INSTALL'. + +Report bugs to . +EOF + exit $? + ;; + -v | --v*) + echo "compile $scriptversion" + exit $? + ;; +esac + +ofile= +cfile= +eat= + +for arg +do + if test -n "$eat"; then + eat= + else + case $1 in + -o) + # configure might choose to run compile as `compile cc -o foo foo.c'. + # So we strip `-o arg' only if arg is an object. + eat=1 + case $2 in + *.o | *.obj) + ofile=$2 + ;; + *) + set x "$@" -o "$2" + shift + ;; + esac + ;; + *.c) + cfile=$1 + set x "$@" "$1" + shift + ;; + *) + set x "$@" "$1" + shift + ;; + esac + fi + shift +done + +if test -z "$ofile" || test -z "$cfile"; then + # If no `-o' option was seen then we might have been invoked from a + # pattern rule where we don't need one. That is ok -- this is a + # normal compilation that the losing compiler can handle. If no + # `.c' file was seen then we are probably linking. That is also + # ok. + exec "$@" +fi + +# Name of file we expect compiler to create. +cofile=`echo "$cfile" | sed -e 's|^.*/||' -e 's/\.c$/.o/'` + +# Create the lock directory. +# Note: use `[/.-]' here to ensure that we don't use the same name +# that we are using for the .o file. Also, base the name on the expected +# object file name, since that is what matters with a parallel build. +lockdir=`echo "$cofile" | sed -e 's|[/.-]|_|g'`.d +while true; do + if mkdir "$lockdir" >/dev/null 2>&1; then + break + fi + sleep 1 +done +# FIXME: race condition here if user kills between mkdir and trap. +trap "rmdir '$lockdir'; exit 1" 1 2 15 + +# Run the compile. +"$@" +ret=$? + +if test -f "$cofile"; then + mv "$cofile" "$ofile" +elif test -f "${cofile}bj"; then + mv "${cofile}bj" "$ofile" +fi + +rmdir "$lockdir" +exit $ret + +# Local Variables: +# mode: shell-script +# sh-indentation: 2 +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-end: "$" +# End: diff --git a/app/twm/config.guess b/app/twm/config.guess new file mode 100644 index 000000000..917bbc50f --- /dev/null +++ b/app/twm/config.guess @@ -0,0 +1,1463 @@ +#! /bin/sh +# Attempt to guess a canonical system name. +# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, +# 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. + +timestamp='2005-07-08' + +# This file is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA +# 02110-1301, USA. +# +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + + +# Originally written by Per Bothner . +# Please send patches to . Submit a context +# diff and a properly formatted ChangeLog entry. +# +# This script attempts to guess a canonical system name similar to +# config.sub. If it succeeds, it prints the system name on stdout, and +# exits with 0. Otherwise, it exits with 1. +# +# The plan is that this can be called by configure scripts if you +# don't specify an explicit build system type. + +me=`echo "$0" | sed -e 's,.*/,,'` + +usage="\ +Usage: $0 [OPTION] + +Output the configuration name of the system \`$me' is run on. + +Operation modes: + -h, --help print this help, then exit + -t, --time-stamp print date of last modification, then exit + -v, --version print version number, then exit + +Report bugs and patches to ." + +version="\ +GNU config.guess ($timestamp) + +Originally written by Per Bothner. +Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 +Free Software Foundation, Inc. + +This is free software; see the source for copying conditions. There is NO +warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." + +help=" +Try \`$me --help' for more information." + +# Parse command line +while test $# -gt 0 ; do + case $1 in + --time-stamp | --time* | -t ) + echo "$timestamp" ; exit ;; + --version | -v ) + echo "$version" ; exit ;; + --help | --h* | -h ) + echo "$usage"; exit ;; + -- ) # Stop option processing + shift; break ;; + - ) # Use stdin as input. + break ;; + -* ) + echo "$me: invalid option $1$help" >&2 + exit 1 ;; + * ) + break ;; + esac +done + +if test $# != 0; then + echo "$me: too many arguments$help" >&2 + exit 1 +fi + +trap 'exit 1' 1 2 15 + +# CC_FOR_BUILD -- compiler used by this script. Note that the use of a +# compiler to aid in system detection is discouraged as it requires +# temporary files to be created and, as you can see below, it is a +# headache to deal with in a portable fashion. + +# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still +# use `HOST_CC' if defined, but it is deprecated. + +# Portable tmp directory creation inspired by the Autoconf team. + +set_cc_for_build=' +trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ; +trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ; +: ${TMPDIR=/tmp} ; + { tmp=`(umask 077 && mktemp -d -q "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || + { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } || + { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } || + { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ; +dummy=$tmp/dummy ; +tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ; +case $CC_FOR_BUILD,$HOST_CC,$CC in + ,,) echo "int x;" > $dummy.c ; + for c in cc gcc c89 c99 ; do + if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then + CC_FOR_BUILD="$c"; break ; + fi ; + done ; + if test x"$CC_FOR_BUILD" = x ; then + CC_FOR_BUILD=no_compiler_found ; + fi + ;; + ,,*) CC_FOR_BUILD=$CC ;; + ,*,*) CC_FOR_BUILD=$HOST_CC ;; +esac ; set_cc_for_build= ;' + +# This is needed to find uname on a Pyramid OSx when run in the BSD universe. +# (ghazi@noc.rutgers.edu 1994-08-24) +if (test -f /.attbin/uname) >/dev/null 2>&1 ; then + PATH=$PATH:/.attbin ; export PATH +fi + +UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown +UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown +UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown +UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown + +# Note: order is significant - the case branches are not exclusive. + +case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in + *:NetBSD:*:*) + # NetBSD (nbsd) targets should (where applicable) match one or + # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*, + # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently + # switched to ELF, *-*-netbsd* would select the old + # object file format. This provides both forward + # compatibility and a consistent mechanism for selecting the + # object file format. + # + # Note: NetBSD doesn't particularly care about the vendor + # portion of the name. We always set it to "unknown". + sysctl="sysctl -n hw.machine_arch" + UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \ + /usr/sbin/$sysctl 2>/dev/null || echo unknown)` + case "${UNAME_MACHINE_ARCH}" in + armeb) machine=armeb-unknown ;; + arm*) machine=arm-unknown ;; + sh3el) machine=shl-unknown ;; + sh3eb) machine=sh-unknown ;; + *) machine=${UNAME_MACHINE_ARCH}-unknown ;; + esac + # The Operating System including object format, if it has switched + # to ELF recently, or will in the future. + case "${UNAME_MACHINE_ARCH}" in + arm*|i386|m68k|ns32k|sh3*|sparc|vax) + eval $set_cc_for_build + if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ + | grep __ELF__ >/dev/null + then + # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). + # Return netbsd for either. FIX? + os=netbsd + else + os=netbsdelf + fi + ;; + *) + os=netbsd + ;; + esac + # The OS release + # Debian GNU/NetBSD machines have a different userland, and + # thus, need a distinct triplet. However, they do not need + # kernel version information, so it can be replaced with a + # suitable tag, in the style of linux-gnu. + case "${UNAME_VERSION}" in + Debian*) + release='-gnu' + ;; + *) + release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` + ;; + esac + # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: + # contains redundant information, the shorter form: + # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. + echo "${machine}-${os}${release}" + exit ;; + *:OpenBSD:*:*) + UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` + echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE} + exit ;; + *:ekkoBSD:*:*) + echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE} + exit ;; + macppc:MirBSD:*:*) + echo powerppc-unknown-mirbsd${UNAME_RELEASE} + exit ;; + *:MirBSD:*:*) + echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE} + exit ;; + alpha:OSF1:*:*) + case $UNAME_RELEASE in + *4.0) + UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` + ;; + *5.*) + UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` + ;; + esac + # According to Compaq, /usr/sbin/psrinfo has been available on + # OSF/1 and Tru64 systems produced since 1995. I hope that + # covers most systems running today. This code pipes the CPU + # types through head -n 1, so we only detect the type of CPU 0. + ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` + case "$ALPHA_CPU_TYPE" in + "EV4 (21064)") + UNAME_MACHINE="alpha" ;; + "EV4.5 (21064)") + UNAME_MACHINE="alpha" ;; + "LCA4 (21066/21068)") + UNAME_MACHINE="alpha" ;; + "EV5 (21164)") + UNAME_MACHINE="alphaev5" ;; + "EV5.6 (21164A)") + UNAME_MACHINE="alphaev56" ;; + "EV5.6 (21164PC)") + UNAME_MACHINE="alphapca56" ;; + "EV5.7 (21164PC)") + UNAME_MACHINE="alphapca57" ;; + "EV6 (21264)") + UNAME_MACHINE="alphaev6" ;; + "EV6.7 (21264A)") + UNAME_MACHINE="alphaev67" ;; + "EV6.8CB (21264C)") + UNAME_MACHINE="alphaev68" ;; + "EV6.8AL (21264B)") + UNAME_MACHINE="alphaev68" ;; + "EV6.8CX (21264D)") + UNAME_MACHINE="alphaev68" ;; + "EV6.9A (21264/EV69A)") + UNAME_MACHINE="alphaev69" ;; + "EV7 (21364)") + UNAME_MACHINE="alphaev7" ;; + "EV7.9 (21364A)") + UNAME_MACHINE="alphaev79" ;; + esac + # A Pn.n version is a patched version. + # A Vn.n version is a released version. + # A Tn.n version is a released field test version. + # A Xn.n version is an unreleased experimental baselevel. + # 1.2 uses "1.2" for uname -r. + echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + exit ;; + Alpha\ *:Windows_NT*:*) + # How do we know it's Interix rather than the generic POSIX subsystem? + # Should we change UNAME_MACHINE based on the output of uname instead + # of the specific Alpha model? + echo alpha-pc-interix + exit ;; + 21064:Windows_NT:50:3) + echo alpha-dec-winnt3.5 + exit ;; + Amiga*:UNIX_System_V:4.0:*) + echo m68k-unknown-sysv4 + exit ;; + *:[Aa]miga[Oo][Ss]:*:*) + echo ${UNAME_MACHINE}-unknown-amigaos + exit ;; + *:[Mm]orph[Oo][Ss]:*:*) + echo ${UNAME_MACHINE}-unknown-morphos + exit ;; + *:OS/390:*:*) + echo i370-ibm-openedition + exit ;; + *:z/VM:*:*) + echo s390-ibm-zvmoe + exit ;; + *:OS400:*:*) + echo powerpc-ibm-os400 + exit ;; + arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) + echo arm-acorn-riscix${UNAME_RELEASE} + exit ;; + arm:riscos:*:*|arm:RISCOS:*:*) + echo arm-unknown-riscos + exit ;; + SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) + echo hppa1.1-hitachi-hiuxmpp + exit ;; + Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) + # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. + if test "`(/bin/universe) 2>/dev/null`" = att ; then + echo pyramid-pyramid-sysv3 + else + echo pyramid-pyramid-bsd + fi + exit ;; + NILE*:*:*:dcosx) + echo pyramid-pyramid-svr4 + exit ;; + DRS?6000:unix:4.0:6*) + echo sparc-icl-nx6 + exit ;; + DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*) + case `/usr/bin/uname -p` in + sparc) echo sparc-icl-nx7; exit ;; + esac ;; + sun4H:SunOS:5.*:*) + echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; + sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) + echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; + i86pc:SunOS:5.*:*) + echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; + sun4*:SunOS:6*:*) + # According to config.sub, this is the proper way to canonicalize + # SunOS6. Hard to guess exactly what SunOS6 will be like, but + # it's likely to be more like Solaris than SunOS4. + echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; + sun4*:SunOS:*:*) + case "`/usr/bin/arch -k`" in + Series*|S4*) + UNAME_RELEASE=`uname -v` + ;; + esac + # Japanese Language versions have a version number like `4.1.3-JL'. + echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'` + exit ;; + sun3*:SunOS:*:*) + echo m68k-sun-sunos${UNAME_RELEASE} + exit ;; + sun*:*:4.2BSD:*) + UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` + test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3 + case "`/bin/arch`" in + sun3) + echo m68k-sun-sunos${UNAME_RELEASE} + ;; + sun4) + echo sparc-sun-sunos${UNAME_RELEASE} + ;; + esac + exit ;; + aushp:SunOS:*:*) + echo sparc-auspex-sunos${UNAME_RELEASE} + exit ;; + # The situation for MiNT is a little confusing. The machine name + # can be virtually everything (everything which is not + # "atarist" or "atariste" at least should have a processor + # > m68000). The system name ranges from "MiNT" over "FreeMiNT" + # to the lowercase version "mint" (or "freemint"). Finally + # the system name "TOS" denotes a system which is actually not + # MiNT. But MiNT is downward compatible to TOS, so this should + # be no problem. + atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) + echo m68k-atari-mint${UNAME_RELEASE} + exit ;; + atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) + echo m68k-atari-mint${UNAME_RELEASE} + exit ;; + *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) + echo m68k-atari-mint${UNAME_RELEASE} + exit ;; + milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) + echo m68k-milan-mint${UNAME_RELEASE} + exit ;; + hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) + echo m68k-hades-mint${UNAME_RELEASE} + exit ;; + *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) + echo m68k-unknown-mint${UNAME_RELEASE} + exit ;; + m68k:machten:*:*) + echo m68k-apple-machten${UNAME_RELEASE} + exit ;; + powerpc:machten:*:*) + echo powerpc-apple-machten${UNAME_RELEASE} + exit ;; + RISC*:Mach:*:*) + echo mips-dec-mach_bsd4.3 + exit ;; + RISC*:ULTRIX:*:*) + echo mips-dec-ultrix${UNAME_RELEASE} + exit ;; + VAX*:ULTRIX*:*:*) + echo vax-dec-ultrix${UNAME_RELEASE} + exit ;; + 2020:CLIX:*:* | 2430:CLIX:*:*) + echo clipper-intergraph-clix${UNAME_RELEASE} + exit ;; + mips:*:*:UMIPS | mips:*:*:RISCos) + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c +#ifdef __cplusplus +#include /* for printf() prototype */ + int main (int argc, char *argv[]) { +#else + int main (argc, argv) int argc; char *argv[]; { +#endif + #if defined (host_mips) && defined (MIPSEB) + #if defined (SYSTYPE_SYSV) + printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0); + #endif + #if defined (SYSTYPE_SVR4) + printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0); + #endif + #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) + printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0); + #endif + #endif + exit (-1); + } +EOF + $CC_FOR_BUILD -o $dummy $dummy.c && + dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` && + SYSTEM_NAME=`$dummy $dummyarg` && + { echo "$SYSTEM_NAME"; exit; } + echo mips-mips-riscos${UNAME_RELEASE} + exit ;; + Motorola:PowerMAX_OS:*:*) + echo powerpc-motorola-powermax + exit ;; + Motorola:*:4.3:PL8-*) + echo powerpc-harris-powermax + exit ;; + Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) + echo powerpc-harris-powermax + exit ;; + Night_Hawk:Power_UNIX:*:*) + echo powerpc-harris-powerunix + exit ;; + m88k:CX/UX:7*:*) + echo m88k-harris-cxux7 + exit ;; + m88k:*:4*:R4*) + echo m88k-motorola-sysv4 + exit ;; + m88k:*:3*:R3*) + echo m88k-motorola-sysv3 + exit ;; + AViiON:dgux:*:*) + # DG/UX returns AViiON for all architectures + UNAME_PROCESSOR=`/usr/bin/uname -p` + if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ] + then + if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ + [ ${TARGET_BINARY_INTERFACE}x = x ] + then + echo m88k-dg-dgux${UNAME_RELEASE} + else + echo m88k-dg-dguxbcs${UNAME_RELEASE} + fi + else + echo i586-dg-dgux${UNAME_RELEASE} + fi + exit ;; + M88*:DolphinOS:*:*) # DolphinOS (SVR3) + echo m88k-dolphin-sysv3 + exit ;; + M88*:*:R3*:*) + # Delta 88k system running SVR3 + echo m88k-motorola-sysv3 + exit ;; + XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) + echo m88k-tektronix-sysv3 + exit ;; + Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) + echo m68k-tektronix-bsd + exit ;; + *:IRIX*:*:*) + echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` + exit ;; + ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. + echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id + exit ;; # Note that: echo "'`uname -s`'" gives 'AIX ' + i*86:AIX:*:*) + echo i386-ibm-aix + exit ;; + ia64:AIX:*:*) + if [ -x /usr/bin/oslevel ] ; then + IBM_REV=`/usr/bin/oslevel` + else + IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} + fi + echo ${UNAME_MACHINE}-ibm-aix${IBM_REV} + exit ;; + *:AIX:2:3) + if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #include + + main() + { + if (!__power_pc()) + exit(1); + puts("powerpc-ibm-aix3.2.5"); + exit(0); + } +EOF + if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` + then + echo "$SYSTEM_NAME" + else + echo rs6000-ibm-aix3.2.5 + fi + elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then + echo rs6000-ibm-aix3.2.4 + else + echo rs6000-ibm-aix3.2 + fi + exit ;; + *:AIX:*:[45]) + IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` + if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then + IBM_ARCH=rs6000 + else + IBM_ARCH=powerpc + fi + if [ -x /usr/bin/oslevel ] ; then + IBM_REV=`/usr/bin/oslevel` + else + IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} + fi + echo ${IBM_ARCH}-ibm-aix${IBM_REV} + exit ;; + *:AIX:*:*) + echo rs6000-ibm-aix + exit ;; + ibmrt:4.4BSD:*|romp-ibm:BSD:*) + echo romp-ibm-bsd4.4 + exit ;; + ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and + echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to + exit ;; # report: romp-ibm BSD 4.3 + *:BOSX:*:*) + echo rs6000-bull-bosx + exit ;; + DPX/2?00:B.O.S.:*:*) + echo m68k-bull-sysv3 + exit ;; + 9000/[34]??:4.3bsd:1.*:*) + echo m68k-hp-bsd + exit ;; + hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) + echo m68k-hp-bsd4.4 + exit ;; + 9000/[34678]??:HP-UX:*:*) + HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` + case "${UNAME_MACHINE}" in + 9000/31? ) HP_ARCH=m68000 ;; + 9000/[34]?? ) HP_ARCH=m68k ;; + 9000/[678][0-9][0-9]) + if [ -x /usr/bin/getconf ]; then + sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` + sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` + case "${sc_cpu_version}" in + 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 + 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 + 532) # CPU_PA_RISC2_0 + case "${sc_kernel_bits}" in + 32) HP_ARCH="hppa2.0n" ;; + 64) HP_ARCH="hppa2.0w" ;; + '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20 + esac ;; + esac + fi + if [ "${HP_ARCH}" = "" ]; then + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + + #define _HPUX_SOURCE + #include + #include + + int main () + { + #if defined(_SC_KERNEL_BITS) + long bits = sysconf(_SC_KERNEL_BITS); + #endif + long cpu = sysconf (_SC_CPU_VERSION); + + switch (cpu) + { + case CPU_PA_RISC1_0: puts ("hppa1.0"); break; + case CPU_PA_RISC1_1: puts ("hppa1.1"); break; + case CPU_PA_RISC2_0: + #if defined(_SC_KERNEL_BITS) + switch (bits) + { + case 64: puts ("hppa2.0w"); break; + case 32: puts ("hppa2.0n"); break; + default: puts ("hppa2.0"); break; + } break; + #else /* !defined(_SC_KERNEL_BITS) */ + puts ("hppa2.0"); break; + #endif + default: puts ("hppa1.0"); break; + } + exit (0); + } +EOF + (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` + test -z "$HP_ARCH" && HP_ARCH=hppa + fi ;; + esac + if [ ${HP_ARCH} = "hppa2.0w" ] + then + eval $set_cc_for_build + + # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating + # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler + # generating 64-bit code. GNU and HP use different nomenclature: + # + # $ CC_FOR_BUILD=cc ./config.guess + # => hppa2.0w-hp-hpux11.23 + # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess + # => hppa64-hp-hpux11.23 + + if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | + grep __LP64__ >/dev/null + then + HP_ARCH="hppa2.0w" + else + HP_ARCH="hppa64" + fi + fi + echo ${HP_ARCH}-hp-hpux${HPUX_REV} + exit ;; + ia64:HP-UX:*:*) + HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` + echo ia64-hp-hpux${HPUX_REV} + exit ;; + 3050*:HI-UX:*:*) + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #include + int + main () + { + long cpu = sysconf (_SC_CPU_VERSION); + /* The order matters, because CPU_IS_HP_MC68K erroneously returns + true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct + results, however. */ + if (CPU_IS_PA_RISC (cpu)) + { + switch (cpu) + { + case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; + case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; + case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; + default: puts ("hppa-hitachi-hiuxwe2"); break; + } + } + else if (CPU_IS_HP_MC68K (cpu)) + puts ("m68k-hitachi-hiuxwe2"); + else puts ("unknown-hitachi-hiuxwe2"); + exit (0); + } +EOF + $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` && + { echo "$SYSTEM_NAME"; exit; } + echo unknown-hitachi-hiuxwe2 + exit ;; + 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) + echo hppa1.1-hp-bsd + exit ;; + 9000/8??:4.3bsd:*:*) + echo hppa1.0-hp-bsd + exit ;; + *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) + echo hppa1.0-hp-mpeix + exit ;; + hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) + echo hppa1.1-hp-osf + exit ;; + hp8??:OSF1:*:*) + echo hppa1.0-hp-osf + exit ;; + i*86:OSF1:*:*) + if [ -x /usr/sbin/sysversion ] ; then + echo ${UNAME_MACHINE}-unknown-osf1mk + else + echo ${UNAME_MACHINE}-unknown-osf1 + fi + exit ;; + parisc*:Lites*:*:*) + echo hppa1.1-hp-lites + exit ;; + C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) + echo c1-convex-bsd + exit ;; + C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) + if getsysinfo -f scalar_acc + then echo c32-convex-bsd + else echo c2-convex-bsd + fi + exit ;; + C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) + echo c34-convex-bsd + exit ;; + C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) + echo c38-convex-bsd + exit ;; + C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) + echo c4-convex-bsd + exit ;; + CRAY*Y-MP:*:*:*) + echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit ;; + CRAY*[A-Z]90:*:*:*) + echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ + | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ + -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ + -e 's/\.[^.]*$/.X/' + exit ;; + CRAY*TS:*:*:*) + echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit ;; + CRAY*T3E:*:*:*) + echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit ;; + CRAY*SV1:*:*:*) + echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit ;; + *:UNICOS/mp:*:*) + echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit ;; + F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) + FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` + FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` + echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" + exit ;; + 5000:UNIX_System_V:4.*:*) + FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` + FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'` + echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" + exit ;; + i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) + echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} + exit ;; + sparc*:BSD/OS:*:*) + echo sparc-unknown-bsdi${UNAME_RELEASE} + exit ;; + *:BSD/OS:*:*) + echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} + exit ;; + *:FreeBSD:*:*) + echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` + exit ;; + i*:CYGWIN*:*) + echo ${UNAME_MACHINE}-pc-cygwin + exit ;; + i*:MINGW*:*) + echo ${UNAME_MACHINE}-pc-mingw32 + exit ;; + i*:windows32*:*) + # uname -m includes "-pc" on this system. + echo ${UNAME_MACHINE}-mingw32 + exit ;; + i*:PW*:*) + echo ${UNAME_MACHINE}-pc-pw32 + exit ;; + x86:Interix*:[34]*) + echo i586-pc-interix${UNAME_RELEASE}|sed -e 's/\..*//' + exit ;; + [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) + echo i${UNAME_MACHINE}-pc-mks + exit ;; + i*:Windows_NT*:* | Pentium*:Windows_NT*:*) + # How do we know it's Interix rather than the generic POSIX subsystem? + # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we + # UNAME_MACHINE based on the output of uname instead of i386? + echo i586-pc-interix + exit ;; + i*:UWIN*:*) + echo ${UNAME_MACHINE}-pc-uwin + exit ;; + amd64:CYGWIN*:*:*) + echo x86_64-unknown-cygwin + exit ;; + p*:CYGWIN*:*) + echo powerpcle-unknown-cygwin + exit ;; + prep*:SunOS:5.*:*) + echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; + *:GNU:*:*) + # the GNU system + echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` + exit ;; + *:GNU/*:*:*) + # other systems with GNU libc and userland + echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu + exit ;; + i*86:Minix:*:*) + echo ${UNAME_MACHINE}-pc-minix + exit ;; + arm*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + cris:Linux:*:*) + echo cris-axis-linux-gnu + exit ;; + crisv32:Linux:*:*) + echo crisv32-axis-linux-gnu + exit ;; + frv:Linux:*:*) + echo frv-unknown-linux-gnu + exit ;; + ia64:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + m32r*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + m68*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + mips:Linux:*:*) + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #undef CPU + #undef mips + #undef mipsel + #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) + CPU=mipsel + #else + #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) + CPU=mips + #else + CPU= + #endif + #endif +EOF + eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=` + test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } + ;; + mips64:Linux:*:*) + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #undef CPU + #undef mips64 + #undef mips64el + #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) + CPU=mips64el + #else + #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) + CPU=mips64 + #else + CPU= + #endif + #endif +EOF + eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=` + test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } + ;; + ppc:Linux:*:*) + echo powerpc-unknown-linux-gnu + exit ;; + ppc64:Linux:*:*) + echo powerpc64-unknown-linux-gnu + exit ;; + alpha:Linux:*:*) + case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in + EV5) UNAME_MACHINE=alphaev5 ;; + EV56) UNAME_MACHINE=alphaev56 ;; + PCA56) UNAME_MACHINE=alphapca56 ;; + PCA57) UNAME_MACHINE=alphapca56 ;; + EV6) UNAME_MACHINE=alphaev6 ;; + EV67) UNAME_MACHINE=alphaev67 ;; + EV68*) UNAME_MACHINE=alphaev68 ;; + esac + objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null + if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi + echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} + exit ;; + parisc:Linux:*:* | hppa:Linux:*:*) + # Look for CPU level + case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in + PA7*) echo hppa1.1-unknown-linux-gnu ;; + PA8*) echo hppa2.0-unknown-linux-gnu ;; + *) echo hppa-unknown-linux-gnu ;; + esac + exit ;; + parisc64:Linux:*:* | hppa64:Linux:*:*) + echo hppa64-unknown-linux-gnu + exit ;; + s390:Linux:*:* | s390x:Linux:*:*) + echo ${UNAME_MACHINE}-ibm-linux + exit ;; + sh64*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + sh*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + sparc:Linux:*:* | sparc64:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + x86_64:Linux:*:*) + echo x86_64-unknown-linux-gnu + exit ;; + i*86:Linux:*:*) + # The BFD linker knows what the default object file format is, so + # first see if it will tell us. cd to the root directory to prevent + # problems with other programs or directories called `ld' in the path. + # Set LC_ALL=C to ensure ld outputs messages in English. + ld_supported_targets=`cd /; LC_ALL=C ld --help 2>&1 \ + | sed -ne '/supported targets:/!d + s/[ ][ ]*/ /g + s/.*supported targets: *// + s/ .*// + p'` + case "$ld_supported_targets" in + elf32-i386) + TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu" + ;; + a.out-i386-linux) + echo "${UNAME_MACHINE}-pc-linux-gnuaout" + exit ;; + coff-i386) + echo "${UNAME_MACHINE}-pc-linux-gnucoff" + exit ;; + "") + # Either a pre-BFD a.out linker (linux-gnuoldld) or + # one that does not give us useful --help. + echo "${UNAME_MACHINE}-pc-linux-gnuoldld" + exit ;; + esac + # Determine whether the default compiler is a.out or elf + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #include + #ifdef __ELF__ + # ifdef __GLIBC__ + # if __GLIBC__ >= 2 + LIBC=gnu + # else + LIBC=gnulibc1 + # endif + # else + LIBC=gnulibc1 + # endif + #else + #ifdef __INTEL_COMPILER + LIBC=gnu + #else + LIBC=gnuaout + #endif + #endif + #ifdef __dietlibc__ + LIBC=dietlibc + #endif +EOF + eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=` + test x"${LIBC}" != x && { + echo "${UNAME_MACHINE}-pc-linux-${LIBC}" + exit + } + test x"${TENTATIVE}" != x && { echo "${TENTATIVE}"; exit; } + ;; + i*86:DYNIX/ptx:4*:*) + # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. + # earlier versions are messed up and put the nodename in both + # sysname and nodename. + echo i386-sequent-sysv4 + exit ;; + i*86:UNIX_SV:4.2MP:2.*) + # Unixware is an offshoot of SVR4, but it has its own version + # number series starting with 2... + # I am not positive that other SVR4 systems won't match this, + # I just have to hope. -- rms. + # Use sysv4.2uw... so that sysv4* matches it. + echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} + exit ;; + i*86:OS/2:*:*) + # If we were able to find `uname', then EMX Unix compatibility + # is probably installed. + echo ${UNAME_MACHINE}-pc-os2-emx + exit ;; + i*86:XTS-300:*:STOP) + echo ${UNAME_MACHINE}-unknown-stop + exit ;; + i*86:atheos:*:*) + echo ${UNAME_MACHINE}-unknown-atheos + exit ;; + i*86:syllable:*:*) + echo ${UNAME_MACHINE}-pc-syllable + exit ;; + i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*) + echo i386-unknown-lynxos${UNAME_RELEASE} + exit ;; + i*86:*DOS:*:*) + echo ${UNAME_MACHINE}-pc-msdosdjgpp + exit ;; + i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*) + UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` + if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then + echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL} + else + echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} + fi + exit ;; + i*86:*:5:[678]*) + # UnixWare 7.x, OpenUNIX and OpenServer 6. + case `/bin/uname -X | grep "^Machine"` in + *486*) UNAME_MACHINE=i486 ;; + *Pentium) UNAME_MACHINE=i586 ;; + *Pent*|*Celeron) UNAME_MACHINE=i686 ;; + esac + echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} + exit ;; + i*86:*:3.2:*) + if test -f /usr/options/cb.name; then + UNAME_REL=`sed -n 's/.*Version //p' /dev/null >/dev/null ; then + UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` + (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 + (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \ + && UNAME_MACHINE=i586 + (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \ + && UNAME_MACHINE=i686 + (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ + && UNAME_MACHINE=i686 + echo ${UNAME_MACHINE}-pc-sco$UNAME_REL + else + echo ${UNAME_MACHINE}-pc-sysv32 + fi + exit ;; + pc:*:*:*) + # Left here for compatibility: + # uname -m prints for DJGPP always 'pc', but it prints nothing about + # the processor, so we play safe by assuming i386. + echo i386-pc-msdosdjgpp + exit ;; + Intel:Mach:3*:*) + echo i386-pc-mach3 + exit ;; + paragon:*:*:*) + echo i860-intel-osf1 + exit ;; + i860:*:4.*:*) # i860-SVR4 + if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then + echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4 + else # Add other i860-SVR4 vendors below as they are discovered. + echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4 + fi + exit ;; + mini*:CTIX:SYS*5:*) + # "miniframe" + echo m68010-convergent-sysv + exit ;; + mc68k:UNIX:SYSTEM5:3.51m) + echo m68k-convergent-sysv + exit ;; + M680?0:D-NIX:5.3:*) + echo m68k-diab-dnix + exit ;; + M68*:*:R3V[5678]*:*) + test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;; + 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0) + OS_REL='' + test -r /etc/.relid \ + && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` + /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ + && { echo i486-ncr-sysv4.3${OS_REL}; exit; } + /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ + && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; + 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) + /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ + && { echo i486-ncr-sysv4; exit; } ;; + m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) + echo m68k-unknown-lynxos${UNAME_RELEASE} + exit ;; + mc68030:UNIX_System_V:4.*:*) + echo m68k-atari-sysv4 + exit ;; + TSUNAMI:LynxOS:2.*:*) + echo sparc-unknown-lynxos${UNAME_RELEASE} + exit ;; + rs6000:LynxOS:2.*:*) + echo rs6000-unknown-lynxos${UNAME_RELEASE} + exit ;; + PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*) + echo powerpc-unknown-lynxos${UNAME_RELEASE} + exit ;; + SM[BE]S:UNIX_SV:*:*) + echo mips-dde-sysv${UNAME_RELEASE} + exit ;; + RM*:ReliantUNIX-*:*:*) + echo mips-sni-sysv4 + exit ;; + RM*:SINIX-*:*:*) + echo mips-sni-sysv4 + exit ;; + *:SINIX-*:*:*) + if uname -p 2>/dev/null >/dev/null ; then + UNAME_MACHINE=`(uname -p) 2>/dev/null` + echo ${UNAME_MACHINE}-sni-sysv4 + else + echo ns32k-sni-sysv + fi + exit ;; + PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort + # says + echo i586-unisys-sysv4 + exit ;; + *:UNIX_System_V:4*:FTX*) + # From Gerald Hewes . + # How about differentiating between stratus architectures? -djm + echo hppa1.1-stratus-sysv4 + exit ;; + *:*:*:FTX*) + # From seanf@swdc.stratus.com. + echo i860-stratus-sysv4 + exit ;; + i*86:VOS:*:*) + # From Paul.Green@stratus.com. + echo ${UNAME_MACHINE}-stratus-vos + exit ;; + *:VOS:*:*) + # From Paul.Green@stratus.com. + echo hppa1.1-stratus-vos + exit ;; + mc68*:A/UX:*:*) + echo m68k-apple-aux${UNAME_RELEASE} + exit ;; + news*:NEWS-OS:6*:*) + echo mips-sony-newsos6 + exit ;; + R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) + if [ -d /usr/nec ]; then + echo mips-nec-sysv${UNAME_RELEASE} + else + echo mips-unknown-sysv${UNAME_RELEASE} + fi + exit ;; + BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. + echo powerpc-be-beos + exit ;; + BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. + echo powerpc-apple-beos + exit ;; + BePC:BeOS:*:*) # BeOS running on Intel PC compatible. + echo i586-pc-beos + exit ;; + SX-4:SUPER-UX:*:*) + echo sx4-nec-superux${UNAME_RELEASE} + exit ;; + SX-5:SUPER-UX:*:*) + echo sx5-nec-superux${UNAME_RELEASE} + exit ;; + SX-6:SUPER-UX:*:*) + echo sx6-nec-superux${UNAME_RELEASE} + exit ;; + Power*:Rhapsody:*:*) + echo powerpc-apple-rhapsody${UNAME_RELEASE} + exit ;; + *:Rhapsody:*:*) + echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} + exit ;; + *:Darwin:*:*) + UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown + case $UNAME_PROCESSOR in + *86) UNAME_PROCESSOR=i686 ;; + unknown) UNAME_PROCESSOR=powerpc ;; + esac + echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} + exit ;; + *:procnto*:*:* | *:QNX:[0123456789]*:*) + UNAME_PROCESSOR=`uname -p` + if test "$UNAME_PROCESSOR" = "x86"; then + UNAME_PROCESSOR=i386 + UNAME_MACHINE=pc + fi + echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE} + exit ;; + *:QNX:*:4*) + echo i386-pc-qnx + exit ;; + NSE-?:NONSTOP_KERNEL:*:*) + echo nse-tandem-nsk${UNAME_RELEASE} + exit ;; + NSR-?:NONSTOP_KERNEL:*:*) + echo nsr-tandem-nsk${UNAME_RELEASE} + exit ;; + *:NonStop-UX:*:*) + echo mips-compaq-nonstopux + exit ;; + BS2000:POSIX*:*:*) + echo bs2000-siemens-sysv + exit ;; + DS/*:UNIX_System_V:*:*) + echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} + exit ;; + *:Plan9:*:*) + # "uname -m" is not consistent, so use $cputype instead. 386 + # is converted to i386 for consistency with other x86 + # operating systems. + if test "$cputype" = "386"; then + UNAME_MACHINE=i386 + else + UNAME_MACHINE="$cputype" + fi + echo ${UNAME_MACHINE}-unknown-plan9 + exit ;; + *:TOPS-10:*:*) + echo pdp10-unknown-tops10 + exit ;; + *:TENEX:*:*) + echo pdp10-unknown-tenex + exit ;; + KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) + echo pdp10-dec-tops20 + exit ;; + XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) + echo pdp10-xkl-tops20 + exit ;; + *:TOPS-20:*:*) + echo pdp10-unknown-tops20 + exit ;; + *:ITS:*:*) + echo pdp10-unknown-its + exit ;; + SEI:*:*:SEIUX) + echo mips-sei-seiux${UNAME_RELEASE} + exit ;; + *:DragonFly:*:*) + echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` + exit ;; + *:*VMS:*:*) + UNAME_MACHINE=`(uname -p) 2>/dev/null` + case "${UNAME_MACHINE}" in + A*) echo alpha-dec-vms ; exit ;; + I*) echo ia64-dec-vms ; exit ;; + V*) echo vax-dec-vms ; exit ;; + esac ;; + *:XENIX:*:SysV) + echo i386-pc-xenix + exit ;; + i*86:skyos:*:*) + echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//' + exit ;; +esac + +#echo '(No uname command or uname output not recognized.)' 1>&2 +#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2 + +eval $set_cc_for_build +cat >$dummy.c < +# include +#endif +main () +{ +#if defined (sony) +#if defined (MIPSEB) + /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed, + I don't know.... */ + printf ("mips-sony-bsd\n"); exit (0); +#else +#include + printf ("m68k-sony-newsos%s\n", +#ifdef NEWSOS4 + "4" +#else + "" +#endif + ); exit (0); +#endif +#endif + +#if defined (__arm) && defined (__acorn) && defined (__unix) + printf ("arm-acorn-riscix\n"); exit (0); +#endif + +#if defined (hp300) && !defined (hpux) + printf ("m68k-hp-bsd\n"); exit (0); +#endif + +#if defined (NeXT) +#if !defined (__ARCHITECTURE__) +#define __ARCHITECTURE__ "m68k" +#endif + int version; + version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; + if (version < 4) + printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); + else + printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version); + exit (0); +#endif + +#if defined (MULTIMAX) || defined (n16) +#if defined (UMAXV) + printf ("ns32k-encore-sysv\n"); exit (0); +#else +#if defined (CMU) + printf ("ns32k-encore-mach\n"); exit (0); +#else + printf ("ns32k-encore-bsd\n"); exit (0); +#endif +#endif +#endif + +#if defined (__386BSD__) + printf ("i386-pc-bsd\n"); exit (0); +#endif + +#if defined (sequent) +#if defined (i386) + printf ("i386-sequent-dynix\n"); exit (0); +#endif +#if defined (ns32000) + printf ("ns32k-sequent-dynix\n"); exit (0); +#endif +#endif + +#if defined (_SEQUENT_) + struct utsname un; + + uname(&un); + + if (strncmp(un.version, "V2", 2) == 0) { + printf ("i386-sequent-ptx2\n"); exit (0); + } + if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */ + printf ("i386-sequent-ptx1\n"); exit (0); + } + printf ("i386-sequent-ptx\n"); exit (0); + +#endif + +#if defined (vax) +# if !defined (ultrix) +# include +# if defined (BSD) +# if BSD == 43 + printf ("vax-dec-bsd4.3\n"); exit (0); +# else +# if BSD == 199006 + printf ("vax-dec-bsd4.3reno\n"); exit (0); +# else + printf ("vax-dec-bsd\n"); exit (0); +# endif +# endif +# else + printf ("vax-dec-bsd\n"); exit (0); +# endif +# else + printf ("vax-dec-ultrix\n"); exit (0); +# endif +#endif + +#if defined (alliant) && defined (i860) + printf ("i860-alliant-bsd\n"); exit (0); +#endif + + exit (1); +} +EOF + +$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` && + { echo "$SYSTEM_NAME"; exit; } + +# Apollos put the system type in the environment. + +test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; } + +# Convex versions that predate uname can use getsysinfo(1) + +if [ -x /usr/convex/getsysinfo ] +then + case `getsysinfo -f cpu_type` in + c1*) + echo c1-convex-bsd + exit ;; + c2*) + if getsysinfo -f scalar_acc + then echo c32-convex-bsd + else echo c2-convex-bsd + fi + exit ;; + c34*) + echo c34-convex-bsd + exit ;; + c38*) + echo c38-convex-bsd + exit ;; + c4*) + echo c4-convex-bsd + exit ;; + esac +fi + +cat >&2 < in order to provide the needed +information to handle your system. + +config.guess timestamp = $timestamp + +uname -m = `(uname -m) 2>/dev/null || echo unknown` +uname -r = `(uname -r) 2>/dev/null || echo unknown` +uname -s = `(uname -s) 2>/dev/null || echo unknown` +uname -v = `(uname -v) 2>/dev/null || echo unknown` + +/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null` +/bin/uname -X = `(/bin/uname -X) 2>/dev/null` + +hostinfo = `(hostinfo) 2>/dev/null` +/bin/universe = `(/bin/universe) 2>/dev/null` +/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` +/bin/arch = `(/bin/arch) 2>/dev/null` +/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` +/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` + +UNAME_MACHINE = ${UNAME_MACHINE} +UNAME_RELEASE = ${UNAME_RELEASE} +UNAME_SYSTEM = ${UNAME_SYSTEM} +UNAME_VERSION = ${UNAME_VERSION} +EOF + +exit 1 + +# Local variables: +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "timestamp='" +# time-stamp-format: "%:y-%02m-%02d" +# time-stamp-end: "'" +# End: diff --git a/app/twm/config.h.in b/app/twm/config.h.in new file mode 100644 index 000000000..865e1a0c0 --- /dev/null +++ b/app/twm/config.h.in @@ -0,0 +1,29 @@ +/* config.h.in. Generated from configure.ac by autoheader. */ + +/* Define to 1 if you have the `mkstemp' function. */ +#undef HAS_MKSTEMP + +/* Name of package */ +#undef PACKAGE + +/* Define to the address where bug reports for this package should be sent. */ +#undef PACKAGE_BUGREPORT + +/* Define to the full name of this package. */ +#undef PACKAGE_NAME + +/* Define to the full name and version of this package. */ +#undef PACKAGE_STRING + +/* Define to the one symbol short name of this package. */ +#undef PACKAGE_TARNAME + +/* Define to the version of this package. */ +#undef PACKAGE_VERSION + +/* Version number of package */ +#undef VERSION + +/* Define to 1 if `lex' declares `yytext' as a `char *' by default, not a + `char[]'. */ +#undef YYTEXT_POINTER diff --git a/app/twm/config.sub b/app/twm/config.sub new file mode 100644 index 000000000..1c366dfde --- /dev/null +++ b/app/twm/config.sub @@ -0,0 +1,1579 @@ +#! /bin/sh +# Configuration validation subroutine script. +# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, +# 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. + +timestamp='2005-07-08' + +# This file is (in principle) common to ALL GNU software. +# The presence of a machine in this file suggests that SOME GNU software +# can handle that machine. It does not imply ALL GNU software can. +# +# This file is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA +# 02110-1301, USA. +# +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + + +# Please send patches to . Submit a context +# diff and a properly formatted ChangeLog entry. +# +# Configuration subroutine to validate and canonicalize a configuration type. +# Supply the specified configuration type as an argument. +# If it is invalid, we print an error message on stderr and exit with code 1. +# Otherwise, we print the canonical config type on stdout and succeed. + +# This file is supposed to be the same for all GNU packages +# and recognize all the CPU types, system types and aliases +# that are meaningful with *any* GNU software. +# Each package is responsible for reporting which valid configurations +# it does not support. The user should be able to distinguish +# a failure to support a valid configuration from a meaningless +# configuration. + +# The goal of this file is to map all the various variations of a given +# machine specification into a single specification in the form: +# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM +# or in some cases, the newer four-part form: +# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM +# It is wrong to echo any other type of specification. + +me=`echo "$0" | sed -e 's,.*/,,'` + +usage="\ +Usage: $0 [OPTION] CPU-MFR-OPSYS + $0 [OPTION] ALIAS + +Canonicalize a configuration name. + +Operation modes: + -h, --help print this help, then exit + -t, --time-stamp print date of last modification, then exit + -v, --version print version number, then exit + +Report bugs and patches to ." + +version="\ +GNU config.sub ($timestamp) + +Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 +Free Software Foundation, Inc. + +This is free software; see the source for copying conditions. There is NO +warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." + +help=" +Try \`$me --help' for more information." + +# Parse command line +while test $# -gt 0 ; do + case $1 in + --time-stamp | --time* | -t ) + echo "$timestamp" ; exit ;; + --version | -v ) + echo "$version" ; exit ;; + --help | --h* | -h ) + echo "$usage"; exit ;; + -- ) # Stop option processing + shift; break ;; + - ) # Use stdin as input. + break ;; + -* ) + echo "$me: invalid option $1$help" + exit 1 ;; + + *local*) + # First pass through any local machine types. + echo $1 + exit ;; + + * ) + break ;; + esac +done + +case $# in + 0) echo "$me: missing argument$help" >&2 + exit 1;; + 1) ;; + *) echo "$me: too many arguments$help" >&2 + exit 1;; +esac + +# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). +# Here we must recognize all the valid KERNEL-OS combinations. +maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` +case $maybe_os in + nto-qnx* | linux-gnu* | linux-dietlibc | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | \ + kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | storm-chaos* | os2-emx* | rtmk-nova*) + os=-$maybe_os + basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` + ;; + *) + basic_machine=`echo $1 | sed 's/-[^-]*$//'` + if [ $basic_machine != $1 ] + then os=`echo $1 | sed 's/.*-/-/'` + else os=; fi + ;; +esac + +### Let's recognize common machines as not being operating systems so +### that things like config.sub decstation-3100 work. We also +### recognize some manufacturers as not being operating systems, so we +### can provide default operating systems below. +case $os in + -sun*os*) + # Prevent following clause from handling this invalid input. + ;; + -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \ + -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \ + -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \ + -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ + -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ + -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ + -apple | -axis | -knuth | -cray) + os= + basic_machine=$1 + ;; + -sim | -cisco | -oki | -wec | -winbond) + os= + basic_machine=$1 + ;; + -scout) + ;; + -wrs) + os=-vxworks + basic_machine=$1 + ;; + -chorusos*) + os=-chorusos + basic_machine=$1 + ;; + -chorusrdb) + os=-chorusrdb + basic_machine=$1 + ;; + -hiux*) + os=-hiuxwe2 + ;; + -sco5) + os=-sco3.2v5 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco4) + os=-sco3.2v4 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco3.2.[4-9]*) + os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco3.2v[4-9]*) + # Don't forget version if it is 3.2v4 or newer. + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco*) + os=-sco3.2v2 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -udk*) + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -isc) + os=-isc2.2 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -clix*) + basic_machine=clipper-intergraph + ;; + -isc*) + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -lynx*) + os=-lynxos + ;; + -ptx*) + basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'` + ;; + -windowsnt*) + os=`echo $os | sed -e 's/windowsnt/winnt/'` + ;; + -psos*) + os=-psos + ;; + -mint | -mint[0-9]*) + basic_machine=m68k-atari + os=-mint + ;; +esac + +# Decode aliases for certain CPU-COMPANY combinations. +case $basic_machine in + # Recognize the basic CPU types without company name. + # Some are omitted here because they have special meanings below. + 1750a | 580 \ + | a29k \ + | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ + | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ + | am33_2.0 \ + | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr \ + | bfin \ + | c4x | clipper \ + | d10v | d30v | dlx | dsp16xx \ + | fr30 | frv \ + | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ + | i370 | i860 | i960 | ia64 \ + | ip2k | iq2000 \ + | m32r | m32rle | m68000 | m68k | m88k | maxq | mcore \ + | mips | mipsbe | mipseb | mipsel | mipsle \ + | mips16 \ + | mips64 | mips64el \ + | mips64vr | mips64vrel \ + | mips64orion | mips64orionel \ + | mips64vr4100 | mips64vr4100el \ + | mips64vr4300 | mips64vr4300el \ + | mips64vr5000 | mips64vr5000el \ + | mips64vr5900 | mips64vr5900el \ + | mipsisa32 | mipsisa32el \ + | mipsisa32r2 | mipsisa32r2el \ + | mipsisa64 | mipsisa64el \ + | mipsisa64r2 | mipsisa64r2el \ + | mipsisa64sb1 | mipsisa64sb1el \ + | mipsisa64sr71k | mipsisa64sr71kel \ + | mipstx39 | mipstx39el \ + | mn10200 | mn10300 \ + | ms1 \ + | msp430 \ + | ns16k | ns32k \ + | or32 \ + | pdp10 | pdp11 | pj | pjl \ + | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \ + | pyramid \ + | sh | sh[1234] | sh[24]a | sh[23]e | sh[34]eb | shbe | shle | sh[1234]le | sh3ele \ + | sh64 | sh64le \ + | sparc | sparc64 | sparc64b | sparc86x | sparclet | sparclite \ + | sparcv8 | sparcv9 | sparcv9b \ + | strongarm \ + | tahoe | thumb | tic4x | tic80 | tron \ + | v850 | v850e \ + | we32k \ + | x86 | xscale | xscalee[bl] | xstormy16 | xtensa \ + | z8k) + basic_machine=$basic_machine-unknown + ;; + m32c) + basic_machine=$basic_machine-unknown + ;; + m6811 | m68hc11 | m6812 | m68hc12) + # Motorola 68HC11/12. + basic_machine=$basic_machine-unknown + os=-none + ;; + m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) + ;; + + # We use `pc' rather than `unknown' + # because (1) that's what they normally are, and + # (2) the word "unknown" tends to confuse beginning users. + i*86 | x86_64) + basic_machine=$basic_machine-pc + ;; + # Object if more than one company name word. + *-*-*) + echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 + exit 1 + ;; + # Recognize the basic CPU types with company name. + 580-* \ + | a29k-* \ + | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ + | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ + | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \ + | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ + | avr-* \ + | bfin-* | bs2000-* \ + | c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \ + | clipper-* | craynv-* | cydra-* \ + | d10v-* | d30v-* | dlx-* \ + | elxsi-* \ + | f30[01]-* | f700-* | fr30-* | frv-* | fx80-* \ + | h8300-* | h8500-* \ + | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ + | i*86-* | i860-* | i960-* | ia64-* \ + | ip2k-* | iq2000-* \ + | m32r-* | m32rle-* \ + | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ + | m88110-* | m88k-* | maxq-* | mcore-* \ + | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ + | mips16-* \ + | mips64-* | mips64el-* \ + | mips64vr-* | mips64vrel-* \ + | mips64orion-* | mips64orionel-* \ + | mips64vr4100-* | mips64vr4100el-* \ + | mips64vr4300-* | mips64vr4300el-* \ + | mips64vr5000-* | mips64vr5000el-* \ + | mips64vr5900-* | mips64vr5900el-* \ + | mipsisa32-* | mipsisa32el-* \ + | mipsisa32r2-* | mipsisa32r2el-* \ + | mipsisa64-* | mipsisa64el-* \ + | mipsisa64r2-* | mipsisa64r2el-* \ + | mipsisa64sb1-* | mipsisa64sb1el-* \ + | mipsisa64sr71k-* | mipsisa64sr71kel-* \ + | mipstx39-* | mipstx39el-* \ + | mmix-* \ + | ms1-* \ + | msp430-* \ + | none-* | np1-* | ns16k-* | ns32k-* \ + | orion-* \ + | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ + | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \ + | pyramid-* \ + | romp-* | rs6000-* \ + | sh-* | sh[1234]-* | sh[24]a-* | sh[23]e-* | sh[34]eb-* | shbe-* \ + | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ + | sparc-* | sparc64-* | sparc64b-* | sparc86x-* | sparclet-* \ + | sparclite-* \ + | sparcv8-* | sparcv9-* | sparcv9b-* | strongarm-* | sv1-* | sx?-* \ + | tahoe-* | thumb-* \ + | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ + | tron-* \ + | v850-* | v850e-* | vax-* \ + | we32k-* \ + | x86-* | x86_64-* | xps100-* | xscale-* | xscalee[bl]-* \ + | xstormy16-* | xtensa-* \ + | ymp-* \ + | z8k-*) + ;; + m32c-*) + ;; + # Recognize the various machine names and aliases which stand + # for a CPU type and a company and sometimes even an OS. + 386bsd) + basic_machine=i386-unknown + os=-bsd + ;; + 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) + basic_machine=m68000-att + ;; + 3b*) + basic_machine=we32k-att + ;; + a29khif) + basic_machine=a29k-amd + os=-udi + ;; + abacus) + basic_machine=abacus-unknown + ;; + adobe68k) + basic_machine=m68010-adobe + os=-scout + ;; + alliant | fx80) + basic_machine=fx80-alliant + ;; + altos | altos3068) + basic_machine=m68k-altos + ;; + am29k) + basic_machine=a29k-none + os=-bsd + ;; + amd64) + basic_machine=x86_64-pc + ;; + amd64-*) + basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + amdahl) + basic_machine=580-amdahl + os=-sysv + ;; + amiga | amiga-*) + basic_machine=m68k-unknown + ;; + amigaos | amigados) + basic_machine=m68k-unknown + os=-amigaos + ;; + amigaunix | amix) + basic_machine=m68k-unknown + os=-sysv4 + ;; + apollo68) + basic_machine=m68k-apollo + os=-sysv + ;; + apollo68bsd) + basic_machine=m68k-apollo + os=-bsd + ;; + aux) + basic_machine=m68k-apple + os=-aux + ;; + balance) + basic_machine=ns32k-sequent + os=-dynix + ;; + c90) + basic_machine=c90-cray + os=-unicos + ;; + convex-c1) + basic_machine=c1-convex + os=-bsd + ;; + convex-c2) + basic_machine=c2-convex + os=-bsd + ;; + convex-c32) + basic_machine=c32-convex + os=-bsd + ;; + convex-c34) + basic_machine=c34-convex + os=-bsd + ;; + convex-c38) + basic_machine=c38-convex + os=-bsd + ;; + cray | j90) + basic_machine=j90-cray + os=-unicos + ;; + craynv) + basic_machine=craynv-cray + os=-unicosmp + ;; + cr16c) + basic_machine=cr16c-unknown + os=-elf + ;; + crds | unos) + basic_machine=m68k-crds + ;; + crisv32 | crisv32-* | etraxfs*) + basic_machine=crisv32-axis + ;; + cris | cris-* | etrax*) + basic_machine=cris-axis + ;; + crx) + basic_machine=crx-unknown + os=-elf + ;; + da30 | da30-*) + basic_machine=m68k-da30 + ;; + decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn) + basic_machine=mips-dec + ;; + decsystem10* | dec10*) + basic_machine=pdp10-dec + os=-tops10 + ;; + decsystem20* | dec20*) + basic_machine=pdp10-dec + os=-tops20 + ;; + delta | 3300 | motorola-3300 | motorola-delta \ + | 3300-motorola | delta-motorola) + basic_machine=m68k-motorola + ;; + delta88) + basic_machine=m88k-motorola + os=-sysv3 + ;; + djgpp) + basic_machine=i586-pc + os=-msdosdjgpp + ;; + dpx20 | dpx20-*) + basic_machine=rs6000-bull + os=-bosx + ;; + dpx2* | dpx2*-bull) + basic_machine=m68k-bull + os=-sysv3 + ;; + ebmon29k) + basic_machine=a29k-amd + os=-ebmon + ;; + elxsi) + basic_machine=elxsi-elxsi + os=-bsd + ;; + encore | umax | mmax) + basic_machine=ns32k-encore + ;; + es1800 | OSE68k | ose68k | ose | OSE) + basic_machine=m68k-ericsson + os=-ose + ;; + fx2800) + basic_machine=i860-alliant + ;; + genix) + basic_machine=ns32k-ns + ;; + gmicro) + basic_machine=tron-gmicro + os=-sysv + ;; + go32) + basic_machine=i386-pc + os=-go32 + ;; + h3050r* | hiux*) + basic_machine=hppa1.1-hitachi + os=-hiuxwe2 + ;; + h8300hms) + basic_machine=h8300-hitachi + os=-hms + ;; + h8300xray) + basic_machine=h8300-hitachi + os=-xray + ;; + h8500hms) + basic_machine=h8500-hitachi + os=-hms + ;; + harris) + basic_machine=m88k-harris + os=-sysv3 + ;; + hp300-*) + basic_machine=m68k-hp + ;; + hp300bsd) + basic_machine=m68k-hp + os=-bsd + ;; + hp300hpux) + basic_machine=m68k-hp + os=-hpux + ;; + hp3k9[0-9][0-9] | hp9[0-9][0-9]) + basic_machine=hppa1.0-hp + ;; + hp9k2[0-9][0-9] | hp9k31[0-9]) + basic_machine=m68000-hp + ;; + hp9k3[2-9][0-9]) + basic_machine=m68k-hp + ;; + hp9k6[0-9][0-9] | hp6[0-9][0-9]) + basic_machine=hppa1.0-hp + ;; + hp9k7[0-79][0-9] | hp7[0-79][0-9]) + basic_machine=hppa1.1-hp + ;; + hp9k78[0-9] | hp78[0-9]) + # FIXME: really hppa2.0-hp + basic_machine=hppa1.1-hp + ;; + hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) + # FIXME: really hppa2.0-hp + basic_machine=hppa1.1-hp + ;; + hp9k8[0-9][13679] | hp8[0-9][13679]) + basic_machine=hppa1.1-hp + ;; + hp9k8[0-9][0-9] | hp8[0-9][0-9]) + basic_machine=hppa1.0-hp + ;; + hppa-next) + os=-nextstep3 + ;; + hppaosf) + basic_machine=hppa1.1-hp + os=-osf + ;; + hppro) + basic_machine=hppa1.1-hp + os=-proelf + ;; + i370-ibm* | ibm*) + basic_machine=i370-ibm + ;; +# I'm not sure what "Sysv32" means. Should this be sysv3.2? + i*86v32) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-sysv32 + ;; + i*86v4*) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-sysv4 + ;; + i*86v) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-sysv + ;; + i*86sol2) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-solaris2 + ;; + i386mach) + basic_machine=i386-mach + os=-mach + ;; + i386-vsta | vsta) + basic_machine=i386-unknown + os=-vsta + ;; + iris | iris4d) + basic_machine=mips-sgi + case $os in + -irix*) + ;; + *) + os=-irix4 + ;; + esac + ;; + isi68 | isi) + basic_machine=m68k-isi + os=-sysv + ;; + m88k-omron*) + basic_machine=m88k-omron + ;; + magnum | m3230) + basic_machine=mips-mips + os=-sysv + ;; + merlin) + basic_machine=ns32k-utek + os=-sysv + ;; + mingw32) + basic_machine=i386-pc + os=-mingw32 + ;; + miniframe) + basic_machine=m68000-convergent + ;; + *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*) + basic_machine=m68k-atari + os=-mint + ;; + mips3*-*) + basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` + ;; + mips3*) + basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown + ;; + monitor) + basic_machine=m68k-rom68k + os=-coff + ;; + morphos) + basic_machine=powerpc-unknown + os=-morphos + ;; + msdos) + basic_machine=i386-pc + os=-msdos + ;; + mvs) + basic_machine=i370-ibm + os=-mvs + ;; + ncr3000) + basic_machine=i486-ncr + os=-sysv4 + ;; + netbsd386) + basic_machine=i386-unknown + os=-netbsd + ;; + netwinder) + basic_machine=armv4l-rebel + os=-linux + ;; + news | news700 | news800 | news900) + basic_machine=m68k-sony + os=-newsos + ;; + news1000) + basic_machine=m68030-sony + os=-newsos + ;; + news-3600 | risc-news) + basic_machine=mips-sony + os=-newsos + ;; + necv70) + basic_machine=v70-nec + os=-sysv + ;; + next | m*-next ) + basic_machine=m68k-next + case $os in + -nextstep* ) + ;; + -ns2*) + os=-nextstep2 + ;; + *) + os=-nextstep3 + ;; + esac + ;; + nh3000) + basic_machine=m68k-harris + os=-cxux + ;; + nh[45]000) + basic_machine=m88k-harris + os=-cxux + ;; + nindy960) + basic_machine=i960-intel + os=-nindy + ;; + mon960) + basic_machine=i960-intel + os=-mon960 + ;; + nonstopux) + basic_machine=mips-compaq + os=-nonstopux + ;; + np1) + basic_machine=np1-gould + ;; + nsr-tandem) + basic_machine=nsr-tandem + ;; + op50n-* | op60c-*) + basic_machine=hppa1.1-oki + os=-proelf + ;; + openrisc | openrisc-*) + basic_machine=or32-unknown + ;; + os400) + basic_machine=powerpc-ibm + os=-os400 + ;; + OSE68000 | ose68000) + basic_machine=m68000-ericsson + os=-ose + ;; + os68k) + basic_machine=m68k-none + os=-os68k + ;; + pa-hitachi) + basic_machine=hppa1.1-hitachi + os=-hiuxwe2 + ;; + paragon) + basic_machine=i860-intel + os=-osf + ;; + pbd) + basic_machine=sparc-tti + ;; + pbb) + basic_machine=m68k-tti + ;; + pc532 | pc532-*) + basic_machine=ns32k-pc532 + ;; + pentium | p5 | k5 | k6 | nexgen | viac3) + basic_machine=i586-pc + ;; + pentiumpro | p6 | 6x86 | athlon | athlon_*) + basic_machine=i686-pc + ;; + pentiumii | pentium2 | pentiumiii | pentium3) + basic_machine=i686-pc + ;; + pentium4) + basic_machine=i786-pc + ;; + pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) + basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pentiumpro-* | p6-* | 6x86-* | athlon-*) + basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*) + basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pentium4-*) + basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pn) + basic_machine=pn-gould + ;; + power) basic_machine=power-ibm + ;; + ppc) basic_machine=powerpc-unknown + ;; + ppc-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ppcle | powerpclittle | ppc-le | powerpc-little) + basic_machine=powerpcle-unknown + ;; + ppcle-* | powerpclittle-*) + basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ppc64) basic_machine=powerpc64-unknown + ;; + ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ppc64le | powerpc64little | ppc64-le | powerpc64-little) + basic_machine=powerpc64le-unknown + ;; + ppc64le-* | powerpc64little-*) + basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ps2) + basic_machine=i386-ibm + ;; + pw32) + basic_machine=i586-unknown + os=-pw32 + ;; + rom68k) + basic_machine=m68k-rom68k + os=-coff + ;; + rm[46]00) + basic_machine=mips-siemens + ;; + rtpc | rtpc-*) + basic_machine=romp-ibm + ;; + s390 | s390-*) + basic_machine=s390-ibm + ;; + s390x | s390x-*) + basic_machine=s390x-ibm + ;; + sa29200) + basic_machine=a29k-amd + os=-udi + ;; + sb1) + basic_machine=mipsisa64sb1-unknown + ;; + sb1el) + basic_machine=mipsisa64sb1el-unknown + ;; + sei) + basic_machine=mips-sei + os=-seiux + ;; + sequent) + basic_machine=i386-sequent + ;; + sh) + basic_machine=sh-hitachi + os=-hms + ;; + sh64) + basic_machine=sh64-unknown + ;; + sparclite-wrs | simso-wrs) + basic_machine=sparclite-wrs + os=-vxworks + ;; + sps7) + basic_machine=m68k-bull + os=-sysv2 + ;; + spur) + basic_machine=spur-unknown + ;; + st2000) + basic_machine=m68k-tandem + ;; + stratus) + basic_machine=i860-stratus + os=-sysv4 + ;; + sun2) + basic_machine=m68000-sun + ;; + sun2os3) + basic_machine=m68000-sun + os=-sunos3 + ;; + sun2os4) + basic_machine=m68000-sun + os=-sunos4 + ;; + sun3os3) + basic_machine=m68k-sun + os=-sunos3 + ;; + sun3os4) + basic_machine=m68k-sun + os=-sunos4 + ;; + sun4os3) + basic_machine=sparc-sun + os=-sunos3 + ;; + sun4os4) + basic_machine=sparc-sun + os=-sunos4 + ;; + sun4sol2) + basic_machine=sparc-sun + os=-solaris2 + ;; + sun3 | sun3-*) + basic_machine=m68k-sun + ;; + sun4) + basic_machine=sparc-sun + ;; + sun386 | sun386i | roadrunner) + basic_machine=i386-sun + ;; + sv1) + basic_machine=sv1-cray + os=-unicos + ;; + symmetry) + basic_machine=i386-sequent + os=-dynix + ;; + t3e) + basic_machine=alphaev5-cray + os=-unicos + ;; + t90) + basic_machine=t90-cray + os=-unicos + ;; + tic54x | c54x*) + basic_machine=tic54x-unknown + os=-coff + ;; + tic55x | c55x*) + basic_machine=tic55x-unknown + os=-coff + ;; + tic6x | c6x*) + basic_machine=tic6x-unknown + os=-coff + ;; + tx39) + basic_machine=mipstx39-unknown + ;; + tx39el) + basic_machine=mipstx39el-unknown + ;; + toad1) + basic_machine=pdp10-xkl + os=-tops20 + ;; + tower | tower-32) + basic_machine=m68k-ncr + ;; + tpf) + basic_machine=s390x-ibm + os=-tpf + ;; + udi29k) + basic_machine=a29k-amd + os=-udi + ;; + ultra3) + basic_machine=a29k-nyu + os=-sym1 + ;; + v810 | necv810) + basic_machine=v810-nec + os=-none + ;; + vaxv) + basic_machine=vax-dec + os=-sysv + ;; + vms) + basic_machine=vax-dec + os=-vms + ;; + vpp*|vx|vx-*) + basic_machine=f301-fujitsu + ;; + vxworks960) + basic_machine=i960-wrs + os=-vxworks + ;; + vxworks68) + basic_machine=m68k-wrs + os=-vxworks + ;; + vxworks29k) + basic_machine=a29k-wrs + os=-vxworks + ;; + w65*) + basic_machine=w65-wdc + os=-none + ;; + w89k-*) + basic_machine=hppa1.1-winbond + os=-proelf + ;; + xbox) + basic_machine=i686-pc + os=-mingw32 + ;; + xps | xps100) + basic_machine=xps100-honeywell + ;; + ymp) + basic_machine=ymp-cray + os=-unicos + ;; + z8k-*-coff) + basic_machine=z8k-unknown + os=-sim + ;; + none) + basic_machine=none-none + os=-none + ;; + +# Here we handle the default manufacturer of certain CPU types. It is in +# some cases the only manufacturer, in others, it is the most popular. + w89k) + basic_machine=hppa1.1-winbond + ;; + op50n) + basic_machine=hppa1.1-oki + ;; + op60c) + basic_machine=hppa1.1-oki + ;; + romp) + basic_machine=romp-ibm + ;; + mmix) + basic_machine=mmix-knuth + ;; + rs6000) + basic_machine=rs6000-ibm + ;; + vax) + basic_machine=vax-dec + ;; + pdp10) + # there are many clones, so DEC is not a safe bet + basic_machine=pdp10-unknown + ;; + pdp11) + basic_machine=pdp11-dec + ;; + we32k) + basic_machine=we32k-att + ;; + sh[1234] | sh[24]a | sh[34]eb | sh[1234]le | sh[23]ele) + basic_machine=sh-unknown + ;; + sparc | sparcv8 | sparcv9 | sparcv9b) + basic_machine=sparc-sun + ;; + cydra) + basic_machine=cydra-cydrome + ;; + orion) + basic_machine=orion-highlevel + ;; + orion105) + basic_machine=clipper-highlevel + ;; + mac | mpw | mac-mpw) + basic_machine=m68k-apple + ;; + pmac | pmac-mpw) + basic_machine=powerpc-apple + ;; + *-unknown) + # Make sure to match an already-canonicalized machine name. + ;; + *) + echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 + exit 1 + ;; +esac + +# Here we canonicalize certain aliases for manufacturers. +case $basic_machine in + *-digital*) + basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'` + ;; + *-commodore*) + basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'` + ;; + *) + ;; +esac + +# Decode manufacturer-specific aliases for certain operating systems. + +if [ x"$os" != x"" ] +then +case $os in + # First match some system type aliases + # that might get confused with valid system types. + # -solaris* is a basic system type, with this one exception. + -solaris1 | -solaris1.*) + os=`echo $os | sed -e 's|solaris1|sunos4|'` + ;; + -solaris) + os=-solaris2 + ;; + -svr4*) + os=-sysv4 + ;; + -unixware*) + os=-sysv4.2uw + ;; + -gnu/linux*) + os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` + ;; + # First accept the basic system types. + # The portable systems comes first. + # Each alternative MUST END IN A *, to match a version number. + # -sysv* is not here because it comes later, after sysvr4. + -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ + | -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\ + | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \ + | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ + | -aos* \ + | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ + | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ + | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* | -openbsd* \ + | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \ + | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ + | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ + | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ + | -chorusos* | -chorusrdb* \ + | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ + | -mingw32* | -linux-gnu* | -linux-uclibc* | -uxpv* | -beos* | -mpeix* | -udk* \ + | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ + | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ + | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ + | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ + | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ + | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ + | -skyos* | -haiku*) + # Remember, each alternative MUST END IN *, to match a version number. + ;; + -qnx*) + case $basic_machine in + x86-* | i*86-*) + ;; + *) + os=-nto$os + ;; + esac + ;; + -nto-qnx*) + ;; + -nto*) + os=`echo $os | sed -e 's|nto|nto-qnx|'` + ;; + -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ + | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \ + | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) + ;; + -mac*) + os=`echo $os | sed -e 's|mac|macos|'` + ;; + -linux-dietlibc) + os=-linux-dietlibc + ;; + -linux*) + os=`echo $os | sed -e 's|linux|linux-gnu|'` + ;; + -sunos5*) + os=`echo $os | sed -e 's|sunos5|solaris2|'` + ;; + -sunos6*) + os=`echo $os | sed -e 's|sunos6|solaris3|'` + ;; + -opened*) + os=-openedition + ;; + -os400*) + os=-os400 + ;; + -wince*) + os=-wince + ;; + -osfrose*) + os=-osfrose + ;; + -osf*) + os=-osf + ;; + -utek*) + os=-bsd + ;; + -dynix*) + os=-bsd + ;; + -acis*) + os=-aos + ;; + -atheos*) + os=-atheos + ;; + -syllable*) + os=-syllable + ;; + -386bsd) + os=-bsd + ;; + -ctix* | -uts*) + os=-sysv + ;; + -nova*) + os=-rtmk-nova + ;; + -ns2 ) + os=-nextstep2 + ;; + -nsk*) + os=-nsk + ;; + # Preserve the version number of sinix5. + -sinix5.*) + os=`echo $os | sed -e 's|sinix|sysv|'` + ;; + -sinix*) + os=-sysv4 + ;; + -tpf*) + os=-tpf + ;; + -triton*) + os=-sysv3 + ;; + -oss*) + os=-sysv3 + ;; + -svr4) + os=-sysv4 + ;; + -svr3) + os=-sysv3 + ;; + -sysvr4) + os=-sysv4 + ;; + # This must come after -sysvr4. + -sysv*) + ;; + -ose*) + os=-ose + ;; + -es1800*) + os=-ose + ;; + -xenix) + os=-xenix + ;; + -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) + os=-mint + ;; + -aros*) + os=-aros + ;; + -kaos*) + os=-kaos + ;; + -zvmoe) + os=-zvmoe + ;; + -none) + ;; + *) + # Get rid of the `-' at the beginning of $os. + os=`echo $os | sed 's/[^-]*-//'` + echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2 + exit 1 + ;; +esac +else + +# Here we handle the default operating systems that come with various machines. +# The value should be what the vendor currently ships out the door with their +# machine or put another way, the most popular os provided with the machine. + +# Note that if you're going to try to match "-MANUFACTURER" here (say, +# "-sun"), then you have to tell the case statement up towards the top +# that MANUFACTURER isn't an operating system. Otherwise, code above +# will signal an error saying that MANUFACTURER isn't an operating +# system, and we'll never get to this point. + +case $basic_machine in + *-acorn) + os=-riscix1.2 + ;; + arm*-rebel) + os=-linux + ;; + arm*-semi) + os=-aout + ;; + c4x-* | tic4x-*) + os=-coff + ;; + # This must come before the *-dec entry. + pdp10-*) + os=-tops20 + ;; + pdp11-*) + os=-none + ;; + *-dec | vax-*) + os=-ultrix4.2 + ;; + m68*-apollo) + os=-domain + ;; + i386-sun) + os=-sunos4.0.2 + ;; + m68000-sun) + os=-sunos3 + # This also exists in the configure program, but was not the + # default. + # os=-sunos4 + ;; + m68*-cisco) + os=-aout + ;; + mips*-cisco) + os=-elf + ;; + mips*-*) + os=-elf + ;; + or32-*) + os=-coff + ;; + *-tti) # must be before sparc entry or we get the wrong os. + os=-sysv3 + ;; + sparc-* | *-sun) + os=-sunos4.1.1 + ;; + *-be) + os=-beos + ;; + *-haiku) + os=-haiku + ;; + *-ibm) + os=-aix + ;; + *-knuth) + os=-mmixware + ;; + *-wec) + os=-proelf + ;; + *-winbond) + os=-proelf + ;; + *-oki) + os=-proelf + ;; + *-hp) + os=-hpux + ;; + *-hitachi) + os=-hiux + ;; + i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) + os=-sysv + ;; + *-cbm) + os=-amigaos + ;; + *-dg) + os=-dgux + ;; + *-dolphin) + os=-sysv3 + ;; + m68k-ccur) + os=-rtu + ;; + m88k-omron*) + os=-luna + ;; + *-next ) + os=-nextstep + ;; + *-sequent) + os=-ptx + ;; + *-crds) + os=-unos + ;; + *-ns) + os=-genix + ;; + i370-*) + os=-mvs + ;; + *-next) + os=-nextstep3 + ;; + *-gould) + os=-sysv + ;; + *-highlevel) + os=-bsd + ;; + *-encore) + os=-bsd + ;; + *-sgi) + os=-irix + ;; + *-siemens) + os=-sysv4 + ;; + *-masscomp) + os=-rtu + ;; + f30[01]-fujitsu | f700-fujitsu) + os=-uxpv + ;; + *-rom68k) + os=-coff + ;; + *-*bug) + os=-coff + ;; + *-apple) + os=-macos + ;; + *-atari*) + os=-mint + ;; + *) + os=-none + ;; +esac +fi + +# Here we handle the case where we know the os, and the CPU type, but not the +# manufacturer. We pick the logical manufacturer. +vendor=unknown +case $basic_machine in + *-unknown) + case $os in + -riscix*) + vendor=acorn + ;; + -sunos*) + vendor=sun + ;; + -aix*) + vendor=ibm + ;; + -beos*) + vendor=be + ;; + -hpux*) + vendor=hp + ;; + -mpeix*) + vendor=hp + ;; + -hiux*) + vendor=hitachi + ;; + -unos*) + vendor=crds + ;; + -dgux*) + vendor=dg + ;; + -luna*) + vendor=omron + ;; + -genix*) + vendor=ns + ;; + -mvs* | -opened*) + vendor=ibm + ;; + -os400*) + vendor=ibm + ;; + -ptx*) + vendor=sequent + ;; + -tpf*) + vendor=ibm + ;; + -vxsim* | -vxworks* | -windiss*) + vendor=wrs + ;; + -aux*) + vendor=apple + ;; + -hms*) + vendor=hitachi + ;; + -mpw* | -macos*) + vendor=apple + ;; + -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) + vendor=atari + ;; + -vos*) + vendor=stratus + ;; + esac + basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"` + ;; +esac + +echo $basic_machine$os +exit + +# Local variables: +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "timestamp='" +# time-stamp-format: "%:y-%02m-%02d" +# time-stamp-end: "'" +# End: diff --git a/app/twm/configure b/app/twm/configure new file mode 100644 index 000000000..94c3f35ae --- /dev/null +++ b/app/twm/configure @@ -0,0 +1,5155 @@ +#! /bin/sh +# Guess values for system-dependent variables and create Makefiles. +# Generated by GNU Autoconf 2.59 for twm 1.0.2. +# +# Report bugs to . +# +# Copyright (C) 2003 Free Software Foundation, Inc. +# This configure script is free software; the Free Software Foundation +# gives unlimited permission to copy, distribute and modify it. +## --------------------- ## +## M4sh Initialization. ## +## --------------------- ## + +# Be Bourne compatible +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then + emulate sh + NULLCMD=: + # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' +elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then + set -o posix +fi +DUALCASE=1; export DUALCASE # for MKS sh + +# Support unset when possible. +if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then + as_unset=unset +else + as_unset=false +fi + + +# Work around bugs in pre-3.0 UWIN ksh. +$as_unset ENV MAIL MAILPATH +PS1='$ ' +PS2='> ' +PS4='+ ' + +# NLS nuisances. +for as_var in \ + LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ + LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ + LC_TELEPHONE LC_TIME +do + if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then + eval $as_var=C; export $as_var + else + $as_unset $as_var + fi +done + +# Required to use basename. +if expr a : '\(a\)' >/dev/null 2>&1; then + as_expr=expr +else + as_expr=false +fi + +if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then + as_basename=basename +else + as_basename=false +fi + + +# Name of the executable. +as_me=`$as_basename "$0" || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)$' \| \ + . : '\(.\)' 2>/dev/null || +echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; } + /^X\/\(\/\/\)$/{ s//\1/; q; } + /^X\/\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + + +# PATH needs CR, and LINENO needs CR and PATH. +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + echo "#! /bin/sh" >conf$$.sh + echo "exit 0" >>conf$$.sh + chmod +x conf$$.sh + if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then + PATH_SEPARATOR=';' + else + PATH_SEPARATOR=: + fi + rm -f conf$$.sh +fi + + + as_lineno_1=$LINENO + as_lineno_2=$LINENO + as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` + test "x$as_lineno_1" != "x$as_lineno_2" && + test "x$as_lineno_3" = "x$as_lineno_2" || { + # Find who we are. Look in the path if we contain no path at all + # relative or not. + case $0 in + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break +done + + ;; + esac + # We did not find ourselves, most probably we were run as `sh COMMAND' + # in which case we are not to be found in the path. + if test "x$as_myself" = x; then + as_myself=$0 + fi + if test ! -f "$as_myself"; then + { echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2 + { (exit 1); exit 1; }; } + fi + case $CONFIG_SHELL in + '') + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for as_base in sh bash ksh sh5; do + case $as_dir in + /*) + if ("$as_dir/$as_base" -c ' + as_lineno_1=$LINENO + as_lineno_2=$LINENO + as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` + test "x$as_lineno_1" != "x$as_lineno_2" && + test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then + $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; } + $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; } + CONFIG_SHELL=$as_dir/$as_base + export CONFIG_SHELL + exec "$CONFIG_SHELL" "$0" ${1+"$@"} + fi;; + esac + done +done +;; + esac + + # Create $as_me.lineno as a copy of $as_myself, but with $LINENO + # uniformly replaced by the line number. The first 'sed' inserts a + # line-number line before each line; the second 'sed' does the real + # work. The second script uses 'N' to pair each line-number line + # with the numbered line, and appends trailing '-' during + # substitution so that $LINENO is not a special case at line end. + # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the + # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-) + sed '=' <$as_myself | + sed ' + N + s,$,-, + : loop + s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3, + t loop + s,-$,, + s,^['$as_cr_digits']*\n,, + ' >$as_me.lineno && + chmod +x $as_me.lineno || + { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 + { (exit 1); exit 1; }; } + + # Don't try to exec as it changes $[0], causing all sort of problems + # (the dirname of $[0] is not the place where we might find the + # original and so on. Autoconf is especially sensible to this). + . ./$as_me.lineno + # Exit status is that of the last command. + exit +} + + +case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in + *c*,-n*) ECHO_N= ECHO_C=' +' ECHO_T=' ' ;; + *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; + *) ECHO_N= ECHO_C='\c' ECHO_T= ;; +esac + +if expr a : '\(a\)' >/dev/null 2>&1; then + as_expr=expr +else + as_expr=false +fi + +rm -f conf$$ conf$$.exe conf$$.file +echo >conf$$.file +if ln -s conf$$.file conf$$ 2>/dev/null; then + # We could just check for DJGPP; but this test a) works b) is more generic + # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). + if test -f conf$$.exe; then + # Don't use ln at all; we don't have any links + as_ln_s='cp -p' + else + as_ln_s='ln -s' + fi +elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln +else + as_ln_s='cp -p' +fi +rm -f conf$$ conf$$.exe conf$$.file + +if mkdir -p . 2>/dev/null; then + as_mkdir_p=: +else + test -d ./-p && rmdir ./-p + as_mkdir_p=false +fi + +as_executable_p="test -f" + +# Sed expression to map a string onto a valid CPP name. +as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" + +# Sed expression to map a string onto a valid variable name. +as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" + + +# IFS +# We need space, tab and new line, in precisely that order. +as_nl=' +' +IFS=" $as_nl" + +# CDPATH. +$as_unset CDPATH + + +# Name of the host. +# hostname on some systems (SVR3.2, Linux) returns a bogus exit status, +# so uname gets run too. +ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` + +exec 6>&1 + +# +# Initializations. +# +ac_default_prefix=/usr/local +ac_config_libobj_dir=. +cross_compiling=no +subdirs= +MFLAGS= +MAKEFLAGS= +SHELL=${CONFIG_SHELL-/bin/sh} + +# Maximum number of lines to put in a shell here document. +# This variable seems obsolete. It should probably be removed, and +# only ac_max_sed_lines should be used. +: ${ac_max_here_lines=38} + +# Identity of this package. +PACKAGE_NAME='twm' +PACKAGE_TARNAME='twm' +PACKAGE_VERSION='1.0.2' +PACKAGE_STRING='twm 1.0.2' +PACKAGE_BUGREPORT='https://bugs.freedesktop.org/enter_bug.cgi?product=xorg' + +ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CYGPATH_W PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO install_sh STRIP ac_ct_STRIP INSTALL_STRIP_PROGRAM mkdir_p AWK SET_MAKE am__leading_dot AMTAR am__tar am__untar MAINTAINER_MODE_TRUE MAINTAINER_MODE_FALSE MAINT CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT DEPDIR am__include am__quote AMDEP_TRUE AMDEP_FALSE AMDEPBACKSLASH CCDEPMODE am__fastdepCC_TRUE am__fastdepCC_FALSE YACC LEX LEXLIB LEX_OUTPUT_ROOT PKG_CONFIG ac_pt_PKG_CONFIG TWM_CFLAGS TWM_LIBS build build_cpu build_vendor build_os host host_cpu host_vendor host_os APP_MAN_SUFFIX LIB_MAN_SUFFIX FILE_MAN_SUFFIX MISC_MAN_SUFFIX DRIVER_MAN_SUFFIX ADMIN_MAN_SUFFIX APP_MAN_DIR LIB_MAN_DIR FILE_MAN_DIR MISC_MAN_DIR DRIVER_MAN_DIR ADMIN_MAN_DIR LIBOBJS LTLIBOBJS' +ac_subst_files='' + +# Initialize some variables set by options. +ac_init_help= +ac_init_version=false +# The variables have the same names as the options, with +# dashes changed to underlines. +cache_file=/dev/null +exec_prefix=NONE +no_create= +no_recursion= +prefix=NONE +program_prefix=NONE +program_suffix=NONE +program_transform_name=s,x,x, +silent= +site= +srcdir= +verbose= +x_includes=NONE +x_libraries=NONE + +# Installation directory options. +# These are left unexpanded so users can "make install exec_prefix=/foo" +# and all the variables that are supposed to be based on exec_prefix +# by default will actually change. +# Use braces instead of parens because sh, perl, etc. also accept them. +bindir='${exec_prefix}/bin' +sbindir='${exec_prefix}/sbin' +libexecdir='${exec_prefix}/libexec' +datadir='${prefix}/share' +sysconfdir='${prefix}/etc' +sharedstatedir='${prefix}/com' +localstatedir='${prefix}/var' +libdir='${exec_prefix}/lib' +includedir='${prefix}/include' +oldincludedir='/usr/include' +infodir='${prefix}/info' +mandir='${prefix}/man' + +ac_prev= +for ac_option +do + # If the previous option needs an argument, assign it. + if test -n "$ac_prev"; then + eval "$ac_prev=\$ac_option" + ac_prev= + continue + fi + + ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'` + + # Accept the important Cygnus configure options, so we can diagnose typos. + + case $ac_option in + + -bindir | --bindir | --bindi | --bind | --bin | --bi) + ac_prev=bindir ;; + -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) + bindir=$ac_optarg ;; + + -build | --build | --buil | --bui | --bu) + ac_prev=build_alias ;; + -build=* | --build=* | --buil=* | --bui=* | --bu=*) + build_alias=$ac_optarg ;; + + -cache-file | --cache-file | --cache-fil | --cache-fi \ + | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) + ac_prev=cache_file ;; + -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ + | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) + cache_file=$ac_optarg ;; + + --config-cache | -C) + cache_file=config.cache ;; + + -datadir | --datadir | --datadi | --datad | --data | --dat | --da) + ac_prev=datadir ;; + -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \ + | --da=*) + datadir=$ac_optarg ;; + + -disable-* | --disable-*) + ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid feature name: $ac_feature" >&2 + { (exit 1); exit 1; }; } + ac_feature=`echo $ac_feature | sed 's/-/_/g'` + eval "enable_$ac_feature=no" ;; + + -enable-* | --enable-*) + ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid feature name: $ac_feature" >&2 + { (exit 1); exit 1; }; } + ac_feature=`echo $ac_feature | sed 's/-/_/g'` + case $ac_option in + *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; + *) ac_optarg=yes ;; + esac + eval "enable_$ac_feature='$ac_optarg'" ;; + + -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ + | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ + | --exec | --exe | --ex) + ac_prev=exec_prefix ;; + -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ + | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ + | --exec=* | --exe=* | --ex=*) + exec_prefix=$ac_optarg ;; + + -gas | --gas | --ga | --g) + # Obsolete; use --with-gas. + with_gas=yes ;; + + -help | --help | --hel | --he | -h) + ac_init_help=long ;; + -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) + ac_init_help=recursive ;; + -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) + ac_init_help=short ;; + + -host | --host | --hos | --ho) + ac_prev=host_alias ;; + -host=* | --host=* | --hos=* | --ho=*) + host_alias=$ac_optarg ;; + + -includedir | --includedir | --includedi | --included | --include \ + | --includ | --inclu | --incl | --inc) + ac_prev=includedir ;; + -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ + | --includ=* | --inclu=* | --incl=* | --inc=*) + includedir=$ac_optarg ;; + + -infodir | --infodir | --infodi | --infod | --info | --inf) + ac_prev=infodir ;; + -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) + infodir=$ac_optarg ;; + + -libdir | --libdir | --libdi | --libd) + ac_prev=libdir ;; + -libdir=* | --libdir=* | --libdi=* | --libd=*) + libdir=$ac_optarg ;; + + -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ + | --libexe | --libex | --libe) + ac_prev=libexecdir ;; + -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ + | --libexe=* | --libex=* | --libe=*) + libexecdir=$ac_optarg ;; + + -localstatedir | --localstatedir | --localstatedi | --localstated \ + | --localstate | --localstat | --localsta | --localst \ + | --locals | --local | --loca | --loc | --lo) + ac_prev=localstatedir ;; + -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ + | --localstate=* | --localstat=* | --localsta=* | --localst=* \ + | --locals=* | --local=* | --loca=* | --loc=* | --lo=*) + localstatedir=$ac_optarg ;; + + -mandir | --mandir | --mandi | --mand | --man | --ma | --m) + ac_prev=mandir ;; + -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) + mandir=$ac_optarg ;; + + -nfp | --nfp | --nf) + # Obsolete; use --without-fp. + with_fp=no ;; + + -no-create | --no-create | --no-creat | --no-crea | --no-cre \ + | --no-cr | --no-c | -n) + no_create=yes ;; + + -no-recursion | --no-recursion | --no-recursio | --no-recursi \ + | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) + no_recursion=yes ;; + + -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ + | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ + | --oldin | --oldi | --old | --ol | --o) + ac_prev=oldincludedir ;; + -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ + | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ + | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) + oldincludedir=$ac_optarg ;; + + -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) + ac_prev=prefix ;; + -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) + prefix=$ac_optarg ;; + + -program-prefix | --program-prefix | --program-prefi | --program-pref \ + | --program-pre | --program-pr | --program-p) + ac_prev=program_prefix ;; + -program-prefix=* | --program-prefix=* | --program-prefi=* \ + | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) + program_prefix=$ac_optarg ;; + + -program-suffix | --program-suffix | --program-suffi | --program-suff \ + | --program-suf | --program-su | --program-s) + ac_prev=program_suffix ;; + -program-suffix=* | --program-suffix=* | --program-suffi=* \ + | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) + program_suffix=$ac_optarg ;; + + -program-transform-name | --program-transform-name \ + | --program-transform-nam | --program-transform-na \ + | --program-transform-n | --program-transform- \ + | --program-transform | --program-transfor \ + | --program-transfo | --program-transf \ + | --program-trans | --program-tran \ + | --progr-tra | --program-tr | --program-t) + ac_prev=program_transform_name ;; + -program-transform-name=* | --program-transform-name=* \ + | --program-transform-nam=* | --program-transform-na=* \ + | --program-transform-n=* | --program-transform-=* \ + | --program-transform=* | --program-transfor=* \ + | --program-transfo=* | --program-transf=* \ + | --program-trans=* | --program-tran=* \ + | --progr-tra=* | --program-tr=* | --program-t=*) + program_transform_name=$ac_optarg ;; + + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + silent=yes ;; + + -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) + ac_prev=sbindir ;; + -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ + | --sbi=* | --sb=*) + sbindir=$ac_optarg ;; + + -sharedstatedir | --sharedstatedir | --sharedstatedi \ + | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ + | --sharedst | --shareds | --shared | --share | --shar \ + | --sha | --sh) + ac_prev=sharedstatedir ;; + -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ + | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ + | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ + | --sha=* | --sh=*) + sharedstatedir=$ac_optarg ;; + + -site | --site | --sit) + ac_prev=site ;; + -site=* | --site=* | --sit=*) + site=$ac_optarg ;; + + -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) + ac_prev=srcdir ;; + -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) + srcdir=$ac_optarg ;; + + -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ + | --syscon | --sysco | --sysc | --sys | --sy) + ac_prev=sysconfdir ;; + -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ + | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) + sysconfdir=$ac_optarg ;; + + -target | --target | --targe | --targ | --tar | --ta | --t) + ac_prev=target_alias ;; + -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) + target_alias=$ac_optarg ;; + + -v | -verbose | --verbose | --verbos | --verbo | --verb) + verbose=yes ;; + + -version | --version | --versio | --versi | --vers | -V) + ac_init_version=: ;; + + -with-* | --with-*) + ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid package name: $ac_package" >&2 + { (exit 1); exit 1; }; } + ac_package=`echo $ac_package| sed 's/-/_/g'` + case $ac_option in + *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; + *) ac_optarg=yes ;; + esac + eval "with_$ac_package='$ac_optarg'" ;; + + -without-* | --without-*) + ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid package name: $ac_package" >&2 + { (exit 1); exit 1; }; } + ac_package=`echo $ac_package | sed 's/-/_/g'` + eval "with_$ac_package=no" ;; + + --x) + # Obsolete; use --with-x. + with_x=yes ;; + + -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ + | --x-incl | --x-inc | --x-in | --x-i) + ac_prev=x_includes ;; + -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ + | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) + x_includes=$ac_optarg ;; + + -x-libraries | --x-libraries | --x-librarie | --x-librari \ + | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) + ac_prev=x_libraries ;; + -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ + | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) + x_libraries=$ac_optarg ;; + + -*) { echo "$as_me: error: unrecognized option: $ac_option +Try \`$0 --help' for more information." >&2 + { (exit 1); exit 1; }; } + ;; + + *=*) + ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` + # Reject names that are not valid shell variable names. + expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid variable name: $ac_envvar" >&2 + { (exit 1); exit 1; }; } + ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` + eval "$ac_envvar='$ac_optarg'" + export $ac_envvar ;; + + *) + # FIXME: should be removed in autoconf 3.0. + echo "$as_me: WARNING: you should use --build, --host, --target" >&2 + expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && + echo "$as_me: WARNING: invalid host type: $ac_option" >&2 + : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option} + ;; + + esac +done + +if test -n "$ac_prev"; then + ac_option=--`echo $ac_prev | sed 's/_/-/g'` + { echo "$as_me: error: missing argument to $ac_option" >&2 + { (exit 1); exit 1; }; } +fi + +# Be sure to have absolute paths. +for ac_var in exec_prefix prefix +do + eval ac_val=$`echo $ac_var` + case $ac_val in + [\\/$]* | ?:[\\/]* | NONE | '' ) ;; + *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 + { (exit 1); exit 1; }; };; + esac +done + +# Be sure to have absolute paths. +for ac_var in bindir sbindir libexecdir datadir sysconfdir sharedstatedir \ + localstatedir libdir includedir oldincludedir infodir mandir +do + eval ac_val=$`echo $ac_var` + case $ac_val in + [\\/$]* | ?:[\\/]* ) ;; + *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 + { (exit 1); exit 1; }; };; + esac +done + +# There might be people who depend on the old broken behavior: `$host' +# used to hold the argument of --host etc. +# FIXME: To remove some day. +build=$build_alias +host=$host_alias +target=$target_alias + +# FIXME: To remove some day. +if test "x$host_alias" != x; then + if test "x$build_alias" = x; then + cross_compiling=maybe + echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host. + If a cross compiler is detected then cross compile mode will be used." >&2 + elif test "x$build_alias" != "x$host_alias"; then + cross_compiling=yes + fi +fi + +ac_tool_prefix= +test -n "$host_alias" && ac_tool_prefix=$host_alias- + +test "$silent" = yes && exec 6>/dev/null + + +# Find the source files, if location was not specified. +if test -z "$srcdir"; then + ac_srcdir_defaulted=yes + # Try the directory containing this script, then its parent. + ac_confdir=`(dirname "$0") 2>/dev/null || +$as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$0" : 'X\(//\)[^/]' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$0" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + srcdir=$ac_confdir + if test ! -r $srcdir/$ac_unique_file; then + srcdir=.. + fi +else + ac_srcdir_defaulted=no +fi +if test ! -r $srcdir/$ac_unique_file; then + if test "$ac_srcdir_defaulted" = yes; then + { echo "$as_me: error: cannot find sources ($ac_unique_file) in $ac_confdir or .." >&2 + { (exit 1); exit 1; }; } + else + { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 + { (exit 1); exit 1; }; } + fi +fi +(cd $srcdir && test -r ./$ac_unique_file) 2>/dev/null || + { echo "$as_me: error: sources are in $srcdir, but \`cd $srcdir' does not work" >&2 + { (exit 1); exit 1; }; } +srcdir=`echo "$srcdir" | sed 's%\([^\\/]\)[\\/]*$%\1%'` +ac_env_build_alias_set=${build_alias+set} +ac_env_build_alias_value=$build_alias +ac_cv_env_build_alias_set=${build_alias+set} +ac_cv_env_build_alias_value=$build_alias +ac_env_host_alias_set=${host_alias+set} +ac_env_host_alias_value=$host_alias +ac_cv_env_host_alias_set=${host_alias+set} +ac_cv_env_host_alias_value=$host_alias +ac_env_target_alias_set=${target_alias+set} +ac_env_target_alias_value=$target_alias +ac_cv_env_target_alias_set=${target_alias+set} +ac_cv_env_target_alias_value=$target_alias +ac_env_CC_set=${CC+set} +ac_env_CC_value=$CC +ac_cv_env_CC_set=${CC+set} +ac_cv_env_CC_value=$CC +ac_env_CFLAGS_set=${CFLAGS+set} +ac_env_CFLAGS_value=$CFLAGS +ac_cv_env_CFLAGS_set=${CFLAGS+set} +ac_cv_env_CFLAGS_value=$CFLAGS +ac_env_LDFLAGS_set=${LDFLAGS+set} +ac_env_LDFLAGS_value=$LDFLAGS +ac_cv_env_LDFLAGS_set=${LDFLAGS+set} +ac_cv_env_LDFLAGS_value=$LDFLAGS +ac_env_CPPFLAGS_set=${CPPFLAGS+set} +ac_env_CPPFLAGS_value=$CPPFLAGS +ac_cv_env_CPPFLAGS_set=${CPPFLAGS+set} +ac_cv_env_CPPFLAGS_value=$CPPFLAGS +ac_env_PKG_CONFIG_set=${PKG_CONFIG+set} +ac_env_PKG_CONFIG_value=$PKG_CONFIG +ac_cv_env_PKG_CONFIG_set=${PKG_CONFIG+set} +ac_cv_env_PKG_CONFIG_value=$PKG_CONFIG +ac_env_TWM_CFLAGS_set=${TWM_CFLAGS+set} +ac_env_TWM_CFLAGS_value=$TWM_CFLAGS +ac_cv_env_TWM_CFLAGS_set=${TWM_CFLAGS+set} +ac_cv_env_TWM_CFLAGS_value=$TWM_CFLAGS +ac_env_TWM_LIBS_set=${TWM_LIBS+set} +ac_env_TWM_LIBS_value=$TWM_LIBS +ac_cv_env_TWM_LIBS_set=${TWM_LIBS+set} +ac_cv_env_TWM_LIBS_value=$TWM_LIBS + +# +# Report the --help message. +# +if test "$ac_init_help" = "long"; then + # Omit some internal or obsolete options to make the list less imposing. + # This message is too long to be a string in the A/UX 3.1 sh. + cat <<_ACEOF +\`configure' configures twm 1.0.2 to adapt to many kinds of systems. + +Usage: $0 [OPTION]... [VAR=VALUE]... + +To assign environment variables (e.g., CC, CFLAGS...), specify them as +VAR=VALUE. See below for descriptions of some of the useful variables. + +Defaults for the options are specified in brackets. + +Configuration: + -h, --help display this help and exit + --help=short display options specific to this package + --help=recursive display the short help of all the included packages + -V, --version display version information and exit + -q, --quiet, --silent do not print \`checking...' messages + --cache-file=FILE cache test results in FILE [disabled] + -C, --config-cache alias for \`--cache-file=config.cache' + -n, --no-create do not create output files + --srcdir=DIR find the sources in DIR [configure dir or \`..'] + +_ACEOF + + cat <<_ACEOF +Installation directories: + --prefix=PREFIX install architecture-independent files in PREFIX + [$ac_default_prefix] + --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX + [PREFIX] + +By default, \`make install' will install all the files in +\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify +an installation prefix other than \`$ac_default_prefix' using \`--prefix', +for instance \`--prefix=\$HOME'. + +For better control, use the options below. + +Fine tuning of the installation directories: + --bindir=DIR user executables [EPREFIX/bin] + --sbindir=DIR system admin executables [EPREFIX/sbin] + --libexecdir=DIR program executables [EPREFIX/libexec] + --datadir=DIR read-only architecture-independent data [PREFIX/share] + --sysconfdir=DIR read-only single-machine data [PREFIX/etc] + --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] + --localstatedir=DIR modifiable single-machine data [PREFIX/var] + --libdir=DIR object code libraries [EPREFIX/lib] + --includedir=DIR C header files [PREFIX/include] + --oldincludedir=DIR C header files for non-gcc [/usr/include] + --infodir=DIR info documentation [PREFIX/info] + --mandir=DIR man documentation [PREFIX/man] +_ACEOF + + cat <<\_ACEOF + +Program names: + --program-prefix=PREFIX prepend PREFIX to installed program names + --program-suffix=SUFFIX append SUFFIX to installed program names + --program-transform-name=PROGRAM run sed PROGRAM on installed program names + +System types: + --build=BUILD configure for building on BUILD [guessed] + --host=HOST cross-compile to build programs to run on HOST [BUILD] +_ACEOF +fi + +if test -n "$ac_init_help"; then + case $ac_init_help in + short | recursive ) echo "Configuration of twm 1.0.2:";; + esac + cat <<\_ACEOF + +Optional Features: + --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) + --enable-FEATURE[=ARG] include FEATURE [ARG=yes] + --enable-maintainer-mode enable make rules and dependencies not useful + (and sometimes confusing) to the casual installer + --disable-dependency-tracking speeds up one-time build + --enable-dependency-tracking do not reject slow dependency extractors + +Optional Packages: + --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] + --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) + --with-release-version=STRING + Use release version string in package name + +Some influential environment variables: + CC C compiler command + CFLAGS C compiler flags + LDFLAGS linker flags, e.g. -L if you have libraries in a + nonstandard directory + CPPFLAGS C/C++ preprocessor flags, e.g. -I if you have + headers in a nonstandard directory + PKG_CONFIG path to pkg-config utility + TWM_CFLAGS C compiler flags for TWM, overriding pkg-config + TWM_LIBS linker flags for TWM, overriding pkg-config + +Use these variables to override the choices made by `configure' or to help +it to find libraries and programs with nonstandard names/locations. + +Report bugs to . +_ACEOF +fi + +if test "$ac_init_help" = "recursive"; then + # If there are subdirs, report their specific --help. + ac_popdir=`pwd` + for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue + test -d $ac_dir || continue + ac_builddir=. + +if test "$ac_dir" != .; then + ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` + # A "../" for each directory in $ac_dir_suffix. + ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` +else + ac_dir_suffix= ac_top_builddir= +fi + +case $srcdir in + .) # No --srcdir option. We are building in place. + ac_srcdir=. + if test -z "$ac_top_builddir"; then + ac_top_srcdir=. + else + ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` + fi ;; + [\\/]* | ?:[\\/]* ) # Absolute path. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir ;; + *) # Relative path. + ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_builddir$srcdir ;; +esac + +# Do not use `cd foo && pwd` to compute absolute paths, because +# the directories may not exist. +case `pwd` in +.) ac_abs_builddir="$ac_dir";; +*) + case "$ac_dir" in + .) ac_abs_builddir=`pwd`;; + [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";; + *) ac_abs_builddir=`pwd`/"$ac_dir";; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_top_builddir=${ac_top_builddir}.;; +*) + case ${ac_top_builddir}. in + .) ac_abs_top_builddir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;; + *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_srcdir=$ac_srcdir;; +*) + case $ac_srcdir in + .) ac_abs_srcdir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;; + *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_top_srcdir=$ac_top_srcdir;; +*) + case $ac_top_srcdir in + .) ac_abs_top_srcdir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;; + *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;; + esac;; +esac + + cd $ac_dir + # Check for guested configure; otherwise get Cygnus style configure. + if test -f $ac_srcdir/configure.gnu; then + echo + $SHELL $ac_srcdir/configure.gnu --help=recursive + elif test -f $ac_srcdir/configure; then + echo + $SHELL $ac_srcdir/configure --help=recursive + elif test -f $ac_srcdir/configure.ac || + test -f $ac_srcdir/configure.in; then + echo + $ac_configure --help + else + echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 + fi + cd $ac_popdir + done +fi + +test -n "$ac_init_help" && exit 0 +if $ac_init_version; then + cat <<\_ACEOF +twm configure 1.0.2 +generated by GNU Autoconf 2.59 + +Copyright (C) 2003 Free Software Foundation, Inc. +This configure script is free software; the Free Software Foundation +gives unlimited permission to copy, distribute and modify it. +_ACEOF + exit 0 +fi +exec 5>config.log +cat >&5 <<_ACEOF +This file contains any messages produced by compilers while +running configure, to aid debugging if configure makes a mistake. + +It was created by twm $as_me 1.0.2, which was +generated by GNU Autoconf 2.59. Invocation command line was + + $ $0 $@ + +_ACEOF +{ +cat <<_ASUNAME +## --------- ## +## Platform. ## +## --------- ## + +hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` +uname -m = `(uname -m) 2>/dev/null || echo unknown` +uname -r = `(uname -r) 2>/dev/null || echo unknown` +uname -s = `(uname -s) 2>/dev/null || echo unknown` +uname -v = `(uname -v) 2>/dev/null || echo unknown` + +/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` +/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` + +/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` +/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` +/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` +hostinfo = `(hostinfo) 2>/dev/null || echo unknown` +/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` +/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` +/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` + +_ASUNAME + +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + echo "PATH: $as_dir" +done + +} >&5 + +cat >&5 <<_ACEOF + + +## ----------- ## +## Core tests. ## +## ----------- ## + +_ACEOF + + +# Keep a trace of the command line. +# Strip out --no-create and --no-recursion so they do not pile up. +# Strip out --silent because we don't want to record it for future runs. +# Also quote any args containing shell meta-characters. +# Make two passes to allow for proper duplicate-argument suppression. +ac_configure_args= +ac_configure_args0= +ac_configure_args1= +ac_sep= +ac_must_keep_next=false +for ac_pass in 1 2 +do + for ac_arg + do + case $ac_arg in + -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + continue ;; + *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*) + ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + case $ac_pass in + 1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;; + 2) + ac_configure_args1="$ac_configure_args1 '$ac_arg'" + if test $ac_must_keep_next = true; then + ac_must_keep_next=false # Got value, back to normal. + else + case $ac_arg in + *=* | --config-cache | -C | -disable-* | --disable-* \ + | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ + | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ + | -with-* | --with-* | -without-* | --without-* | --x) + case "$ac_configure_args0 " in + "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; + esac + ;; + -* ) ac_must_keep_next=true ;; + esac + fi + ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'" + # Get rid of the leading space. + ac_sep=" " + ;; + esac + done +done +$as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; } +$as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export ac_configure_args1; } + +# When interrupted or exit'd, cleanup temporary files, and complete +# config.log. We remove comments because anyway the quotes in there +# would cause problems or look ugly. +# WARNING: Be sure not to use single quotes in there, as some shells, +# such as our DU 5.0 friend, will then `close' the trap. +trap 'exit_status=$? + # Save into config.log some information that might help in debugging. + { + echo + + cat <<\_ASBOX +## ---------------- ## +## Cache variables. ## +## ---------------- ## +_ASBOX + echo + # The following way of writing the cache mishandles newlines in values, +{ + (set) 2>&1 | + case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in + *ac_space=\ *) + sed -n \ + "s/'"'"'/'"'"'\\\\'"'"''"'"'/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p" + ;; + *) + sed -n \ + "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" + ;; + esac; +} + echo + + cat <<\_ASBOX +## ----------------- ## +## Output variables. ## +## ----------------- ## +_ASBOX + echo + for ac_var in $ac_subst_vars + do + eval ac_val=$`echo $ac_var` + echo "$ac_var='"'"'$ac_val'"'"'" + done | sort + echo + + if test -n "$ac_subst_files"; then + cat <<\_ASBOX +## ------------- ## +## Output files. ## +## ------------- ## +_ASBOX + echo + for ac_var in $ac_subst_files + do + eval ac_val=$`echo $ac_var` + echo "$ac_var='"'"'$ac_val'"'"'" + done | sort + echo + fi + + if test -s confdefs.h; then + cat <<\_ASBOX +## ----------- ## +## confdefs.h. ## +## ----------- ## +_ASBOX + echo + sed "/^$/d" confdefs.h | sort + echo + fi + test "$ac_signal" != 0 && + echo "$as_me: caught signal $ac_signal" + echo "$as_me: exit $exit_status" + } >&5 + rm -f core *.core && + rm -rf conftest* confdefs* conf$$* $ac_clean_files && + exit $exit_status + ' 0 +for ac_signal in 1 2 13 15; do + trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal +done +ac_signal=0 + +# confdefs.h avoids OS command line length limits that DEFS can exceed. +rm -rf conftest* confdefs.h +# AIX cpp loses on an empty file, so make sure it contains at least a newline. +echo >confdefs.h + +# Predefined preprocessor variables. + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_NAME "$PACKAGE_NAME" +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_TARNAME "$PACKAGE_TARNAME" +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_VERSION "$PACKAGE_VERSION" +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_STRING "$PACKAGE_STRING" +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" +_ACEOF + + +# Let the site file select an alternate cache file if it wants to. +# Prefer explicitly selected file to automatically selected ones. +if test -z "$CONFIG_SITE"; then + if test "x$prefix" != xNONE; then + CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" + else + CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" + fi +fi +for ac_site_file in $CONFIG_SITE; do + if test -r "$ac_site_file"; then + { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5 +echo "$as_me: loading site script $ac_site_file" >&6;} + sed 's/^/| /' "$ac_site_file" >&5 + . "$ac_site_file" + fi +done + +if test -r "$cache_file"; then + # Some versions of bash will fail to source /dev/null (special + # files actually), so we avoid doing that. + if test -f "$cache_file"; then + { echo "$as_me:$LINENO: loading cache $cache_file" >&5 +echo "$as_me: loading cache $cache_file" >&6;} + case $cache_file in + [\\/]* | ?:[\\/]* ) . $cache_file;; + *) . ./$cache_file;; + esac + fi +else + { echo "$as_me:$LINENO: creating cache $cache_file" >&5 +echo "$as_me: creating cache $cache_file" >&6;} + >$cache_file +fi + +# Check that the precious variables saved in the cache have kept the same +# value. +ac_cache_corrupted=false +for ac_var in `(set) 2>&1 | + sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do + eval ac_old_set=\$ac_cv_env_${ac_var}_set + eval ac_new_set=\$ac_env_${ac_var}_set + eval ac_old_val="\$ac_cv_env_${ac_var}_value" + eval ac_new_val="\$ac_env_${ac_var}_value" + case $ac_old_set,$ac_new_set in + set,) + { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 +echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,set) + { echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5 +echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,);; + *) + if test "x$ac_old_val" != "x$ac_new_val"; then + { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5 +echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} + { echo "$as_me:$LINENO: former value: $ac_old_val" >&5 +echo "$as_me: former value: $ac_old_val" >&2;} + { echo "$as_me:$LINENO: current value: $ac_new_val" >&5 +echo "$as_me: current value: $ac_new_val" >&2;} + ac_cache_corrupted=: + fi;; + esac + # Pass precious variables to config.status. + if test "$ac_new_set" = set; then + case $ac_new_val in + *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*) + ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; + *) ac_arg=$ac_var=$ac_new_val ;; + esac + case " $ac_configure_args " in + *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. + *) ac_configure_args="$ac_configure_args '$ac_arg'" ;; + esac + fi +done +if $ac_cache_corrupted; then + { echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5 +echo "$as_me: error: changes in the environment can compromise the build" >&2;} + { { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5 +echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;} + { (exit 1); exit 1; }; } +fi + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + + + + + + + + + + + + + + + + + + + + + + + + + + +am__api_version="1.9" +ac_aux_dir= +for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do + if test -f $ac_dir/install-sh; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install-sh -c" + break + elif test -f $ac_dir/install.sh; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install.sh -c" + break + elif test -f $ac_dir/shtool; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/shtool install -c" + break + fi +done +if test -z "$ac_aux_dir"; then + { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&5 +echo "$as_me: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&2;} + { (exit 1); exit 1; }; } +fi +ac_config_guess="$SHELL $ac_aux_dir/config.guess" +ac_config_sub="$SHELL $ac_aux_dir/config.sub" +ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure. + +# Find a good install program. We prefer a C program (faster), +# so one script is as good as another. But avoid the broken or +# incompatible versions: +# SysV /etc/install, /usr/sbin/install +# SunOS /usr/etc/install +# IRIX /sbin/install +# AIX /bin/install +# AmigaOS /C/install, which installs bootblocks on floppy discs +# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag +# AFS /usr/afsws/bin/install, which mishandles nonexistent args +# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" +# OS/2's system install, which has a completely different semantic +# ./install, which can be erroneously created by make from ./install.sh. +echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5 +echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6 +if test -z "$INSTALL"; then +if test "${ac_cv_path_install+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + # Account for people who put trailing slashes in PATH elements. +case $as_dir/ in + ./ | .// | /cC/* | \ + /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ + ?:\\/os2\\/install\\/* | ?:\\/OS2\\/INSTALL\\/* | \ + /usr/ucb/* ) ;; + *) + # OSF1 and SCO ODT 3.0 have their own names for install. + # Don't use installbsd from OSF since it installs stuff as root + # by default. + for ac_prog in ginstall scoinst install; do + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then + if test $ac_prog = install && + grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + # AIX install. It has an incompatible calling convention. + : + elif test $ac_prog = install && + grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + # program-specific install script used by HP pwplus--don't use. + : + else + ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" + break 3 + fi + fi + done + done + ;; +esac +done + + +fi + if test "${ac_cv_path_install+set}" = set; then + INSTALL=$ac_cv_path_install + else + # As a last resort, use the slow shell script. We don't cache a + # path for INSTALL within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the path is relative. + INSTALL=$ac_install_sh + fi +fi +echo "$as_me:$LINENO: result: $INSTALL" >&5 +echo "${ECHO_T}$INSTALL" >&6 + +# Use test -z because SunOS4 sh mishandles braces in ${var-val}. +# It thinks the first close brace ends the variable substitution. +test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' + +test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' + +test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' + +echo "$as_me:$LINENO: checking whether build environment is sane" >&5 +echo $ECHO_N "checking whether build environment is sane... $ECHO_C" >&6 +# Just in case +sleep 1 +echo timestamp > conftest.file +# Do `set' in a subshell so we don't clobber the current shell's +# arguments. Must try -L first in case configure is actually a +# symlink; some systems play weird games with the mod time of symlinks +# (eg FreeBSD returns the mod time of the symlink's containing +# directory). +if ( + set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null` + if test "$*" = "X"; then + # -L didn't work. + set X `ls -t $srcdir/configure conftest.file` + fi + rm -f conftest.file + if test "$*" != "X $srcdir/configure conftest.file" \ + && test "$*" != "X conftest.file $srcdir/configure"; then + + # If neither matched, then we have a broken ls. This can happen + # if, for instance, CONFIG_SHELL is bash and it inherits a + # broken ls alias from the environment. This has actually + # happened. Such a system could not be considered "sane". + { { echo "$as_me:$LINENO: error: ls -t appears to fail. Make sure there is not a broken +alias in your environment" >&5 +echo "$as_me: error: ls -t appears to fail. Make sure there is not a broken +alias in your environment" >&2;} + { (exit 1); exit 1; }; } + fi + + test "$2" = conftest.file + ) +then + # Ok. + : +else + { { echo "$as_me:$LINENO: error: newly created file is older than distributed files! +Check your system clock" >&5 +echo "$as_me: error: newly created file is older than distributed files! +Check your system clock" >&2;} + { (exit 1); exit 1; }; } +fi +echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 +test "$program_prefix" != NONE && + program_transform_name="s,^,$program_prefix,;$program_transform_name" +# Use a double $ so make ignores it. +test "$program_suffix" != NONE && + program_transform_name="s,\$,$program_suffix,;$program_transform_name" +# Double any \ or $. echo might interpret backslashes. +# By default was `s,x,x', remove it if useless. +cat <<\_ACEOF >conftest.sed +s/[\\$]/&&/g;s/;s,x,x,$// +_ACEOF +program_transform_name=`echo $program_transform_name | sed -f conftest.sed` +rm conftest.sed + +# expand $ac_aux_dir to an absolute path +am_aux_dir=`cd $ac_aux_dir && pwd` + +test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing" +# Use eval to expand $SHELL +if eval "$MISSING --run true"; then + am_missing_run="$MISSING --run " +else + am_missing_run= + { echo "$as_me:$LINENO: WARNING: \`missing' script is too old or missing" >&5 +echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;} +fi + +if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then + # We used to keeping the `.' as first argument, in order to + # allow $(mkdir_p) to be used without argument. As in + # $(mkdir_p) $(somedir) + # where $(somedir) is conditionally defined. However this is wrong + # for two reasons: + # 1. if the package is installed by a user who cannot write `.' + # make install will fail, + # 2. the above comment should most certainly read + # $(mkdir_p) $(DESTDIR)$(somedir) + # so it does not work when $(somedir) is undefined and + # $(DESTDIR) is not. + # To support the latter case, we have to write + # test -z "$(somedir)" || $(mkdir_p) $(DESTDIR)$(somedir), + # so the `.' trick is pointless. + mkdir_p='mkdir -p --' +else + # On NextStep and OpenStep, the `mkdir' command does not + # recognize any option. It will interpret all options as + # directories to create, and then abort because `.' already + # exists. + for d in ./-p ./--version; + do + test -d $d && rmdir $d + done + # $(mkinstalldirs) is defined by Automake if mkinstalldirs exists. + if test -f "$ac_aux_dir/mkinstalldirs"; then + mkdir_p='$(mkinstalldirs)' + else + mkdir_p='$(install_sh) -d' + fi +fi + +for ac_prog in gawk mawk nawk awk +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_AWK+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$AWK"; then + ac_cv_prog_AWK="$AWK" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_AWK="$ac_prog" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +AWK=$ac_cv_prog_AWK +if test -n "$AWK"; then + echo "$as_me:$LINENO: result: $AWK" >&5 +echo "${ECHO_T}$AWK" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + test -n "$AWK" && break +done + +echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5 +echo $ECHO_N "checking whether ${MAKE-make} sets \$(MAKE)... $ECHO_C" >&6 +set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,:./+-,___p_,'` +if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.make <<\_ACEOF +all: + @echo 'ac_maketemp="$(MAKE)"' +_ACEOF +# GNU make sometimes prints "make[1]: Entering...", which would confuse us. +eval `${MAKE-make} -f conftest.make 2>/dev/null | grep temp=` +if test -n "$ac_maketemp"; then + eval ac_cv_prog_make_${ac_make}_set=yes +else + eval ac_cv_prog_make_${ac_make}_set=no +fi +rm -f conftest.make +fi +if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 + SET_MAKE= +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 + SET_MAKE="MAKE=${MAKE-make}" +fi + +rm -rf .tst 2>/dev/null +mkdir .tst 2>/dev/null +if test -d .tst; then + am__leading_dot=. +else + am__leading_dot=_ +fi +rmdir .tst 2>/dev/null + +# test to see if srcdir already configured +if test "`cd $srcdir && pwd`" != "`pwd`" && + test -f $srcdir/config.status; then + { { echo "$as_me:$LINENO: error: source directory already configured; run \"make distclean\" there first" >&5 +echo "$as_me: error: source directory already configured; run \"make distclean\" there first" >&2;} + { (exit 1); exit 1; }; } +fi + +# test whether we have cygpath +if test -z "$CYGPATH_W"; then + if (cygpath --version) >/dev/null 2>/dev/null; then + CYGPATH_W='cygpath -w' + else + CYGPATH_W=echo + fi +fi + + +# Define the identity of the package. + PACKAGE='twm' + VERSION='1.0.2' + + +cat >>confdefs.h <<_ACEOF +#define PACKAGE "$PACKAGE" +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define VERSION "$VERSION" +_ACEOF + +# Some tools Automake needs. + +ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"} + + +AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"} + + +AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"} + + +AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"} + + +MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} + +install_sh=${install_sh-"$am_aux_dir/install-sh"} + +# Installed binaries are usually stripped using `strip' when the user +# run `make install-strip'. However `strip' might not be the right +# tool to use in cross-compilation environments, therefore Automake +# will honor the `STRIP' environment variable to overrule this program. +if test "$cross_compiling" != no; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. +set dummy ${ac_tool_prefix}strip; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_STRIP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$STRIP"; then + ac_cv_prog_STRIP="$STRIP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_STRIP="${ac_tool_prefix}strip" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +STRIP=$ac_cv_prog_STRIP +if test -n "$STRIP"; then + echo "$as_me:$LINENO: result: $STRIP" >&5 +echo "${ECHO_T}$STRIP" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + +fi +if test -z "$ac_cv_prog_STRIP"; then + ac_ct_STRIP=$STRIP + # Extract the first word of "strip", so it can be a program name with args. +set dummy strip; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_STRIP"; then + ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_STRIP="strip" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + + test -z "$ac_cv_prog_ac_ct_STRIP" && ac_cv_prog_ac_ct_STRIP=":" +fi +fi +ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP +if test -n "$ac_ct_STRIP"; then + echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5 +echo "${ECHO_T}$ac_ct_STRIP" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + STRIP=$ac_ct_STRIP +else + STRIP="$ac_cv_prog_STRIP" +fi + +fi +INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s" + +# We need awk for the "check" target. The system "awk" is bad on +# some platforms. +# Always define AMTAR for backward compatibility. + +AMTAR=${AMTAR-"${am_missing_run}tar"} + +am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -' + + + + + +echo "$as_me:$LINENO: checking whether to enable maintainer-specific portions of Makefiles" >&5 +echo $ECHO_N "checking whether to enable maintainer-specific portions of Makefiles... $ECHO_C" >&6 + # Check whether --enable-maintainer-mode or --disable-maintainer-mode was given. +if test "${enable_maintainer_mode+set}" = set; then + enableval="$enable_maintainer_mode" + USE_MAINTAINER_MODE=$enableval +else + USE_MAINTAINER_MODE=no +fi; + echo "$as_me:$LINENO: result: $USE_MAINTAINER_MODE" >&5 +echo "${ECHO_T}$USE_MAINTAINER_MODE" >&6 + + +if test $USE_MAINTAINER_MODE = yes; then + MAINTAINER_MODE_TRUE= + MAINTAINER_MODE_FALSE='#' +else + MAINTAINER_MODE_TRUE='#' + MAINTAINER_MODE_FALSE= +fi + + MAINT=$MAINTAINER_MODE_TRUE + + + + ac_config_headers="$ac_config_headers config.h" + + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. +set dummy ${ac_tool_prefix}gcc; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="${ac_tool_prefix}gcc" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + +fi +if test -z "$ac_cv_prog_CC"; then + ac_ct_CC=$CC + # Extract the first word of "gcc", so it can be a program name with args. +set dummy gcc; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_ac_ct_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CC="gcc" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 +echo "${ECHO_T}$ac_ct_CC" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + CC=$ac_ct_CC +else + CC="$ac_cv_prog_CC" +fi + +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. +set dummy ${ac_tool_prefix}cc; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="${ac_tool_prefix}cc" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + +fi +if test -z "$ac_cv_prog_CC"; then + ac_ct_CC=$CC + # Extract the first word of "cc", so it can be a program name with args. +set dummy cc; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_ac_ct_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CC="cc" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 +echo "${ECHO_T}$ac_ct_CC" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + CC=$ac_ct_CC +else + CC="$ac_cv_prog_CC" +fi + +fi +if test -z "$CC"; then + # Extract the first word of "cc", so it can be a program name with args. +set dummy cc; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + ac_prog_rejected=no +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then + ac_prog_rejected=yes + continue + fi + ac_cv_prog_CC="cc" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +if test $ac_prog_rejected = yes; then + # We found a bogon in the path, so make sure we never use it. + set dummy $ac_cv_prog_CC + shift + if test $# != 0; then + # We chose a different compiler from the bogus one. + # However, it has the same basename, so the bogon will be chosen + # first if we set CC to just the basename; use the full file name. + shift + ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" + fi +fi +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + +fi +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + for ac_prog in cl + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="$ac_tool_prefix$ac_prog" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + test -n "$CC" && break + done +fi +if test -z "$CC"; then + ac_ct_CC=$CC + for ac_prog in cl +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_ac_ct_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CC="$ac_prog" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 +echo "${ECHO_T}$ac_ct_CC" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + test -n "$ac_ct_CC" && break +done + + CC=$ac_ct_CC +fi + +fi + + +test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH +See \`config.log' for more details." >&5 +echo "$as_me: error: no acceptable C compiler found in \$PATH +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } + +# Provide some information about the compiler. +echo "$as_me:$LINENO:" \ + "checking for C compiler version" >&5 +ac_compiler=`set X $ac_compile; echo $2` +{ (eval echo "$as_me:$LINENO: \"$ac_compiler --version &5\"") >&5 + (eval $ac_compiler --version &5) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } +{ (eval echo "$as_me:$LINENO: \"$ac_compiler -v &5\"") >&5 + (eval $ac_compiler -v &5) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } +{ (eval echo "$as_me:$LINENO: \"$ac_compiler -V &5\"") >&5 + (eval $ac_compiler -V &5) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } + +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +ac_clean_files_save=$ac_clean_files +ac_clean_files="$ac_clean_files a.out a.exe b.out" +# Try to create an executable without -o first, disregard a.out. +# It will help us diagnose broken compilers, and finding out an intuition +# of exeext. +echo "$as_me:$LINENO: checking for C compiler default output file name" >&5 +echo $ECHO_N "checking for C compiler default output file name... $ECHO_C" >&6 +ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` +if { (eval echo "$as_me:$LINENO: \"$ac_link_default\"") >&5 + (eval $ac_link_default) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + # Find the output, starting from the most likely. This scheme is +# not robust to junk in `.', hence go to wildcards (a.*) only as a last +# resort. + +# Be careful to initialize this variable, since it used to be cached. +# Otherwise an old cache value of `no' led to `EXEEXT = no' in a Makefile. +ac_cv_exeext= +# b.out is created by i960 compilers. +for ac_file in a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out +do + test -f "$ac_file" || continue + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) + ;; + conftest.$ac_ext ) + # This is the source file. + ;; + [ab].out ) + # We found the default executable, but exeext='' is most + # certainly right. + break;; + *.* ) + ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + # FIXME: I believe we export ac_cv_exeext for Libtool, + # but it would be cool to find out if it's true. Does anybody + # maintain Libtool? --akim. + export ac_cv_exeext + break;; + * ) + break;; + esac +done +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +{ { echo "$as_me:$LINENO: error: C compiler cannot create executables +See \`config.log' for more details." >&5 +echo "$as_me: error: C compiler cannot create executables +See \`config.log' for more details." >&2;} + { (exit 77); exit 77; }; } +fi + +ac_exeext=$ac_cv_exeext +echo "$as_me:$LINENO: result: $ac_file" >&5 +echo "${ECHO_T}$ac_file" >&6 + +# Check the compiler produces executables we can run. If not, either +# the compiler is broken, or we cross compile. +echo "$as_me:$LINENO: checking whether the C compiler works" >&5 +echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6 +# FIXME: These cross compiler hacks should be removed for Autoconf 3.0 +# If not cross compiling, check that we can run a simple program. +if test "$cross_compiling" != yes; then + if { ac_try='./$ac_file' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + cross_compiling=no + else + if test "$cross_compiling" = maybe; then + cross_compiling=yes + else + { { echo "$as_me:$LINENO: error: cannot run C compiled programs. +If you meant to cross compile, use \`--host'. +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot run C compiled programs. +If you meant to cross compile, use \`--host'. +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } + fi + fi +fi +echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 + +rm -f a.out a.exe conftest$ac_cv_exeext b.out +ac_clean_files=$ac_clean_files_save +# Check the compiler produces executables we can run. If not, either +# the compiler is broken, or we cross compile. +echo "$as_me:$LINENO: checking whether we are cross compiling" >&5 +echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6 +echo "$as_me:$LINENO: result: $cross_compiling" >&5 +echo "${ECHO_T}$cross_compiling" >&6 + +echo "$as_me:$LINENO: checking for suffix of executables" >&5 +echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6 +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + # If both `conftest.exe' and `conftest' are `present' (well, observable) +# catch `conftest.exe'. For instance with Cygwin, `ls conftest' will +# work properly (i.e., refer to `conftest.exe'), while it won't with +# `rm'. +for ac_file in conftest.exe conftest conftest.*; do + test -f "$ac_file" || continue + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) ;; + *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + export ac_cv_exeext + break;; + * ) break;; + esac +done +else + { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot compute suffix of executables: cannot compile and link +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } +fi + +rm -f conftest$ac_cv_exeext +echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5 +echo "${ECHO_T}$ac_cv_exeext" >&6 + +rm -f conftest.$ac_ext +EXEEXT=$ac_cv_exeext +ac_exeext=$EXEEXT +echo "$as_me:$LINENO: checking for suffix of object files" >&5 +echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6 +if test "${ac_cv_objext+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.o conftest.obj +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg ) ;; + *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` + break;; + esac +done +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +{ { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot compute suffix of object files: cannot compile +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } +fi + +rm -f conftest.$ac_cv_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_objext" >&5 +echo "${ECHO_T}$ac_cv_objext" >&6 +OBJEXT=$ac_cv_objext +ac_objext=$OBJEXT +echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 +echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6 +if test "${ac_cv_c_compiler_gnu+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ +#ifndef __GNUC__ + choke me +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_compiler_gnu=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_compiler_gnu=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +ac_cv_c_compiler_gnu=$ac_compiler_gnu + +fi +echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 +echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6 +GCC=`test $ac_compiler_gnu = yes && echo yes` +ac_test_CFLAGS=${CFLAGS+set} +ac_save_CFLAGS=$CFLAGS +CFLAGS="-g" +echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 +echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6 +if test "${ac_cv_prog_cc_g+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_prog_cc_g=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_prog_cc_g=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 +echo "${ECHO_T}$ac_cv_prog_cc_g" >&6 +if test "$ac_test_CFLAGS" = set; then + CFLAGS=$ac_save_CFLAGS +elif test $ac_cv_prog_cc_g = yes; then + if test "$GCC" = yes; then + CFLAGS="-g -O2" + else + CFLAGS="-g" + fi +else + if test "$GCC" = yes; then + CFLAGS="-O2" + else + CFLAGS= + fi +fi +echo "$as_me:$LINENO: checking for $CC option to accept ANSI C" >&5 +echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6 +if test "${ac_cv_prog_cc_stdc+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_prog_cc_stdc=no +ac_save_CC=$CC +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +#include +#include +#include +/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ +struct buf { int x; }; +FILE * (*rcsopen) (struct buf *, struct stat *, int); +static char *e (p, i) + char **p; + int i; +{ + return p[i]; +} +static char *f (char * (*g) (char **, int), char **p, ...) +{ + char *s; + va_list v; + va_start (v,p); + s = g (p, va_arg (v,int)); + va_end (v); + return s; +} + +/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has + function prototypes and stuff, but not '\xHH' hex character constants. + These don't provoke an error unfortunately, instead are silently treated + as 'x'. The following induces an error, until -std1 is added to get + proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an + array size at least. It's necessary to write '\x00'==0 to get something + that's true only with -std1. */ +int osf4_cc_array ['\x00' == 0 ? 1 : -1]; + +int test (int i, double x); +struct s1 {int (*f) (int a);}; +struct s2 {int (*f) (double a);}; +int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); +int argc; +char **argv; +int +main () +{ +return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; + ; + return 0; +} +_ACEOF +# Don't try gcc -ansi; that turns off useful extensions and +# breaks some systems' header files. +# AIX -qlanglvl=ansi +# Ultrix and OSF/1 -std1 +# HP-UX 10.20 and later -Ae +# HP-UX older versions -Aa -D_HPUX_SOURCE +# SVR4 -Xc -D__EXTENSIONS__ +for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" +do + CC="$ac_save_CC $ac_arg" + rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_prog_cc_stdc=$ac_arg +break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.err conftest.$ac_objext +done +rm -f conftest.$ac_ext conftest.$ac_objext +CC=$ac_save_CC + +fi + +case "x$ac_cv_prog_cc_stdc" in + x|xno) + echo "$as_me:$LINENO: result: none needed" >&5 +echo "${ECHO_T}none needed" >&6 ;; + *) + echo "$as_me:$LINENO: result: $ac_cv_prog_cc_stdc" >&5 +echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6 + CC="$CC $ac_cv_prog_cc_stdc" ;; +esac + +# Some people use a C++ compiler to compile C. Since we use `exit', +# in C++ we need to declare it. In case someone uses the same compiler +# for both compiling C and C++ we need to have the C++ compiler decide +# the declaration of exit, since it's the most demanding environment. +cat >conftest.$ac_ext <<_ACEOF +#ifndef __cplusplus + choke me +#endif +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + for ac_declaration in \ + '' \ + 'extern "C" void std::exit (int) throw (); using std::exit;' \ + 'extern "C" void std::exit (int); using std::exit;' \ + 'extern "C" void exit (int) throw ();' \ + 'extern "C" void exit (int);' \ + 'void exit (int);' +do + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_declaration +#include +int +main () +{ +exit (42); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + : +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +continue +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_declaration +int +main () +{ +exit (42); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +done +rm -f conftest* +if test -n "$ac_declaration"; then + echo '#ifdef __cplusplus' >>confdefs.h + echo $ac_declaration >>confdefs.h + echo '#endif' >>confdefs.h +fi + +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +DEPDIR="${am__leading_dot}deps" + + ac_config_commands="$ac_config_commands depfiles" + + +am_make=${MAKE-make} +cat > confinc << 'END' +am__doit: + @echo done +.PHONY: am__doit +END +# If we don't find an include directive, just comment out the code. +echo "$as_me:$LINENO: checking for style of include used by $am_make" >&5 +echo $ECHO_N "checking for style of include used by $am_make... $ECHO_C" >&6 +am__include="#" +am__quote= +_am_result=none +# First try GNU make style include. +echo "include confinc" > confmf +# We grep out `Entering directory' and `Leaving directory' +# messages which can occur if `w' ends up in MAKEFLAGS. +# In particular we don't look at `^make:' because GNU make might +# be invoked under some other name (usually "gmake"), in which +# case it prints its new name instead of `make'. +if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then + am__include=include + am__quote= + _am_result=GNU +fi +# Now try BSD make style include. +if test "$am__include" = "#"; then + echo '.include "confinc"' > confmf + if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then + am__include=.include + am__quote="\"" + _am_result=BSD + fi +fi + + +echo "$as_me:$LINENO: result: $_am_result" >&5 +echo "${ECHO_T}$_am_result" >&6 +rm -f confinc confmf + +# Check whether --enable-dependency-tracking or --disable-dependency-tracking was given. +if test "${enable_dependency_tracking+set}" = set; then + enableval="$enable_dependency_tracking" + +fi; +if test "x$enable_dependency_tracking" != xno; then + am_depcomp="$ac_aux_dir/depcomp" + AMDEPBACKSLASH='\' +fi + + +if test "x$enable_dependency_tracking" != xno; then + AMDEP_TRUE= + AMDEP_FALSE='#' +else + AMDEP_TRUE='#' + AMDEP_FALSE= +fi + + + + +depcc="$CC" am_compiler_list= + +echo "$as_me:$LINENO: checking dependency style of $depcc" >&5 +echo $ECHO_N "checking dependency style of $depcc... $ECHO_C" >&6 +if test "${am_cv_CC_dependencies_compiler_type+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then + # We make a subdir and do the tests there. Otherwise we can end up + # making bogus files that we don't know about and never remove. For + # instance it was reported that on HP-UX the gcc test will end up + # making a dummy file named `D' -- because `-MD' means `put the output + # in D'. + mkdir conftest.dir + # Copy depcomp to subdir because otherwise we won't find it if we're + # using a relative directory. + cp "$am_depcomp" conftest.dir + cd conftest.dir + # We will build objects and dependencies in a subdirectory because + # it helps to detect inapplicable dependency modes. For instance + # both Tru64's cc and ICC support -MD to output dependencies as a + # side effect of compilation, but ICC will put the dependencies in + # the current directory while Tru64 will put them in the object + # directory. + mkdir sub + + am_cv_CC_dependencies_compiler_type=none + if test "$am_compiler_list" = ""; then + am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` + fi + for depmode in $am_compiler_list; do + # Setup a source with many dependencies, because some compilers + # like to wrap large dependency lists on column 80 (with \), and + # we should not choose a depcomp mode which is confused by this. + # + # We need to recreate these files for each test, as the compiler may + # overwrite some of them when testing with obscure command lines. + # This happens at least with the AIX C compiler. + : > sub/conftest.c + for i in 1 2 3 4 5 6; do + echo '#include "conftst'$i'.h"' >> sub/conftest.c + # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with + # Solaris 8's {/usr,}/bin/sh. + touch sub/conftst$i.h + done + echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf + + case $depmode in + nosideeffect) + # after this tag, mechanisms are not by side-effect, so they'll + # only be used when explicitly requested + if test "x$enable_dependency_tracking" = xyes; then + continue + else + break + fi + ;; + none) break ;; + esac + # We check with `-c' and `-o' for the sake of the "dashmstdout" + # mode. It turns out that the SunPro C++ compiler does not properly + # handle `-M -o', and we need to detect this. + if depmode=$depmode \ + source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \ + depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ + $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \ + >/dev/null 2>conftest.err && + grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && + grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 && + ${MAKE-make} -s -f confmf > /dev/null 2>&1; then + # icc doesn't choke on unknown options, it will just issue warnings + # or remarks (even with -Werror). So we grep stderr for any message + # that says an option was ignored or not supported. + # When given -MP, icc 7.0 and 7.1 complain thusly: + # icc: Command line warning: ignoring option '-M'; no argument required + # The diagnosis changed in icc 8.0: + # icc: Command line remark: option '-MP' not supported + if (grep 'ignoring option' conftest.err || + grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else + am_cv_CC_dependencies_compiler_type=$depmode + break + fi + fi + done + + cd .. + rm -rf conftest.dir +else + am_cv_CC_dependencies_compiler_type=none +fi + +fi +echo "$as_me:$LINENO: result: $am_cv_CC_dependencies_compiler_type" >&5 +echo "${ECHO_T}$am_cv_CC_dependencies_compiler_type" >&6 +CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type + + + +if + test "x$enable_dependency_tracking" != xno \ + && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then + am__fastdepCC_TRUE= + am__fastdepCC_FALSE='#' +else + am__fastdepCC_TRUE='#' + am__fastdepCC_FALSE= +fi + + +# Find a good install program. We prefer a C program (faster), +# so one script is as good as another. But avoid the broken or +# incompatible versions: +# SysV /etc/install, /usr/sbin/install +# SunOS /usr/etc/install +# IRIX /sbin/install +# AIX /bin/install +# AmigaOS /C/install, which installs bootblocks on floppy discs +# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag +# AFS /usr/afsws/bin/install, which mishandles nonexistent args +# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" +# OS/2's system install, which has a completely different semantic +# ./install, which can be erroneously created by make from ./install.sh. +echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5 +echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6 +if test -z "$INSTALL"; then +if test "${ac_cv_path_install+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + # Account for people who put trailing slashes in PATH elements. +case $as_dir/ in + ./ | .// | /cC/* | \ + /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ + ?:\\/os2\\/install\\/* | ?:\\/OS2\\/INSTALL\\/* | \ + /usr/ucb/* ) ;; + *) + # OSF1 and SCO ODT 3.0 have their own names for install. + # Don't use installbsd from OSF since it installs stuff as root + # by default. + for ac_prog in ginstall scoinst install; do + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then + if test $ac_prog = install && + grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + # AIX install. It has an incompatible calling convention. + : + elif test $ac_prog = install && + grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + # program-specific install script used by HP pwplus--don't use. + : + else + ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" + break 3 + fi + fi + done + done + ;; +esac +done + + +fi + if test "${ac_cv_path_install+set}" = set; then + INSTALL=$ac_cv_path_install + else + # As a last resort, use the slow shell script. We don't cache a + # path for INSTALL within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the path is relative. + INSTALL=$ac_install_sh + fi +fi +echo "$as_me:$LINENO: result: $INSTALL" >&5 +echo "${ECHO_T}$INSTALL" >&6 + +# Use test -z because SunOS4 sh mishandles braces in ${var-val}. +# It thinks the first close brace ends the variable substitution. +test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' + +test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' + +test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' + +for ac_prog in 'bison -y' byacc +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_YACC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$YACC"; then + ac_cv_prog_YACC="$YACC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_YACC="$ac_prog" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +YACC=$ac_cv_prog_YACC +if test -n "$YACC"; then + echo "$as_me:$LINENO: result: $YACC" >&5 +echo "${ECHO_T}$YACC" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + test -n "$YACC" && break +done +test -n "$YACC" || YACC="yacc" + + +for ac_prog in flex lex +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_LEX+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$LEX"; then + ac_cv_prog_LEX="$LEX" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_LEX="$ac_prog" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +LEX=$ac_cv_prog_LEX +if test -n "$LEX"; then + echo "$as_me:$LINENO: result: $LEX" >&5 +echo "${ECHO_T}$LEX" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + test -n "$LEX" && break +done +test -n "$LEX" || LEX=":" + +if test -z "$LEXLIB" +then + echo "$as_me:$LINENO: checking for yywrap in -lfl" >&5 +echo $ECHO_N "checking for yywrap in -lfl... $ECHO_C" >&6 +if test "${ac_cv_lib_fl_yywrap+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lfl $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char yywrap (); +int +main () +{ +yywrap (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_fl_yywrap=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_fl_yywrap=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_lib_fl_yywrap" >&5 +echo "${ECHO_T}$ac_cv_lib_fl_yywrap" >&6 +if test $ac_cv_lib_fl_yywrap = yes; then + LEXLIB="-lfl" +else + echo "$as_me:$LINENO: checking for yywrap in -ll" >&5 +echo $ECHO_N "checking for yywrap in -ll... $ECHO_C" >&6 +if test "${ac_cv_lib_l_yywrap+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ll $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char yywrap (); +int +main () +{ +yywrap (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_l_yywrap=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_l_yywrap=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_lib_l_yywrap" >&5 +echo "${ECHO_T}$ac_cv_lib_l_yywrap" >&6 +if test $ac_cv_lib_l_yywrap = yes; then + LEXLIB="-ll" +fi + +fi + +fi + +if test "x$LEX" != "x:"; then + echo "$as_me:$LINENO: checking lex output file root" >&5 +echo $ECHO_N "checking lex output file root... $ECHO_C" >&6 +if test "${ac_cv_prog_lex_root+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + # The minimal lex program is just a single line: %%. But some broken lexes +# (Solaris, I think it was) want two %% lines, so accommodate them. +cat >conftest.l <<_ACEOF +%% +%% +_ACEOF +{ (eval echo "$as_me:$LINENO: \"$LEX conftest.l\"") >&5 + (eval $LEX conftest.l) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } +if test -f lex.yy.c; then + ac_cv_prog_lex_root=lex.yy +elif test -f lexyy.c; then + ac_cv_prog_lex_root=lexyy +else + { { echo "$as_me:$LINENO: error: cannot find output from $LEX; giving up" >&5 +echo "$as_me: error: cannot find output from $LEX; giving up" >&2;} + { (exit 1); exit 1; }; } +fi +fi +echo "$as_me:$LINENO: result: $ac_cv_prog_lex_root" >&5 +echo "${ECHO_T}$ac_cv_prog_lex_root" >&6 +rm -f conftest.l +LEX_OUTPUT_ROOT=$ac_cv_prog_lex_root + +echo "$as_me:$LINENO: checking whether yytext is a pointer" >&5 +echo $ECHO_N "checking whether yytext is a pointer... $ECHO_C" >&6 +if test "${ac_cv_prog_lex_yytext_pointer+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + # POSIX says lex can declare yytext either as a pointer or an array; the +# default is implementation-dependent. Figure out which it is, since +# not all implementations provide the %pointer and %array declarations. +ac_cv_prog_lex_yytext_pointer=no +echo 'extern char *yytext;' >>$LEX_OUTPUT_ROOT.c +ac_save_LIBS=$LIBS +LIBS="$LIBS $LEXLIB" +cat >conftest.$ac_ext <<_ACEOF +`cat $LEX_OUTPUT_ROOT.c` +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_prog_lex_yytext_pointer=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_save_LIBS +rm -f "${LEX_OUTPUT_ROOT}.c" + +fi +echo "$as_me:$LINENO: result: $ac_cv_prog_lex_yytext_pointer" >&5 +echo "${ECHO_T}$ac_cv_prog_lex_yytext_pointer" >&6 +if test $ac_cv_prog_lex_yytext_pointer = yes; then + +cat >>confdefs.h <<\_ACEOF +#define YYTEXT_POINTER 1 +_ACEOF + +fi + +fi + +echo "$as_me:$LINENO: checking for mkstemp" >&5 +echo $ECHO_N "checking for mkstemp... $ECHO_C" >&6 +if test "${ac_cv_func_mkstemp+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +/* Define mkstemp to an innocuous variant, in case declares mkstemp. + For example, HP-UX 11i declares gettimeofday. */ +#define mkstemp innocuous_mkstemp + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char mkstemp (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef mkstemp + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +{ +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char mkstemp (); +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_mkstemp) || defined (__stub___mkstemp) +choke me +#else +char (*f) () = mkstemp; +#endif +#ifdef __cplusplus +} +#endif + +int +main () +{ +return f != mkstemp; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_func_mkstemp=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_func_mkstemp=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_func_mkstemp" >&5 +echo "${ECHO_T}$ac_cv_func_mkstemp" >&6 +if test $ac_cv_func_mkstemp = yes; then + +cat >>confdefs.h <<\_ACEOF +#define HAS_MKSTEMP 1 +_ACEOF + +fi + + +# Checks for pkg-config packages + + +if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args. +set dummy ${ac_tool_prefix}pkg-config; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_path_PKG_CONFIG+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + case $PKG_CONFIG in + [\\/]* | ?:[\\/]*) + ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + + ;; +esac +fi +PKG_CONFIG=$ac_cv_path_PKG_CONFIG + +if test -n "$PKG_CONFIG"; then + echo "$as_me:$LINENO: result: $PKG_CONFIG" >&5 +echo "${ECHO_T}$PKG_CONFIG" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + +fi +if test -z "$ac_cv_path_PKG_CONFIG"; then + ac_pt_PKG_CONFIG=$PKG_CONFIG + # Extract the first word of "pkg-config", so it can be a program name with args. +set dummy pkg-config; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_path_ac_pt_PKG_CONFIG+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + case $ac_pt_PKG_CONFIG in + [\\/]* | ?:[\\/]*) + ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_ac_pt_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + + ;; +esac +fi +ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG + +if test -n "$ac_pt_PKG_CONFIG"; then + echo "$as_me:$LINENO: result: $ac_pt_PKG_CONFIG" >&5 +echo "${ECHO_T}$ac_pt_PKG_CONFIG" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + PKG_CONFIG=$ac_pt_PKG_CONFIG +else + PKG_CONFIG="$ac_cv_path_PKG_CONFIG" +fi + +fi +if test -n "$PKG_CONFIG"; then + _pkg_min_version=0.9.0 + echo "$as_me:$LINENO: checking pkg-config is at least version $_pkg_min_version" >&5 +echo $ECHO_N "checking pkg-config is at least version $_pkg_min_version... $ECHO_C" >&6 + if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 + else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 + PKG_CONFIG="" + fi + +fi + +pkg_failed=no +echo "$as_me:$LINENO: checking for TWM" >&5 +echo $ECHO_N "checking for TWM... $ECHO_C" >&6 + +if test -n "$PKG_CONFIG"; then + if test -n "$TWM_CFLAGS"; then + pkg_cv_TWM_CFLAGS="$TWM_CFLAGS" + else + if test -n "$PKG_CONFIG" && \ + { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"x11 xext xt xmu\"") >&5 + ($PKG_CONFIG --exists --print-errors "x11 xext xt xmu") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + pkg_cv_TWM_CFLAGS=`$PKG_CONFIG --cflags "x11 xext xt xmu" 2>/dev/null` +else + pkg_failed=yes +fi + fi +else + pkg_failed=untried +fi +if test -n "$PKG_CONFIG"; then + if test -n "$TWM_LIBS"; then + pkg_cv_TWM_LIBS="$TWM_LIBS" + else + if test -n "$PKG_CONFIG" && \ + { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"x11 xext xt xmu\"") >&5 + ($PKG_CONFIG --exists --print-errors "x11 xext xt xmu") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + pkg_cv_TWM_LIBS=`$PKG_CONFIG --libs "x11 xext xt xmu" 2>/dev/null` +else + pkg_failed=yes +fi + fi +else + pkg_failed=untried +fi + + + +if test $pkg_failed = yes; then + +if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then + _pkg_short_errors_supported=yes +else + _pkg_short_errors_supported=no +fi + if test $_pkg_short_errors_supported = yes; then + TWM_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "x11 xext xt xmu"` + else + TWM_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "x11 xext xt xmu"` + fi + # Put the nasty error message in config.log where it belongs + echo "$TWM_PKG_ERRORS" >&5 + + { { echo "$as_me:$LINENO: error: Package requirements (x11 xext xt xmu) were not met: + +$TWM_PKG_ERRORS + +Consider adjusting the PKG_CONFIG_PATH environment variable if you +installed software in a non-standard prefix. + +Alternatively, you may set the environment variables TWM_CFLAGS +and TWM_LIBS to avoid the need to call pkg-config. +See the pkg-config man page for more details. +" >&5 +echo "$as_me: error: Package requirements (x11 xext xt xmu) were not met: + +$TWM_PKG_ERRORS + +Consider adjusting the PKG_CONFIG_PATH environment variable if you +installed software in a non-standard prefix. + +Alternatively, you may set the environment variables TWM_CFLAGS +and TWM_LIBS to avoid the need to call pkg-config. +See the pkg-config man page for more details. +" >&2;} + { (exit 1); exit 1; }; } +elif test $pkg_failed = untried; then + { { echo "$as_me:$LINENO: error: The pkg-config script could not be found or is too old. Make sure it +is in your PATH or set the PKG_CONFIG environment variable to the full +path to pkg-config. + +Alternatively, you may set the environment variables TWM_CFLAGS +and TWM_LIBS to avoid the need to call pkg-config. +See the pkg-config man page for more details. + +To get pkg-config, see . +See \`config.log' for more details." >&5 +echo "$as_me: error: The pkg-config script could not be found or is too old. Make sure it +is in your PATH or set the PKG_CONFIG environment variable to the full +path to pkg-config. + +Alternatively, you may set the environment variables TWM_CFLAGS +and TWM_LIBS to avoid the need to call pkg-config. +See the pkg-config man page for more details. + +To get pkg-config, see . +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } +else + TWM_CFLAGS=$pkg_cv_TWM_CFLAGS + TWM_LIBS=$pkg_cv_TWM_LIBS + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 + : +fi + + + +# Make sure we can run config.sub. +$ac_config_sub sun4 >/dev/null 2>&1 || + { { echo "$as_me:$LINENO: error: cannot run $ac_config_sub" >&5 +echo "$as_me: error: cannot run $ac_config_sub" >&2;} + { (exit 1); exit 1; }; } + +echo "$as_me:$LINENO: checking build system type" >&5 +echo $ECHO_N "checking build system type... $ECHO_C" >&6 +if test "${ac_cv_build+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_build_alias=$build_alias +test -z "$ac_cv_build_alias" && + ac_cv_build_alias=`$ac_config_guess` +test -z "$ac_cv_build_alias" && + { { echo "$as_me:$LINENO: error: cannot guess build type; you must specify one" >&5 +echo "$as_me: error: cannot guess build type; you must specify one" >&2;} + { (exit 1); exit 1; }; } +ac_cv_build=`$ac_config_sub $ac_cv_build_alias` || + { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_build_alias failed" >&5 +echo "$as_me: error: $ac_config_sub $ac_cv_build_alias failed" >&2;} + { (exit 1); exit 1; }; } + +fi +echo "$as_me:$LINENO: result: $ac_cv_build" >&5 +echo "${ECHO_T}$ac_cv_build" >&6 +build=$ac_cv_build +build_cpu=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` +build_vendor=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` +build_os=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` + + +echo "$as_me:$LINENO: checking host system type" >&5 +echo $ECHO_N "checking host system type... $ECHO_C" >&6 +if test "${ac_cv_host+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_host_alias=$host_alias +test -z "$ac_cv_host_alias" && + ac_cv_host_alias=$ac_cv_build_alias +ac_cv_host=`$ac_config_sub $ac_cv_host_alias` || + { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_host_alias failed" >&5 +echo "$as_me: error: $ac_config_sub $ac_cv_host_alias failed" >&2;} + { (exit 1); exit 1; }; } + +fi +echo "$as_me:$LINENO: result: $ac_cv_host" >&5 +echo "${ECHO_T}$ac_cv_host" >&6 +host=$ac_cv_host +host_cpu=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` +host_vendor=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` +host_os=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` + + + + + +if test x$APP_MAN_SUFFIX = x ; then + APP_MAN_SUFFIX=1 +fi +if test x$APP_MAN_DIR = x ; then + APP_MAN_DIR='$(mandir)/man$(APP_MAN_SUFFIX)' +fi + +if test x$LIB_MAN_SUFFIX = x ; then + LIB_MAN_SUFFIX=3 +fi +if test x$LIB_MAN_DIR = x ; then + LIB_MAN_DIR='$(mandir)/man$(LIB_MAN_SUFFIX)' +fi + +if test x$FILE_MAN_SUFFIX = x ; then + case $host_os in + solaris*) FILE_MAN_SUFFIX=4 ;; + *) FILE_MAN_SUFFIX=5 ;; + esac +fi +if test x$FILE_MAN_DIR = x ; then + FILE_MAN_DIR='$(mandir)/man$(FILE_MAN_SUFFIX)' +fi + +if test x$MISC_MAN_SUFFIX = x ; then + case $host_os in + solaris*) MISC_MAN_SUFFIX=5 ;; + *) MISC_MAN_SUFFIX=7 ;; + esac +fi +if test x$MISC_MAN_DIR = x ; then + MISC_MAN_DIR='$(mandir)/man$(MISC_MAN_SUFFIX)' +fi + +if test x$DRIVER_MAN_SUFFIX = x ; then + case $host_os in + solaris*) DRIVER_MAN_SUFFIX=7 ;; + *) DRIVER_MAN_SUFFIX=4 ;; + esac +fi +if test x$DRIVER_MAN_DIR = x ; then + DRIVER_MAN_DIR='$(mandir)/man$(DRIVER_MAN_SUFFIX)' +fi + +if test x$ADMIN_MAN_SUFFIX = x ; then + case $host_os in + solaris*) ADMIN_MAN_SUFFIX=1m ;; + *) ADMIN_MAN_SUFFIX=8 ;; + esac +fi +if test x$ADMIN_MAN_DIR = x ; then + ADMIN_MAN_DIR='$(mandir)/man$(ADMIN_MAN_SUFFIX)' +fi + + + + + + + + + + + + + + + + + +# Check whether --with-release-version or --without-release-version was given. +if test "${with_release_version+set}" = set; then + withval="$with_release_version" + RELEASE_VERSION="$withval" +else + RELEASE_VERSION="" +fi; + if test "x$RELEASE_VERSION" != "x"; then + PACKAGE="$PACKAGE-$RELEASE_VERSION" + PACKAGE_TARNAME="$PACKAGE_TARNAME-$RELEASE_VERSION" + { echo "$as_me:$LINENO: Building with package name set to $PACKAGE" >&5 +echo "$as_me: Building with package name set to $PACKAGE" >&6;} + fi + + + ac_config_files="$ac_config_files Makefile src/Makefile man/Makefile" +cat >confcache <<\_ACEOF +# This file is a shell script that caches the results of configure +# tests run on this system so they can be shared between configure +# scripts and configure runs, see configure's option --config-cache. +# It is not useful on other systems. If it contains results you don't +# want to keep, you may remove or edit it. +# +# config.status only pays attention to the cache file if you give it +# the --recheck option to rerun configure. +# +# `ac_cv_env_foo' variables (set or unset) will be overridden when +# loading this file, other *unset* `ac_cv_foo' will be assigned the +# following values. + +_ACEOF + +# The following way of writing the cache mishandles newlines in values, +# but we know of no workaround that is simple, portable, and efficient. +# So, don't put newlines in cache variables' values. +# Ultrix sh set writes to stderr and can't be redirected directly, +# and sets the high bit in the cache file unless we assign to the vars. +{ + (set) 2>&1 | + case `(ac_space=' '; set | grep ac_space) 2>&1` in + *ac_space=\ *) + # `set' does not quote correctly, so add quotes (double-quote + # substitution turns \\\\ into \\, and sed turns \\ into \). + sed -n \ + "s/'/'\\\\''/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" + ;; + *) + # `set' quotes correctly as required by POSIX, so do not add quotes. + sed -n \ + "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" + ;; + esac; +} | + sed ' + t clear + : clear + s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ + t end + /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ + : end' >>confcache +if diff $cache_file confcache >/dev/null 2>&1; then :; else + if test -w $cache_file; then + test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file" + cat confcache >$cache_file + else + echo "not updating unwritable cache $cache_file" + fi +fi +rm -f confcache + +test "x$prefix" = xNONE && prefix=$ac_default_prefix +# Let make expand exec_prefix. +test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' + +# VPATH may cause trouble with some makes, so we remove $(srcdir), +# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and +# trailing colons and then remove the whole line if VPATH becomes empty +# (actually we leave an empty line to preserve line numbers). +if test "x$srcdir" = x.; then + ac_vpsub='/^[ ]*VPATH[ ]*=/{ +s/:*\$(srcdir):*/:/; +s/:*\${srcdir}:*/:/; +s/:*@srcdir@:*/:/; +s/^\([^=]*=[ ]*\):*/\1/; +s/:*$//; +s/^[^=]*=[ ]*$//; +}' +fi + +DEFS=-DHAVE_CONFIG_H + +ac_libobjs= +ac_ltlibobjs= +for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue + # 1. Remove the extension, and $U if already installed. + ac_i=`echo "$ac_i" | + sed 's/\$U\././;s/\.o$//;s/\.obj$//'` + # 2. Add them. + ac_libobjs="$ac_libobjs $ac_i\$U.$ac_objext" + ac_ltlibobjs="$ac_ltlibobjs $ac_i"'$U.lo' +done +LIBOBJS=$ac_libobjs + +LTLIBOBJS=$ac_ltlibobjs + + +if test -z "${MAINTAINER_MODE_TRUE}" && test -z "${MAINTAINER_MODE_FALSE}"; then + { { echo "$as_me:$LINENO: error: conditional \"MAINTAINER_MODE\" was never defined. +Usually this means the macro was only invoked conditionally." >&5 +echo "$as_me: error: conditional \"MAINTAINER_MODE\" was never defined. +Usually this means the macro was only invoked conditionally." >&2;} + { (exit 1); exit 1; }; } +fi +if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then + { { echo "$as_me:$LINENO: error: conditional \"AMDEP\" was never defined. +Usually this means the macro was only invoked conditionally." >&5 +echo "$as_me: error: conditional \"AMDEP\" was never defined. +Usually this means the macro was only invoked conditionally." >&2;} + { (exit 1); exit 1; }; } +fi +if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then + { { echo "$as_me:$LINENO: error: conditional \"am__fastdepCC\" was never defined. +Usually this means the macro was only invoked conditionally." >&5 +echo "$as_me: error: conditional \"am__fastdepCC\" was never defined. +Usually this means the macro was only invoked conditionally." >&2;} + { (exit 1); exit 1; }; } +fi + +: ${CONFIG_STATUS=./config.status} +ac_clean_files_save=$ac_clean_files +ac_clean_files="$ac_clean_files $CONFIG_STATUS" +{ echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5 +echo "$as_me: creating $CONFIG_STATUS" >&6;} +cat >$CONFIG_STATUS <<_ACEOF +#! $SHELL +# Generated by $as_me. +# Run this file to recreate the current configuration. +# Compiler output produced by configure, useful for debugging +# configure, is in config.log if it exists. + +debug=false +ac_cs_recheck=false +ac_cs_silent=false +SHELL=\${CONFIG_SHELL-$SHELL} +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF +## --------------------- ## +## M4sh Initialization. ## +## --------------------- ## + +# Be Bourne compatible +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then + emulate sh + NULLCMD=: + # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' +elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then + set -o posix +fi +DUALCASE=1; export DUALCASE # for MKS sh + +# Support unset when possible. +if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then + as_unset=unset +else + as_unset=false +fi + + +# Work around bugs in pre-3.0 UWIN ksh. +$as_unset ENV MAIL MAILPATH +PS1='$ ' +PS2='> ' +PS4='+ ' + +# NLS nuisances. +for as_var in \ + LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ + LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ + LC_TELEPHONE LC_TIME +do + if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then + eval $as_var=C; export $as_var + else + $as_unset $as_var + fi +done + +# Required to use basename. +if expr a : '\(a\)' >/dev/null 2>&1; then + as_expr=expr +else + as_expr=false +fi + +if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then + as_basename=basename +else + as_basename=false +fi + + +# Name of the executable. +as_me=`$as_basename "$0" || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)$' \| \ + . : '\(.\)' 2>/dev/null || +echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; } + /^X\/\(\/\/\)$/{ s//\1/; q; } + /^X\/\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + + +# PATH needs CR, and LINENO needs CR and PATH. +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + echo "#! /bin/sh" >conf$$.sh + echo "exit 0" >>conf$$.sh + chmod +x conf$$.sh + if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then + PATH_SEPARATOR=';' + else + PATH_SEPARATOR=: + fi + rm -f conf$$.sh +fi + + + as_lineno_1=$LINENO + as_lineno_2=$LINENO + as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` + test "x$as_lineno_1" != "x$as_lineno_2" && + test "x$as_lineno_3" = "x$as_lineno_2" || { + # Find who we are. Look in the path if we contain no path at all + # relative or not. + case $0 in + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break +done + + ;; + esac + # We did not find ourselves, most probably we were run as `sh COMMAND' + # in which case we are not to be found in the path. + if test "x$as_myself" = x; then + as_myself=$0 + fi + if test ! -f "$as_myself"; then + { { echo "$as_me:$LINENO: error: cannot find myself; rerun with an absolute path" >&5 +echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2;} + { (exit 1); exit 1; }; } + fi + case $CONFIG_SHELL in + '') + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for as_base in sh bash ksh sh5; do + case $as_dir in + /*) + if ("$as_dir/$as_base" -c ' + as_lineno_1=$LINENO + as_lineno_2=$LINENO + as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` + test "x$as_lineno_1" != "x$as_lineno_2" && + test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then + $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; } + $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; } + CONFIG_SHELL=$as_dir/$as_base + export CONFIG_SHELL + exec "$CONFIG_SHELL" "$0" ${1+"$@"} + fi;; + esac + done +done +;; + esac + + # Create $as_me.lineno as a copy of $as_myself, but with $LINENO + # uniformly replaced by the line number. The first 'sed' inserts a + # line-number line before each line; the second 'sed' does the real + # work. The second script uses 'N' to pair each line-number line + # with the numbered line, and appends trailing '-' during + # substitution so that $LINENO is not a special case at line end. + # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the + # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-) + sed '=' <$as_myself | + sed ' + N + s,$,-, + : loop + s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3, + t loop + s,-$,, + s,^['$as_cr_digits']*\n,, + ' >$as_me.lineno && + chmod +x $as_me.lineno || + { { echo "$as_me:$LINENO: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&5 +echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2;} + { (exit 1); exit 1; }; } + + # Don't try to exec as it changes $[0], causing all sort of problems + # (the dirname of $[0] is not the place where we might find the + # original and so on. Autoconf is especially sensible to this). + . ./$as_me.lineno + # Exit status is that of the last command. + exit +} + + +case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in + *c*,-n*) ECHO_N= ECHO_C=' +' ECHO_T=' ' ;; + *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; + *) ECHO_N= ECHO_C='\c' ECHO_T= ;; +esac + +if expr a : '\(a\)' >/dev/null 2>&1; then + as_expr=expr +else + as_expr=false +fi + +rm -f conf$$ conf$$.exe conf$$.file +echo >conf$$.file +if ln -s conf$$.file conf$$ 2>/dev/null; then + # We could just check for DJGPP; but this test a) works b) is more generic + # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). + if test -f conf$$.exe; then + # Don't use ln at all; we don't have any links + as_ln_s='cp -p' + else + as_ln_s='ln -s' + fi +elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln +else + as_ln_s='cp -p' +fi +rm -f conf$$ conf$$.exe conf$$.file + +if mkdir -p . 2>/dev/null; then + as_mkdir_p=: +else + test -d ./-p && rmdir ./-p + as_mkdir_p=false +fi + +as_executable_p="test -f" + +# Sed expression to map a string onto a valid CPP name. +as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" + +# Sed expression to map a string onto a valid variable name. +as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" + + +# IFS +# We need space, tab and new line, in precisely that order. +as_nl=' +' +IFS=" $as_nl" + +# CDPATH. +$as_unset CDPATH + +exec 6>&1 + +# Open the log real soon, to keep \$[0] and so on meaningful, and to +# report actual input values of CONFIG_FILES etc. instead of their +# values after options handling. Logging --version etc. is OK. +exec 5>>config.log +{ + echo + sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX +## Running $as_me. ## +_ASBOX +} >&5 +cat >&5 <<_CSEOF + +This file was extended by twm $as_me 1.0.2, which was +generated by GNU Autoconf 2.59. Invocation command line was + + CONFIG_FILES = $CONFIG_FILES + CONFIG_HEADERS = $CONFIG_HEADERS + CONFIG_LINKS = $CONFIG_LINKS + CONFIG_COMMANDS = $CONFIG_COMMANDS + $ $0 $@ + +_CSEOF +echo "on `(hostname || uname -n) 2>/dev/null | sed 1q`" >&5 +echo >&5 +_ACEOF + +# Files that config.status was made for. +if test -n "$ac_config_files"; then + echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS +fi + +if test -n "$ac_config_headers"; then + echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS +fi + +if test -n "$ac_config_links"; then + echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS +fi + +if test -n "$ac_config_commands"; then + echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS +fi + +cat >>$CONFIG_STATUS <<\_ACEOF + +ac_cs_usage="\ +\`$as_me' instantiates files from templates according to the +current configuration. + +Usage: $0 [OPTIONS] [FILE]... + + -h, --help print this help, then exit + -V, --version print version number, then exit + -q, --quiet do not print progress messages + -d, --debug don't remove temporary files + --recheck update $as_me by reconfiguring in the same conditions + --file=FILE[:TEMPLATE] + instantiate the configuration file FILE + --header=FILE[:TEMPLATE] + instantiate the configuration header FILE + +Configuration files: +$config_files + +Configuration headers: +$config_headers + +Configuration commands: +$config_commands + +Report bugs to ." +_ACEOF + +cat >>$CONFIG_STATUS <<_ACEOF +ac_cs_version="\\ +twm config.status 1.0.2 +configured by $0, generated by GNU Autoconf 2.59, + with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\" + +Copyright (C) 2003 Free Software Foundation, Inc. +This config.status script is free software; the Free Software Foundation +gives unlimited permission to copy, distribute and modify it." +srcdir=$srcdir +INSTALL="$INSTALL" +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF +# If no file are specified by the user, then we need to provide default +# value. By we need to know if files were specified by the user. +ac_need_defaults=: +while test $# != 0 +do + case $1 in + --*=*) + ac_option=`expr "x$1" : 'x\([^=]*\)='` + ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'` + ac_shift=: + ;; + -*) + ac_option=$1 + ac_optarg=$2 + ac_shift=shift + ;; + *) # This is not an option, so the user has probably given explicit + # arguments. + ac_option=$1 + ac_need_defaults=false;; + esac + + case $ac_option in + # Handling of the options. +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF + -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) + ac_cs_recheck=: ;; + --version | --vers* | -V ) + echo "$ac_cs_version"; exit 0 ;; + --he | --h) + # Conflict between --help and --header + { { echo "$as_me:$LINENO: error: ambiguous option: $1 +Try \`$0 --help' for more information." >&5 +echo "$as_me: error: ambiguous option: $1 +Try \`$0 --help' for more information." >&2;} + { (exit 1); exit 1; }; };; + --help | --hel | -h ) + echo "$ac_cs_usage"; exit 0 ;; + --debug | --d* | -d ) + debug=: ;; + --file | --fil | --fi | --f ) + $ac_shift + CONFIG_FILES="$CONFIG_FILES $ac_optarg" + ac_need_defaults=false;; + --header | --heade | --head | --hea ) + $ac_shift + CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg" + ac_need_defaults=false;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil | --si | --s) + ac_cs_silent=: ;; + + # This is an error. + -*) { { echo "$as_me:$LINENO: error: unrecognized option: $1 +Try \`$0 --help' for more information." >&5 +echo "$as_me: error: unrecognized option: $1 +Try \`$0 --help' for more information." >&2;} + { (exit 1); exit 1; }; } ;; + + *) ac_config_targets="$ac_config_targets $1" ;; + + esac + shift +done + +ac_configure_extra_args= + +if $ac_cs_silent; then + exec 6>/dev/null + ac_configure_extra_args="$ac_configure_extra_args --silent" +fi + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF +if \$ac_cs_recheck; then + echo "running $SHELL $0 " $ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6 + exec $SHELL $0 $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion +fi + +_ACEOF + +cat >>$CONFIG_STATUS <<_ACEOF +# +# INIT-COMMANDS section. +# + +AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir" + +_ACEOF + + + +cat >>$CONFIG_STATUS <<\_ACEOF +for ac_config_target in $ac_config_targets +do + case "$ac_config_target" in + # Handling of arguments. + "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;; + "src/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/Makefile" ;; + "man/Makefile" ) CONFIG_FILES="$CONFIG_FILES man/Makefile" ;; + "depfiles" ) CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; + "config.h" ) CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;; + *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 +echo "$as_me: error: invalid argument: $ac_config_target" >&2;} + { (exit 1); exit 1; }; };; + esac +done + +# If the user did not use the arguments to specify the items to instantiate, +# then the envvar interface is used. Set only those that are not. +# We use the long form for the default assignment because of an extremely +# bizarre bug on SunOS 4.1.3. +if $ac_need_defaults; then + test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files + test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers + test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands +fi + +# Have a temporary directory for convenience. Make it in the build tree +# simply because there is no reason to put it here, and in addition, +# creating and moving files from /tmp can sometimes cause problems. +# Create a temporary directory, and hook for its removal unless debugging. +$debug || +{ + trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0 + trap '{ (exit 1); exit 1; }' 1 2 13 15 +} + +# Create a (secure) tmp directory for tmp files. + +{ + tmp=`(umask 077 && mktemp -d -q "./confstatXXXXXX") 2>/dev/null` && + test -n "$tmp" && test -d "$tmp" +} || +{ + tmp=./confstat$$-$RANDOM + (umask 077 && mkdir $tmp) +} || +{ + echo "$me: cannot create a temporary directory in ." >&2 + { (exit 1); exit 1; } +} + +_ACEOF + +cat >>$CONFIG_STATUS <<_ACEOF + +# +# CONFIG_FILES section. +# + +# No need to generate the scripts if there are no CONFIG_FILES. +# This happens for instance when ./config.status config.h +if test -n "\$CONFIG_FILES"; then + # Protect against being on the right side of a sed subst in config.status. + sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g; + s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF +s,@SHELL@,$SHELL,;t t +s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t +s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t +s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t +s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t +s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t +s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t +s,@exec_prefix@,$exec_prefix,;t t +s,@prefix@,$prefix,;t t +s,@program_transform_name@,$program_transform_name,;t t +s,@bindir@,$bindir,;t t +s,@sbindir@,$sbindir,;t t +s,@libexecdir@,$libexecdir,;t t +s,@datadir@,$datadir,;t t +s,@sysconfdir@,$sysconfdir,;t t +s,@sharedstatedir@,$sharedstatedir,;t t +s,@localstatedir@,$localstatedir,;t t +s,@libdir@,$libdir,;t t +s,@includedir@,$includedir,;t t +s,@oldincludedir@,$oldincludedir,;t t +s,@infodir@,$infodir,;t t +s,@mandir@,$mandir,;t t +s,@build_alias@,$build_alias,;t t +s,@host_alias@,$host_alias,;t t +s,@target_alias@,$target_alias,;t t +s,@DEFS@,$DEFS,;t t +s,@ECHO_C@,$ECHO_C,;t t +s,@ECHO_N@,$ECHO_N,;t t +s,@ECHO_T@,$ECHO_T,;t t +s,@LIBS@,$LIBS,;t t +s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t +s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t +s,@INSTALL_DATA@,$INSTALL_DATA,;t t +s,@CYGPATH_W@,$CYGPATH_W,;t t +s,@PACKAGE@,$PACKAGE,;t t +s,@VERSION@,$VERSION,;t t +s,@ACLOCAL@,$ACLOCAL,;t t +s,@AUTOCONF@,$AUTOCONF,;t t +s,@AUTOMAKE@,$AUTOMAKE,;t t +s,@AUTOHEADER@,$AUTOHEADER,;t t +s,@MAKEINFO@,$MAKEINFO,;t t +s,@install_sh@,$install_sh,;t t +s,@STRIP@,$STRIP,;t t +s,@ac_ct_STRIP@,$ac_ct_STRIP,;t t +s,@INSTALL_STRIP_PROGRAM@,$INSTALL_STRIP_PROGRAM,;t t +s,@mkdir_p@,$mkdir_p,;t t +s,@AWK@,$AWK,;t t +s,@SET_MAKE@,$SET_MAKE,;t t +s,@am__leading_dot@,$am__leading_dot,;t t +s,@AMTAR@,$AMTAR,;t t +s,@am__tar@,$am__tar,;t t +s,@am__untar@,$am__untar,;t t +s,@MAINTAINER_MODE_TRUE@,$MAINTAINER_MODE_TRUE,;t t +s,@MAINTAINER_MODE_FALSE@,$MAINTAINER_MODE_FALSE,;t t +s,@MAINT@,$MAINT,;t t +s,@CC@,$CC,;t t +s,@CFLAGS@,$CFLAGS,;t t +s,@LDFLAGS@,$LDFLAGS,;t t +s,@CPPFLAGS@,$CPPFLAGS,;t t +s,@ac_ct_CC@,$ac_ct_CC,;t t +s,@EXEEXT@,$EXEEXT,;t t +s,@OBJEXT@,$OBJEXT,;t t +s,@DEPDIR@,$DEPDIR,;t t +s,@am__include@,$am__include,;t t +s,@am__quote@,$am__quote,;t t +s,@AMDEP_TRUE@,$AMDEP_TRUE,;t t +s,@AMDEP_FALSE@,$AMDEP_FALSE,;t t +s,@AMDEPBACKSLASH@,$AMDEPBACKSLASH,;t t +s,@CCDEPMODE@,$CCDEPMODE,;t t +s,@am__fastdepCC_TRUE@,$am__fastdepCC_TRUE,;t t +s,@am__fastdepCC_FALSE@,$am__fastdepCC_FALSE,;t t +s,@YACC@,$YACC,;t t +s,@LEX@,$LEX,;t t +s,@LEXLIB@,$LEXLIB,;t t +s,@LEX_OUTPUT_ROOT@,$LEX_OUTPUT_ROOT,;t t +s,@PKG_CONFIG@,$PKG_CONFIG,;t t +s,@ac_pt_PKG_CONFIG@,$ac_pt_PKG_CONFIG,;t t +s,@TWM_CFLAGS@,$TWM_CFLAGS,;t t +s,@TWM_LIBS@,$TWM_LIBS,;t t +s,@build@,$build,;t t +s,@build_cpu@,$build_cpu,;t t +s,@build_vendor@,$build_vendor,;t t +s,@build_os@,$build_os,;t t +s,@host@,$host,;t t +s,@host_cpu@,$host_cpu,;t t +s,@host_vendor@,$host_vendor,;t t +s,@host_os@,$host_os,;t t +s,@APP_MAN_SUFFIX@,$APP_MAN_SUFFIX,;t t +s,@LIB_MAN_SUFFIX@,$LIB_MAN_SUFFIX,;t t +s,@FILE_MAN_SUFFIX@,$FILE_MAN_SUFFIX,;t t +s,@MISC_MAN_SUFFIX@,$MISC_MAN_SUFFIX,;t t +s,@DRIVER_MAN_SUFFIX@,$DRIVER_MAN_SUFFIX,;t t +s,@ADMIN_MAN_SUFFIX@,$ADMIN_MAN_SUFFIX,;t t +s,@APP_MAN_DIR@,$APP_MAN_DIR,;t t +s,@LIB_MAN_DIR@,$LIB_MAN_DIR,;t t +s,@FILE_MAN_DIR@,$FILE_MAN_DIR,;t t +s,@MISC_MAN_DIR@,$MISC_MAN_DIR,;t t +s,@DRIVER_MAN_DIR@,$DRIVER_MAN_DIR,;t t +s,@ADMIN_MAN_DIR@,$ADMIN_MAN_DIR,;t t +s,@LIBOBJS@,$LIBOBJS,;t t +s,@LTLIBOBJS@,$LTLIBOBJS,;t t +CEOF + +_ACEOF + + cat >>$CONFIG_STATUS <<\_ACEOF + # Split the substitutions into bite-sized pieces for seds with + # small command number limits, like on Digital OSF/1 and HP-UX. + ac_max_sed_lines=48 + ac_sed_frag=1 # Number of current file. + ac_beg=1 # First line for current file. + ac_end=$ac_max_sed_lines # Line after last line for current file. + ac_more_lines=: + ac_sed_cmds= + while $ac_more_lines; do + if test $ac_beg -gt 1; then + sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag + else + sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag + fi + if test ! -s $tmp/subs.frag; then + ac_more_lines=false + else + # The purpose of the label and of the branching condition is to + # speed up the sed processing (if there are no `@' at all, there + # is no need to browse any of the substitutions). + # These are the two extra sed commands mentioned above. + (echo ':t + /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed + if test -z "$ac_sed_cmds"; then + ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed" + else + ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed" + fi + ac_sed_frag=`expr $ac_sed_frag + 1` + ac_beg=$ac_end + ac_end=`expr $ac_end + $ac_max_sed_lines` + fi + done + if test -z "$ac_sed_cmds"; then + ac_sed_cmds=cat + fi +fi # test -n "$CONFIG_FILES" + +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF +for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue + # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". + case $ac_file in + - | *:- | *:-:* ) # input from stdin + cat >$tmp/stdin + ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` + ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; + *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` + ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; + * ) ac_file_in=$ac_file.in ;; + esac + + # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories. + ac_dir=`(dirname "$ac_file") 2>/dev/null || +$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$ac_file" : 'X\(//\)[^/]' \| \ + X"$ac_file" : 'X\(//\)$' \| \ + X"$ac_file" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$ac_file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + { if $as_mkdir_p; then + mkdir -p "$ac_dir" + else + as_dir="$ac_dir" + as_dirs= + while test ! -d "$as_dir"; do + as_dirs="$as_dir $as_dirs" + as_dir=`(dirname "$as_dir") 2>/dev/null || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + done + test ! -n "$as_dirs" || mkdir $as_dirs + fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5 +echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;} + { (exit 1); exit 1; }; }; } + + ac_builddir=. + +if test "$ac_dir" != .; then + ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` + # A "../" for each directory in $ac_dir_suffix. + ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` +else + ac_dir_suffix= ac_top_builddir= +fi + +case $srcdir in + .) # No --srcdir option. We are building in place. + ac_srcdir=. + if test -z "$ac_top_builddir"; then + ac_top_srcdir=. + else + ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` + fi ;; + [\\/]* | ?:[\\/]* ) # Absolute path. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir ;; + *) # Relative path. + ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_builddir$srcdir ;; +esac + +# Do not use `cd foo && pwd` to compute absolute paths, because +# the directories may not exist. +case `pwd` in +.) ac_abs_builddir="$ac_dir";; +*) + case "$ac_dir" in + .) ac_abs_builddir=`pwd`;; + [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";; + *) ac_abs_builddir=`pwd`/"$ac_dir";; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_top_builddir=${ac_top_builddir}.;; +*) + case ${ac_top_builddir}. in + .) ac_abs_top_builddir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;; + *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_srcdir=$ac_srcdir;; +*) + case $ac_srcdir in + .) ac_abs_srcdir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;; + *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_top_srcdir=$ac_top_srcdir;; +*) + case $ac_top_srcdir in + .) ac_abs_top_srcdir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;; + *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;; + esac;; +esac + + + case $INSTALL in + [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; + *) ac_INSTALL=$ac_top_builddir$INSTALL ;; + esac + + if test x"$ac_file" != x-; then + { echo "$as_me:$LINENO: creating $ac_file" >&5 +echo "$as_me: creating $ac_file" >&6;} + rm -f "$ac_file" + fi + # Let's still pretend it is `configure' which instantiates (i.e., don't + # use $as_me), people would be surprised to read: + # /* config.h. Generated by config.status. */ + if test x"$ac_file" = x-; then + configure_input= + else + configure_input="$ac_file. " + fi + configure_input=$configure_input"Generated from `echo $ac_file_in | + sed 's,.*/,,'` by configure." + + # First look for the input files in the build tree, otherwise in the + # src tree. + ac_file_inputs=`IFS=: + for f in $ac_file_in; do + case $f in + -) echo $tmp/stdin ;; + [\\/$]*) + # Absolute (can't be DOS-style, as IFS=:) + test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 +echo "$as_me: error: cannot find input file: $f" >&2;} + { (exit 1); exit 1; }; } + echo "$f";; + *) # Relative + if test -f "$f"; then + # Build tree + echo "$f" + elif test -f "$srcdir/$f"; then + # Source tree + echo "$srcdir/$f" + else + # /dev/null tree + { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 +echo "$as_me: error: cannot find input file: $f" >&2;} + { (exit 1); exit 1; }; } + fi;; + esac + done` || { (exit 1); exit 1; } +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF + sed "$ac_vpsub +$extrasub +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF +:t +/@[a-zA-Z_][a-zA-Z_0-9]*@/!b +s,@configure_input@,$configure_input,;t t +s,@srcdir@,$ac_srcdir,;t t +s,@abs_srcdir@,$ac_abs_srcdir,;t t +s,@top_srcdir@,$ac_top_srcdir,;t t +s,@abs_top_srcdir@,$ac_abs_top_srcdir,;t t +s,@builddir@,$ac_builddir,;t t +s,@abs_builddir@,$ac_abs_builddir,;t t +s,@top_builddir@,$ac_top_builddir,;t t +s,@abs_top_builddir@,$ac_abs_top_builddir,;t t +s,@INSTALL@,$ac_INSTALL,;t t +" $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out + rm -f $tmp/stdin + if test x"$ac_file" != x-; then + mv $tmp/out $ac_file + else + cat $tmp/out + rm -f $tmp/out + fi + +done +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF + +# +# CONFIG_HEADER section. +# + +# These sed commands are passed to sed as "A NAME B NAME C VALUE D", where +# NAME is the cpp macro being defined and VALUE is the value it is being given. +# +# ac_d sets the value in "#define NAME VALUE" lines. +ac_dA='s,^\([ ]*\)#\([ ]*define[ ][ ]*\)' +ac_dB='[ ].*$,\1#\2' +ac_dC=' ' +ac_dD=',;t' +# ac_u turns "#undef NAME" without trailing blanks into "#define NAME VALUE". +ac_uA='s,^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)' +ac_uB='$,\1#\2define\3' +ac_uC=' ' +ac_uD=',;t' + +for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue + # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". + case $ac_file in + - | *:- | *:-:* ) # input from stdin + cat >$tmp/stdin + ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` + ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; + *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` + ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; + * ) ac_file_in=$ac_file.in ;; + esac + + test x"$ac_file" != x- && { echo "$as_me:$LINENO: creating $ac_file" >&5 +echo "$as_me: creating $ac_file" >&6;} + + # First look for the input files in the build tree, otherwise in the + # src tree. + ac_file_inputs=`IFS=: + for f in $ac_file_in; do + case $f in + -) echo $tmp/stdin ;; + [\\/$]*) + # Absolute (can't be DOS-style, as IFS=:) + test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 +echo "$as_me: error: cannot find input file: $f" >&2;} + { (exit 1); exit 1; }; } + # Do quote $f, to prevent DOS paths from being IFS'd. + echo "$f";; + *) # Relative + if test -f "$f"; then + # Build tree + echo "$f" + elif test -f "$srcdir/$f"; then + # Source tree + echo "$srcdir/$f" + else + # /dev/null tree + { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 +echo "$as_me: error: cannot find input file: $f" >&2;} + { (exit 1); exit 1; }; } + fi;; + esac + done` || { (exit 1); exit 1; } + # Remove the trailing spaces. + sed 's/[ ]*$//' $ac_file_inputs >$tmp/in + +_ACEOF + +# Transform confdefs.h into two sed scripts, `conftest.defines' and +# `conftest.undefs', that substitutes the proper values into +# config.h.in to produce config.h. The first handles `#define' +# templates, and the second `#undef' templates. +# And first: Protect against being on the right side of a sed subst in +# config.status. Protect against being in an unquoted here document +# in config.status. +rm -f conftest.defines conftest.undefs +# Using a here document instead of a string reduces the quoting nightmare. +# Putting comments in sed scripts is not portable. +# +# `end' is used to avoid that the second main sed command (meant for +# 0-ary CPP macros) applies to n-ary macro definitions. +# See the Autoconf documentation for `clear'. +cat >confdef2sed.sed <<\_ACEOF +s/[\\&,]/\\&/g +s,[\\$`],\\&,g +t clear +: clear +s,^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*\)\(([^)]*)\)[ ]*\(.*\)$,${ac_dA}\1${ac_dB}\1\2${ac_dC}\3${ac_dD},gp +t end +s,^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)$,${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD},gp +: end +_ACEOF +# If some macros were called several times there might be several times +# the same #defines, which is useless. Nevertheless, we may not want to +# sort them, since we want the *last* AC-DEFINE to be honored. +uniq confdefs.h | sed -n -f confdef2sed.sed >conftest.defines +sed 's/ac_d/ac_u/g' conftest.defines >conftest.undefs +rm -f confdef2sed.sed + +# This sed command replaces #undef with comments. This is necessary, for +# example, in the case of _POSIX_SOURCE, which is predefined and required +# on some systems where configure will not decide to define it. +cat >>conftest.undefs <<\_ACEOF +s,^[ ]*#[ ]*undef[ ][ ]*[a-zA-Z_][a-zA-Z_0-9]*,/* & */, +_ACEOF + +# Break up conftest.defines because some shells have a limit on the size +# of here documents, and old seds have small limits too (100 cmds). +echo ' # Handle all the #define templates only if necessary.' >>$CONFIG_STATUS +echo ' if grep "^[ ]*#[ ]*define" $tmp/in >/dev/null; then' >>$CONFIG_STATUS +echo ' # If there are no defines, we may have an empty if/fi' >>$CONFIG_STATUS +echo ' :' >>$CONFIG_STATUS +rm -f conftest.tail +while grep . conftest.defines >/dev/null +do + # Write a limited-size here document to $tmp/defines.sed. + echo ' cat >$tmp/defines.sed <>$CONFIG_STATUS + # Speed up: don't consider the non `#define' lines. + echo '/^[ ]*#[ ]*define/!b' >>$CONFIG_STATUS + # Work around the forget-to-reset-the-flag bug. + echo 't clr' >>$CONFIG_STATUS + echo ': clr' >>$CONFIG_STATUS + sed ${ac_max_here_lines}q conftest.defines >>$CONFIG_STATUS + echo 'CEOF + sed -f $tmp/defines.sed $tmp/in >$tmp/out + rm -f $tmp/in + mv $tmp/out $tmp/in +' >>$CONFIG_STATUS + sed 1,${ac_max_here_lines}d conftest.defines >conftest.tail + rm -f conftest.defines + mv conftest.tail conftest.defines +done +rm -f conftest.defines +echo ' fi # grep' >>$CONFIG_STATUS +echo >>$CONFIG_STATUS + +# Break up conftest.undefs because some shells have a limit on the size +# of here documents, and old seds have small limits too (100 cmds). +echo ' # Handle all the #undef templates' >>$CONFIG_STATUS +rm -f conftest.tail +while grep . conftest.undefs >/dev/null +do + # Write a limited-size here document to $tmp/undefs.sed. + echo ' cat >$tmp/undefs.sed <>$CONFIG_STATUS + # Speed up: don't consider the non `#undef' + echo '/^[ ]*#[ ]*undef/!b' >>$CONFIG_STATUS + # Work around the forget-to-reset-the-flag bug. + echo 't clr' >>$CONFIG_STATUS + echo ': clr' >>$CONFIG_STATUS + sed ${ac_max_here_lines}q conftest.undefs >>$CONFIG_STATUS + echo 'CEOF + sed -f $tmp/undefs.sed $tmp/in >$tmp/out + rm -f $tmp/in + mv $tmp/out $tmp/in +' >>$CONFIG_STATUS + sed 1,${ac_max_here_lines}d conftest.undefs >conftest.tail + rm -f conftest.undefs + mv conftest.tail conftest.undefs +done +rm -f conftest.undefs + +cat >>$CONFIG_STATUS <<\_ACEOF + # Let's still pretend it is `configure' which instantiates (i.e., don't + # use $as_me), people would be surprised to read: + # /* config.h. Generated by config.status. */ + if test x"$ac_file" = x-; then + echo "/* Generated by configure. */" >$tmp/config.h + else + echo "/* $ac_file. Generated by configure. */" >$tmp/config.h + fi + cat $tmp/in >>$tmp/config.h + rm -f $tmp/in + if test x"$ac_file" != x-; then + if diff $ac_file $tmp/config.h >/dev/null 2>&1; then + { echo "$as_me:$LINENO: $ac_file is unchanged" >&5 +echo "$as_me: $ac_file is unchanged" >&6;} + else + ac_dir=`(dirname "$ac_file") 2>/dev/null || +$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$ac_file" : 'X\(//\)[^/]' \| \ + X"$ac_file" : 'X\(//\)$' \| \ + X"$ac_file" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$ac_file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + { if $as_mkdir_p; then + mkdir -p "$ac_dir" + else + as_dir="$ac_dir" + as_dirs= + while test ! -d "$as_dir"; do + as_dirs="$as_dir $as_dirs" + as_dir=`(dirname "$as_dir") 2>/dev/null || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + done + test ! -n "$as_dirs" || mkdir $as_dirs + fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5 +echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;} + { (exit 1); exit 1; }; }; } + + rm -f $ac_file + mv $tmp/config.h $ac_file + fi + else + cat $tmp/config.h + rm -f $tmp/config.h + fi +# Compute $ac_file's index in $config_headers. +_am_stamp_count=1 +for _am_header in $config_headers :; do + case $_am_header in + $ac_file | $ac_file:* ) + break ;; + * ) + _am_stamp_count=`expr $_am_stamp_count + 1` ;; + esac +done +echo "timestamp for $ac_file" >`(dirname $ac_file) 2>/dev/null || +$as_expr X$ac_file : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X$ac_file : 'X\(//\)[^/]' \| \ + X$ac_file : 'X\(//\)$' \| \ + X$ac_file : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X$ac_file | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'`/stamp-h$_am_stamp_count +done +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF + +# +# CONFIG_COMMANDS section. +# +for ac_file in : $CONFIG_COMMANDS; do test "x$ac_file" = x: && continue + ac_dest=`echo "$ac_file" | sed 's,:.*,,'` + ac_source=`echo "$ac_file" | sed 's,[^:]*:,,'` + ac_dir=`(dirname "$ac_dest") 2>/dev/null || +$as_expr X"$ac_dest" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$ac_dest" : 'X\(//\)[^/]' \| \ + X"$ac_dest" : 'X\(//\)$' \| \ + X"$ac_dest" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$ac_dest" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + { if $as_mkdir_p; then + mkdir -p "$ac_dir" + else + as_dir="$ac_dir" + as_dirs= + while test ! -d "$as_dir"; do + as_dirs="$as_dir $as_dirs" + as_dir=`(dirname "$as_dir") 2>/dev/null || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + done + test ! -n "$as_dirs" || mkdir $as_dirs + fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5 +echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;} + { (exit 1); exit 1; }; }; } + + ac_builddir=. + +if test "$ac_dir" != .; then + ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` + # A "../" for each directory in $ac_dir_suffix. + ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` +else + ac_dir_suffix= ac_top_builddir= +fi + +case $srcdir in + .) # No --srcdir option. We are building in place. + ac_srcdir=. + if test -z "$ac_top_builddir"; then + ac_top_srcdir=. + else + ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` + fi ;; + [\\/]* | ?:[\\/]* ) # Absolute path. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir ;; + *) # Relative path. + ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_builddir$srcdir ;; +esac + +# Do not use `cd foo && pwd` to compute absolute paths, because +# the directories may not exist. +case `pwd` in +.) ac_abs_builddir="$ac_dir";; +*) + case "$ac_dir" in + .) ac_abs_builddir=`pwd`;; + [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";; + *) ac_abs_builddir=`pwd`/"$ac_dir";; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_top_builddir=${ac_top_builddir}.;; +*) + case ${ac_top_builddir}. in + .) ac_abs_top_builddir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;; + *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_srcdir=$ac_srcdir;; +*) + case $ac_srcdir in + .) ac_abs_srcdir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;; + *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_top_srcdir=$ac_top_srcdir;; +*) + case $ac_top_srcdir in + .) ac_abs_top_srcdir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;; + *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;; + esac;; +esac + + + { echo "$as_me:$LINENO: executing $ac_dest commands" >&5 +echo "$as_me: executing $ac_dest commands" >&6;} + case $ac_dest in + depfiles ) test x"$AMDEP_TRUE" != x"" || for mf in $CONFIG_FILES; do + # Strip MF so we end up with the name of the file. + mf=`echo "$mf" | sed -e 's/:.*$//'` + # Check whether this is an Automake generated Makefile or not. + # We used to match only the files named `Makefile.in', but + # some people rename them; so instead we look at the file content. + # Grep'ing the first line is not enough: some people post-process + # each Makefile.in and add a new line on top of each file to say so. + # So let's grep whole file. + if grep '^#.*generated by automake' $mf > /dev/null 2>&1; then + dirpart=`(dirname "$mf") 2>/dev/null || +$as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$mf" : 'X\(//\)[^/]' \| \ + X"$mf" : 'X\(//\)$' \| \ + X"$mf" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$mf" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + else + continue + fi + # Extract the definition of DEPDIR, am__include, and am__quote + # from the Makefile without running `make'. + DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` + test -z "$DEPDIR" && continue + am__include=`sed -n 's/^am__include = //p' < "$mf"` + test -z "am__include" && continue + am__quote=`sed -n 's/^am__quote = //p' < "$mf"` + # When using ansi2knr, U may be empty or an underscore; expand it + U=`sed -n 's/^U = //p' < "$mf"` + # Find all dependency output files, they are included files with + # $(DEPDIR) in their names. We invoke sed twice because it is the + # simplest approach to changing $(DEPDIR) to its actual value in the + # expansion. + for file in `sed -n " + s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ + sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do + # Make sure the directory exists. + test -f "$dirpart/$file" && continue + fdir=`(dirname "$file") 2>/dev/null || +$as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$file" : 'X\(//\)[^/]' \| \ + X"$file" : 'X\(//\)$' \| \ + X"$file" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + { if $as_mkdir_p; then + mkdir -p $dirpart/$fdir + else + as_dir=$dirpart/$fdir + as_dirs= + while test ! -d "$as_dir"; do + as_dirs="$as_dir $as_dirs" + as_dir=`(dirname "$as_dir") 2>/dev/null || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + done + test ! -n "$as_dirs" || mkdir $as_dirs + fi || { { echo "$as_me:$LINENO: error: cannot create directory $dirpart/$fdir" >&5 +echo "$as_me: error: cannot create directory $dirpart/$fdir" >&2;} + { (exit 1); exit 1; }; }; } + + # echo "creating $dirpart/$file" + echo '# dummy' > "$dirpart/$file" + done +done + ;; + esac +done +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF + +{ (exit 0); exit 0; } +_ACEOF +chmod +x $CONFIG_STATUS +ac_clean_files=$ac_clean_files_save + + +# configure is writing to config.log, and then calls config.status. +# config.status does its own redirection, appending to config.log. +# Unfortunately, on DOS this fails, as config.log is still kept open +# by configure, so config.status won't be able to write to it; its +# output is simply discarded. So we exec the FD to /dev/null, +# effectively closing config.log, so it can be properly (re)opened and +# appended to by config.status. When coming back to configure, we +# need to make the FD available again. +if test "$no_create" != yes; then + ac_cs_success=: + ac_config_status_args= + test "$silent" = yes && + ac_config_status_args="$ac_config_status_args --quiet" + exec 5>/dev/null + $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false + exec 5>>config.log + # Use ||, not &&, to avoid exiting from the if with $? = 1, which + # would make configure fail if this is the last instruction. + $ac_cs_success || { (exit 1); exit 1; } +fi + diff --git a/app/twm/configure.ac b/app/twm/configure.ac new file mode 100644 index 000000000..2c0102203 --- /dev/null +++ b/app/twm/configure.ac @@ -0,0 +1,49 @@ + +dnl Copyright 2005 Red Hat, Inc. +dnl +dnl Permission to use, copy, modify, distribute, and sell this software and its +dnl documentation for any purpose is hereby granted without fee, provided that +dnl the above copyright notice appear in all copies and that both that +dnl copyright notice and this permission notice appear in supporting +dnl documentation, and that the name of Red Hat not be used in +dnl advertising or publicity pertaining to distribution of the software without +dnl specific, written prior permission. Red Hat makes no +dnl representations about the suitability of this software for any purpose. It +dnl is provided "as is" without express or implied warranty. +dnl +dnl RED HAT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, +dnl INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO +dnl EVENT SHALL RED HAT BE LIABLE FOR ANY SPECIAL, INDIRECT OR +dnl CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, +dnl DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER +dnl TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +dnl PERFORMANCE OF THIS SOFTWARE. +dnl +dnl Process this file with autoconf to create configure. + +AC_PREREQ([2.57]) +AC_INIT(twm,[1.0.2], [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg],twm) +AM_INIT_AUTOMAKE([dist-bzip2]) +AM_MAINTAINER_MODE + +AM_CONFIG_HEADER(config.h) + +AC_PROG_CC +AC_PROG_INSTALL +AC_PROG_YACC +AC_PROG_LEX + +AC_CHECK_FUNC([mkstemp], + AC_DEFINE(HAS_MKSTEMP,1,[Define to 1 if you have the `mkstemp' function.])) + +# Checks for pkg-config packages +PKG_CHECK_MODULES(TWM, x11 xext xt xmu) +AC_SUBST(TWM_CFLAGS) +AC_SUBST(TWM_LIBS) + +XORG_MANPAGE_SECTIONS +XORG_RELEASE_VERSION + +AC_OUTPUT([Makefile + src/Makefile + man/Makefile]) diff --git a/app/twm/depcomp b/app/twm/depcomp new file mode 100644 index 000000000..04701da53 --- /dev/null +++ b/app/twm/depcomp @@ -0,0 +1,530 @@ +#! /bin/sh +# depcomp - compile a program generating dependencies as side-effects + +scriptversion=2005-07-09.11 + +# Copyright (C) 1999, 2000, 2003, 2004, 2005 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +# 02110-1301, USA. + +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +# Originally written by Alexandre Oliva . + +case $1 in + '') + echo "$0: No command. Try \`$0 --help' for more information." 1>&2 + exit 1; + ;; + -h | --h*) + cat <<\EOF +Usage: depcomp [--help] [--version] PROGRAM [ARGS] + +Run PROGRAMS ARGS to compile a file, generating dependencies +as side-effects. + +Environment variables: + depmode Dependency tracking mode. + source Source file read by `PROGRAMS ARGS'. + object Object file output by `PROGRAMS ARGS'. + DEPDIR directory where to store dependencies. + depfile Dependency file to output. + tmpdepfile Temporary file to use when outputing dependencies. + libtool Whether libtool is used (yes/no). + +Report bugs to . +EOF + exit $? + ;; + -v | --v*) + echo "depcomp $scriptversion" + exit $? + ;; +esac + +if test -z "$depmode" || test -z "$source" || test -z "$object"; then + echo "depcomp: Variables source, object and depmode must be set" 1>&2 + exit 1 +fi + +# Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po. +depfile=${depfile-`echo "$object" | + sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`} +tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`} + +rm -f "$tmpdepfile" + +# Some modes work just like other modes, but use different flags. We +# parameterize here, but still list the modes in the big case below, +# to make depend.m4 easier to write. Note that we *cannot* use a case +# here, because this file can only contain one case statement. +if test "$depmode" = hp; then + # HP compiler uses -M and no extra arg. + gccflag=-M + depmode=gcc +fi + +if test "$depmode" = dashXmstdout; then + # This is just like dashmstdout with a different argument. + dashmflag=-xM + depmode=dashmstdout +fi + +case "$depmode" in +gcc3) +## gcc 3 implements dependency tracking that does exactly what +## we want. Yay! Note: for some reason libtool 1.4 doesn't like +## it if -MD -MP comes after the -MF stuff. Hmm. + "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" + stat=$? + if test $stat -eq 0; then : + else + rm -f "$tmpdepfile" + exit $stat + fi + mv "$tmpdepfile" "$depfile" + ;; + +gcc) +## There are various ways to get dependency output from gcc. Here's +## why we pick this rather obscure method: +## - Don't want to use -MD because we'd like the dependencies to end +## up in a subdir. Having to rename by hand is ugly. +## (We might end up doing this anyway to support other compilers.) +## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like +## -MM, not -M (despite what the docs say). +## - Using -M directly means running the compiler twice (even worse +## than renaming). + if test -z "$gccflag"; then + gccflag=-MD, + fi + "$@" -Wp,"$gccflag$tmpdepfile" + stat=$? + if test $stat -eq 0; then : + else + rm -f "$tmpdepfile" + exit $stat + fi + rm -f "$depfile" + echo "$object : \\" > "$depfile" + alpha=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz +## The second -e expression handles DOS-style file names with drive letters. + sed -e 's/^[^:]*: / /' \ + -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile" +## This next piece of magic avoids the `deleted header file' problem. +## The problem is that when a header file which appears in a .P file +## is deleted, the dependency causes make to die (because there is +## typically no way to rebuild the header). We avoid this by adding +## dummy dependencies for each header file. Too bad gcc doesn't do +## this for us directly. + tr ' ' ' +' < "$tmpdepfile" | +## Some versions of gcc put a space before the `:'. On the theory +## that the space means something, we add a space to the output as +## well. +## Some versions of the HPUX 10.20 sed can't process this invocation +## correctly. Breaking it into two sed invocations is a workaround. + sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +hp) + # This case exists only to let depend.m4 do its work. It works by + # looking at the text of this script. This case will never be run, + # since it is checked for above. + exit 1 + ;; + +sgi) + if test "$libtool" = yes; then + "$@" "-Wp,-MDupdate,$tmpdepfile" + else + "$@" -MDupdate "$tmpdepfile" + fi + stat=$? + if test $stat -eq 0; then : + else + rm -f "$tmpdepfile" + exit $stat + fi + rm -f "$depfile" + + if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files + echo "$object : \\" > "$depfile" + + # Clip off the initial element (the dependent). Don't try to be + # clever and replace this with sed code, as IRIX sed won't handle + # lines with more than a fixed number of characters (4096 in + # IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines; + # the IRIX cc adds comments like `#:fec' to the end of the + # dependency line. + tr ' ' ' +' < "$tmpdepfile" \ + | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \ + tr ' +' ' ' >> $depfile + echo >> $depfile + + # The second pass generates a dummy entry for each header file. + tr ' ' ' +' < "$tmpdepfile" \ + | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \ + >> $depfile + else + # The sourcefile does not contain any dependencies, so just + # store a dummy comment line, to avoid errors with the Makefile + # "include basename.Plo" scheme. + echo "#dummy" > "$depfile" + fi + rm -f "$tmpdepfile" + ;; + +aix) + # The C for AIX Compiler uses -M and outputs the dependencies + # in a .u file. In older versions, this file always lives in the + # current directory. Also, the AIX compiler puts `$object:' at the + # start of each line; $object doesn't have directory information. + # Version 6 uses the directory in both cases. + stripped=`echo "$object" | sed 's/\(.*\)\..*$/\1/'` + tmpdepfile="$stripped.u" + if test "$libtool" = yes; then + "$@" -Wc,-M + else + "$@" -M + fi + stat=$? + + if test -f "$tmpdepfile"; then : + else + stripped=`echo "$stripped" | sed 's,^.*/,,'` + tmpdepfile="$stripped.u" + fi + + if test $stat -eq 0; then : + else + rm -f "$tmpdepfile" + exit $stat + fi + + if test -f "$tmpdepfile"; then + outname="$stripped.o" + # Each line is of the form `foo.o: dependent.h'. + # Do two passes, one to just change these to + # `$object: dependent.h' and one to simply `dependent.h:'. + sed -e "s,^$outname:,$object :," < "$tmpdepfile" > "$depfile" + sed -e "s,^$outname: \(.*\)$,\1:," < "$tmpdepfile" >> "$depfile" + else + # The sourcefile does not contain any dependencies, so just + # store a dummy comment line, to avoid errors with the Makefile + # "include basename.Plo" scheme. + echo "#dummy" > "$depfile" + fi + rm -f "$tmpdepfile" + ;; + +icc) + # Intel's C compiler understands `-MD -MF file'. However on + # icc -MD -MF foo.d -c -o sub/foo.o sub/foo.c + # ICC 7.0 will fill foo.d with something like + # foo.o: sub/foo.c + # foo.o: sub/foo.h + # which is wrong. We want: + # sub/foo.o: sub/foo.c + # sub/foo.o: sub/foo.h + # sub/foo.c: + # sub/foo.h: + # ICC 7.1 will output + # foo.o: sub/foo.c sub/foo.h + # and will wrap long lines using \ : + # foo.o: sub/foo.c ... \ + # sub/foo.h ... \ + # ... + + "$@" -MD -MF "$tmpdepfile" + stat=$? + if test $stat -eq 0; then : + else + rm -f "$tmpdepfile" + exit $stat + fi + rm -f "$depfile" + # Each line is of the form `foo.o: dependent.h', + # or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'. + # Do two passes, one to just change these to + # `$object: dependent.h' and one to simply `dependent.h:'. + sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile" + # Some versions of the HPUX 10.20 sed can't process this invocation + # correctly. Breaking it into two sed invocations is a workaround. + sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" | + sed -e 's/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +tru64) + # The Tru64 compiler uses -MD to generate dependencies as a side + # effect. `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'. + # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put + # dependencies in `foo.d' instead, so we check for that too. + # Subdirectories are respected. + dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` + test "x$dir" = "x$object" && dir= + base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` + + if test "$libtool" = yes; then + # With Tru64 cc, shared objects can also be used to make a + # static library. This mecanism is used in libtool 1.4 series to + # handle both shared and static libraries in a single compilation. + # With libtool 1.4, dependencies were output in $dir.libs/$base.lo.d. + # + # With libtool 1.5 this exception was removed, and libtool now + # generates 2 separate objects for the 2 libraries. These two + # compilations output dependencies in in $dir.libs/$base.o.d and + # in $dir$base.o.d. We have to check for both files, because + # one of the two compilations can be disabled. We should prefer + # $dir$base.o.d over $dir.libs/$base.o.d because the latter is + # automatically cleaned when .libs/ is deleted, while ignoring + # the former would cause a distcleancheck panic. + tmpdepfile1=$dir.libs/$base.lo.d # libtool 1.4 + tmpdepfile2=$dir$base.o.d # libtool 1.5 + tmpdepfile3=$dir.libs/$base.o.d # libtool 1.5 + tmpdepfile4=$dir.libs/$base.d # Compaq CCC V6.2-504 + "$@" -Wc,-MD + else + tmpdepfile1=$dir$base.o.d + tmpdepfile2=$dir$base.d + tmpdepfile3=$dir$base.d + tmpdepfile4=$dir$base.d + "$@" -MD + fi + + stat=$? + if test $stat -eq 0; then : + else + rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4" + exit $stat + fi + + for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4" + do + test -f "$tmpdepfile" && break + done + if test -f "$tmpdepfile"; then + sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile" + # That's a tab and a space in the []. + sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile" + else + echo "#dummy" > "$depfile" + fi + rm -f "$tmpdepfile" + ;; + +#nosideeffect) + # This comment above is used by automake to tell side-effect + # dependency tracking mechanisms from slower ones. + +dashmstdout) + # Important note: in order to support this mode, a compiler *must* + # always write the preprocessed file to stdout, regardless of -o. + "$@" || exit $? + + # Remove the call to Libtool. + if test "$libtool" = yes; then + while test $1 != '--mode=compile'; do + shift + done + shift + fi + + # Remove `-o $object'. + IFS=" " + for arg + do + case $arg in + -o) + shift + ;; + $object) + shift + ;; + *) + set fnord "$@" "$arg" + shift # fnord + shift # $arg + ;; + esac + done + + test -z "$dashmflag" && dashmflag=-M + # Require at least two characters before searching for `:' + # in the target name. This is to cope with DOS-style filenames: + # a dependency such as `c:/foo/bar' could be seen as target `c' otherwise. + "$@" $dashmflag | + sed 's:^[ ]*[^: ][^:][^:]*\:[ ]*:'"$object"'\: :' > "$tmpdepfile" + rm -f "$depfile" + cat < "$tmpdepfile" > "$depfile" + tr ' ' ' +' < "$tmpdepfile" | \ +## Some versions of the HPUX 10.20 sed can't process this invocation +## correctly. Breaking it into two sed invocations is a workaround. + sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +dashXmstdout) + # This case only exists to satisfy depend.m4. It is never actually + # run, as this mode is specially recognized in the preamble. + exit 1 + ;; + +makedepend) + "$@" || exit $? + # Remove any Libtool call + if test "$libtool" = yes; then + while test $1 != '--mode=compile'; do + shift + done + shift + fi + # X makedepend + shift + cleared=no + for arg in "$@"; do + case $cleared in + no) + set ""; shift + cleared=yes ;; + esac + case "$arg" in + -D*|-I*) + set fnord "$@" "$arg"; shift ;; + # Strip any option that makedepend may not understand. Remove + # the object too, otherwise makedepend will parse it as a source file. + -*|$object) + ;; + *) + set fnord "$@" "$arg"; shift ;; + esac + done + obj_suffix="`echo $object | sed 's/^.*\././'`" + touch "$tmpdepfile" + ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@" + rm -f "$depfile" + cat < "$tmpdepfile" > "$depfile" + sed '1,2d' "$tmpdepfile" | tr ' ' ' +' | \ +## Some versions of the HPUX 10.20 sed can't process this invocation +## correctly. Breaking it into two sed invocations is a workaround. + sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" "$tmpdepfile".bak + ;; + +cpp) + # Important note: in order to support this mode, a compiler *must* + # always write the preprocessed file to stdout. + "$@" || exit $? + + # Remove the call to Libtool. + if test "$libtool" = yes; then + while test $1 != '--mode=compile'; do + shift + done + shift + fi + + # Remove `-o $object'. + IFS=" " + for arg + do + case $arg in + -o) + shift + ;; + $object) + shift + ;; + *) + set fnord "$@" "$arg" + shift # fnord + shift # $arg + ;; + esac + done + + "$@" -E | + sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ + -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' | + sed '$ s: \\$::' > "$tmpdepfile" + rm -f "$depfile" + echo "$object : \\" > "$depfile" + cat < "$tmpdepfile" >> "$depfile" + sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +msvisualcpp) + # Important note: in order to support this mode, a compiler *must* + # always write the preprocessed file to stdout, regardless of -o, + # because we must use -o when running libtool. + "$@" || exit $? + IFS=" " + for arg + do + case "$arg" in + "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI") + set fnord "$@" + shift + shift + ;; + *) + set fnord "$@" "$arg" + shift + shift + ;; + esac + done + "$@" -E | + sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::echo "`cygpath -u \\"\1\\"`":p' | sort | uniq > "$tmpdepfile" + rm -f "$depfile" + echo "$object : \\" > "$depfile" + . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s:: \1 \\:p' >> "$depfile" + echo " " >> "$depfile" + . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s::\1\::p' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +none) + exec "$@" + ;; + +*) + echo "Unknown depmode $depmode" 1>&2 + exit 1 + ;; +esac + +exit 0 + +# Local Variables: +# mode: shell-script +# sh-indentation: 2 +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-end: "$" +# End: diff --git a/app/twm/install-sh b/app/twm/install-sh new file mode 100644 index 000000000..4d4a9519e --- /dev/null +++ b/app/twm/install-sh @@ -0,0 +1,323 @@ +#!/bin/sh +# install - install a program, script, or datafile + +scriptversion=2005-05-14.22 + +# This originates from X11R5 (mit/util/scripts/install.sh), which was +# later released in X11R6 (xc/config/util/install.sh) with the +# following copyright and license. +# +# Copyright (C) 1994 X Consortium +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC- +# TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +# +# Except as contained in this notice, the name of the X Consortium shall not +# be used in advertising or otherwise to promote the sale, use or other deal- +# ings in this Software without prior written authorization from the X Consor- +# tium. +# +# +# FSF changes to this file are in the public domain. +# +# Calling this script install-sh is preferred over install.sh, to prevent +# `make' implicit rules from creating a file called install from it +# when there is no Makefile. +# +# This script is compatible with the BSD install script, but was written +# from scratch. It can only install one file at a time, a restriction +# shared with many OS's install programs. + +# set DOITPROG to echo to test this script + +# Don't use :- since 4.3BSD and earlier shells don't like it. +doit="${DOITPROG-}" + +# put in absolute paths if you don't have them in your path; or use env. vars. + +mvprog="${MVPROG-mv}" +cpprog="${CPPROG-cp}" +chmodprog="${CHMODPROG-chmod}" +chownprog="${CHOWNPROG-chown}" +chgrpprog="${CHGRPPROG-chgrp}" +stripprog="${STRIPPROG-strip}" +rmprog="${RMPROG-rm}" +mkdirprog="${MKDIRPROG-mkdir}" + +chmodcmd="$chmodprog 0755" +chowncmd= +chgrpcmd= +stripcmd= +rmcmd="$rmprog -f" +mvcmd="$mvprog" +src= +dst= +dir_arg= +dstarg= +no_target_directory= + +usage="Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE + or: $0 [OPTION]... SRCFILES... DIRECTORY + or: $0 [OPTION]... -t DIRECTORY SRCFILES... + or: $0 [OPTION]... -d DIRECTORIES... + +In the 1st form, copy SRCFILE to DSTFILE. +In the 2nd and 3rd, copy all SRCFILES to DIRECTORY. +In the 4th, create DIRECTORIES. + +Options: +-c (ignored) +-d create directories instead of installing files. +-g GROUP $chgrpprog installed files to GROUP. +-m MODE $chmodprog installed files to MODE. +-o USER $chownprog installed files to USER. +-s $stripprog installed files. +-t DIRECTORY install into DIRECTORY. +-T report an error if DSTFILE is a directory. +--help display this help and exit. +--version display version info and exit. + +Environment variables override the default commands: + CHGRPPROG CHMODPROG CHOWNPROG CPPROG MKDIRPROG MVPROG RMPROG STRIPPROG +" + +while test -n "$1"; do + case $1 in + -c) shift + continue;; + + -d) dir_arg=true + shift + continue;; + + -g) chgrpcmd="$chgrpprog $2" + shift + shift + continue;; + + --help) echo "$usage"; exit $?;; + + -m) chmodcmd="$chmodprog $2" + shift + shift + continue;; + + -o) chowncmd="$chownprog $2" + shift + shift + continue;; + + -s) stripcmd=$stripprog + shift + continue;; + + -t) dstarg=$2 + shift + shift + continue;; + + -T) no_target_directory=true + shift + continue;; + + --version) echo "$0 $scriptversion"; exit $?;; + + *) # When -d is used, all remaining arguments are directories to create. + # When -t is used, the destination is already specified. + test -n "$dir_arg$dstarg" && break + # Otherwise, the last argument is the destination. Remove it from $@. + for arg + do + if test -n "$dstarg"; then + # $@ is not empty: it contains at least $arg. + set fnord "$@" "$dstarg" + shift # fnord + fi + shift # arg + dstarg=$arg + done + break;; + esac +done + +if test -z "$1"; then + if test -z "$dir_arg"; then + echo "$0: no input file specified." >&2 + exit 1 + fi + # It's OK to call `install-sh -d' without argument. + # This can happen when creating conditional directories. + exit 0 +fi + +for src +do + # Protect names starting with `-'. + case $src in + -*) src=./$src ;; + esac + + if test -n "$dir_arg"; then + dst=$src + src= + + if test -d "$dst"; then + mkdircmd=: + chmodcmd= + else + mkdircmd=$mkdirprog + fi + else + # Waiting for this to be detected by the "$cpprog $src $dsttmp" command + # might cause directories to be created, which would be especially bad + # if $src (and thus $dsttmp) contains '*'. + if test ! -f "$src" && test ! -d "$src"; then + echo "$0: $src does not exist." >&2 + exit 1 + fi + + if test -z "$dstarg"; then + echo "$0: no destination specified." >&2 + exit 1 + fi + + dst=$dstarg + # Protect names starting with `-'. + case $dst in + -*) dst=./$dst ;; + esac + + # If destination is a directory, append the input filename; won't work + # if double slashes aren't ignored. + if test -d "$dst"; then + if test -n "$no_target_directory"; then + echo "$0: $dstarg: Is a directory" >&2 + exit 1 + fi + dst=$dst/`basename "$src"` + fi + fi + + # This sed command emulates the dirname command. + dstdir=`echo "$dst" | sed -e 's,/*$,,;s,[^/]*$,,;s,/*$,,;s,^$,.,'` + + # Make sure that the destination directory exists. + + # Skip lots of stat calls in the usual case. + if test ! -d "$dstdir"; then + defaultIFS=' + ' + IFS="${IFS-$defaultIFS}" + + oIFS=$IFS + # Some sh's can't handle IFS=/ for some reason. + IFS='%' + set x `echo "$dstdir" | sed -e 's@/@%@g' -e 's@^%@/@'` + shift + IFS=$oIFS + + pathcomp= + + while test $# -ne 0 ; do + pathcomp=$pathcomp$1 + shift + if test ! -d "$pathcomp"; then + $mkdirprog "$pathcomp" + # mkdir can fail with a `File exist' error in case several + # install-sh are creating the directory concurrently. This + # is OK. + test -d "$pathcomp" || exit + fi + pathcomp=$pathcomp/ + done + fi + + if test -n "$dir_arg"; then + $doit $mkdircmd "$dst" \ + && { test -z "$chowncmd" || $doit $chowncmd "$dst"; } \ + && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } \ + && { test -z "$stripcmd" || $doit $stripcmd "$dst"; } \ + && { test -z "$chmodcmd" || $doit $chmodcmd "$dst"; } + + else + dstfile=`basename "$dst"` + + # Make a couple of temp file names in the proper directory. + dsttmp=$dstdir/_inst.$$_ + rmtmp=$dstdir/_rm.$$_ + + # Trap to clean up those temp files at exit. + trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0 + trap '(exit $?); exit' 1 2 13 15 + + # Copy the file name to the temp name. + $doit $cpprog "$src" "$dsttmp" && + + # and set any options; do chmod last to preserve setuid bits. + # + # If any of these fail, we abort the whole thing. If we want to + # ignore errors from any of these, just make sure not to ignore + # errors from the above "$doit $cpprog $src $dsttmp" command. + # + { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } \ + && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } \ + && { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } \ + && { test -z "$chmodcmd" || $doit $chmodcmd "$dsttmp"; } && + + # Now rename the file to the real destination. + { $doit $mvcmd -f "$dsttmp" "$dstdir/$dstfile" 2>/dev/null \ + || { + # The rename failed, perhaps because mv can't rename something else + # to itself, or perhaps because mv is so ancient that it does not + # support -f. + + # Now remove or move aside any old file at destination location. + # We try this two ways since rm can't unlink itself on some + # systems and the destination file might be busy for other + # reasons. In this case, the final cleanup might fail but the new + # file should still install successfully. + { + if test -f "$dstdir/$dstfile"; then + $doit $rmcmd -f "$dstdir/$dstfile" 2>/dev/null \ + || $doit $mvcmd -f "$dstdir/$dstfile" "$rmtmp" 2>/dev/null \ + || { + echo "$0: cannot unlink or rename $dstdir/$dstfile" >&2 + (exit 1); exit 1 + } + else + : + fi + } && + + # Now rename the file to the real destination. + $doit $mvcmd "$dsttmp" "$dstdir/$dstfile" + } + } + fi || { (exit 1); exit 1; } +done + +# The final little trick to "correctly" pass the exit status to the exit trap. +{ + (exit 0); exit 0 +} + +# Local variables: +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-end: "$" +# End: diff --git a/app/twm/man/Makefile.am b/app/twm/man/Makefile.am new file mode 100644 index 000000000..1a67b5128 --- /dev/null +++ b/app/twm/man/Makefile.am @@ -0,0 +1,54 @@ +# $Id: Makefile.am,v 1.1.1.1 2006/11/26 14:11:21 matthieu Exp $ +# +# Copyright 2005 Sun Microsystems, Inc. All rights reserved. +# +# Permission to use, copy, modify, distribute, and sell this software and its +# documentation for any purpose is hereby granted without fee, provided that +# the above copyright notice appear in all copies and that both that +# copyright notice and this permission notice appear in supporting +# documentation. +# +# The above copyright notice and this permission notice shall be included +# in all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +# IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR +# OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +# ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +# OTHER DEALINGS IN THE SOFTWARE. +# +# Except as contained in this notice, the name of the copyright holders shall +# not be used in advertising or otherwise to promote the sale, use or +# other dealings in this Software without prior written authorization +# from the copyright holders. +# + +appmandir = $(APP_MAN_DIR) + +appman_PRE = twm.man + +appman_DATA = $(appman_PRE:man=@APP_MAN_SUFFIX@) + +EXTRA_DIST = $(appman_PRE) + +CLEANFILES = $(appman_DATA) + +SED = sed + +# Strings to replace in man pages +XORGRELSTRING = @PACKAGE_STRING@ + XORGMANNAME = X Version 11 + +MAN_SUBSTS = \ + -e 's|__xorgversion__|"$(XORGRELSTRING)" "$(XORGMANNAME)"|' \ + -e 's|__projectroot__|$(prefix)|g' \ + -e 's|__appmansuffix__|$(APP_MAN_SUFFIX)|g' \ + -e 's|__miscmansuffix__|$(MISC_MAN_SUFFIX)|g' \ + -e 's|__filemansuffix__|$(FILE_MAN_SUFFIX)|g' + +SUFFIXES = .$(APP_MAN_SUFFIX) .man + +.man.$(APP_MAN_SUFFIX): + sed $(MAN_SUBSTS) < $< > $@ diff --git a/app/twm/man/Makefile.in b/app/twm/man/Makefile.in new file mode 100644 index 000000000..5d0c472b7 --- /dev/null +++ b/app/twm/man/Makefile.in @@ -0,0 +1,383 @@ +# Makefile.in generated by automake 1.9.6 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005 Free Software Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +# $Id: Makefile.in,v 1.1.1.1 2006/11/26 14:11:21 matthieu Exp $ +# +# Copyright 2005 Sun Microsystems, Inc. All rights reserved. +# +# Permission to use, copy, modify, distribute, and sell this software and its +# documentation for any purpose is hereby granted without fee, provided that +# the above copyright notice appear in all copies and that both that +# copyright notice and this permission notice appear in supporting +# documentation. +# +# The above copyright notice and this permission notice shall be included +# in all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +# IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR +# OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +# ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +# OTHER DEALINGS IN THE SOFTWARE. +# +# Except as contained in this notice, the name of the copyright holders shall +# not be used in advertising or otherwise to promote the sale, use or +# other dealings in this Software without prior written authorization +# from the copyright holders. +# + +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +top_builddir = .. +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +INSTALL = @INSTALL@ +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +subdir = man +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +SOURCES = +DIST_SOURCES = +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = `echo $$p | sed -e 's|^.*/||'`; +am__installdirs = "$(DESTDIR)$(appmandir)" +appmanDATA_INSTALL = $(INSTALL_DATA) +DATA = $(appman_DATA) +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +ADMIN_MAN_DIR = @ADMIN_MAN_DIR@ +ADMIN_MAN_SUFFIX = @ADMIN_MAN_SUFFIX@ +AMDEP_FALSE = @AMDEP_FALSE@ +AMDEP_TRUE = @AMDEP_TRUE@ +AMTAR = @AMTAR@ +APP_MAN_DIR = @APP_MAN_DIR@ +APP_MAN_SUFFIX = @APP_MAN_SUFFIX@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPPFLAGS = @CPPFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DRIVER_MAN_DIR = @DRIVER_MAN_DIR@ +DRIVER_MAN_SUFFIX = @DRIVER_MAN_SUFFIX@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EXEEXT = @EXEEXT@ +FILE_MAN_DIR = @FILE_MAN_DIR@ +FILE_MAN_SUFFIX = @FILE_MAN_SUFFIX@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LDFLAGS = @LDFLAGS@ +LEX = @LEX@ +LEXLIB = @LEXLIB@ +LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIB_MAN_DIR = @LIB_MAN_DIR@ +LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@ +LTLIBOBJS = @LTLIBOBJS@ +MAINT = @MAINT@ +MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@ +MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@ +MAKEINFO = @MAKEINFO@ +MISC_MAN_DIR = @MISC_MAN_DIR@ +MISC_MAN_SUFFIX = @MISC_MAN_SUFFIX@ +OBJEXT = @OBJEXT@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PKG_CONFIG = @PKG_CONFIG@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +TWM_CFLAGS = @TWM_CFLAGS@ +TWM_LIBS = @TWM_LIBS@ +VERSION = @VERSION@ +YACC = @YACC@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_STRIP = @ac_ct_STRIP@ +ac_pt_PKG_CONFIG = @ac_pt_PKG_CONFIG@ +am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ +am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +datadir = @datadir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +appmandir = $(APP_MAN_DIR) +appman_PRE = twm.man +appman_DATA = $(appman_PRE:man=@APP_MAN_SUFFIX@) +EXTRA_DIST = $(appman_PRE) +CLEANFILES = $(appman_DATA) +SED = sed + +# Strings to replace in man pages +XORGRELSTRING = @PACKAGE_STRING@ +XORGMANNAME = X Version 11 +MAN_SUBSTS = \ + -e 's|__xorgversion__|"$(XORGRELSTRING)" "$(XORGMANNAME)"|' \ + -e 's|__projectroot__|$(prefix)|g' \ + -e 's|__appmansuffix__|$(APP_MAN_SUFFIX)|g' \ + -e 's|__miscmansuffix__|$(MISC_MAN_SUFFIX)|g' \ + -e 's|__filemansuffix__|$(FILE_MAN_SUFFIX)|g' + +SUFFIXES = .$(APP_MAN_SUFFIX) .man +all: all-am + +.SUFFIXES: +.SUFFIXES: .$(APP_MAN_SUFFIX) .man +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu man/Makefile'; \ + cd $(top_srcdir) && \ + $(AUTOMAKE) --gnu man/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +uninstall-info-am: +install-appmanDATA: $(appman_DATA) + @$(NORMAL_INSTALL) + test -z "$(appmandir)" || $(mkdir_p) "$(DESTDIR)$(appmandir)" + @list='$(appman_DATA)'; for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + f=$(am__strip_dir) \ + echo " $(appmanDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(appmandir)/$$f'"; \ + $(appmanDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(appmandir)/$$f"; \ + done + +uninstall-appmanDATA: + @$(NORMAL_UNINSTALL) + @list='$(appman_DATA)'; for p in $$list; do \ + f=$(am__strip_dir) \ + echo " rm -f '$(DESTDIR)$(appmandir)/$$f'"; \ + rm -f "$(DESTDIR)$(appmandir)/$$f"; \ + done +tags: TAGS +TAGS: + +ctags: CTAGS +CTAGS: + + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ + list='$(DISTFILES)'; for file in $$list; do \ + case $$file in \ + $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ + $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ + esac; \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test "$$dir" != "$$file" && test "$$dir" != "."; then \ + dir="/$$dir"; \ + $(mkdir_p) "$(distdir)$$dir"; \ + else \ + dir=''; \ + fi; \ + if test -d $$d/$$file; then \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ + fi; \ + cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ + else \ + test -f $(distdir)/$$file \ + || cp -p $$d/$$file $(distdir)/$$file \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile $(DATA) +installdirs: + for dir in "$(DESTDIR)$(appmandir)"; do \ + test -z "$$dir" || $(mkdir_p) "$$dir"; \ + done +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic mostlyclean-am + +distclean: distclean-am + -rm -f Makefile +distclean-am: clean-am distclean-generic + +dvi: dvi-am + +dvi-am: + +html: html-am + +info: info-am + +info-am: + +install-data-am: install-appmanDATA + +install-exec-am: + +install-info: install-info-am + +install-man: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-generic + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-appmanDATA uninstall-info-am + +.PHONY: all all-am check check-am clean clean-generic distclean \ + distclean-generic distdir dvi dvi-am html html-am info info-am \ + install install-am install-appmanDATA install-data \ + install-data-am install-exec install-exec-am install-info \ + install-info-am install-man install-strip installcheck \ + installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-generic pdf \ + pdf-am ps ps-am uninstall uninstall-am uninstall-appmanDATA \ + uninstall-info-am + + +.man.$(APP_MAN_SUFFIX): + sed $(MAN_SUBSTS) < $< > $@ +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/app/twm/man/twm.man b/app/twm/man/twm.man new file mode 100644 index 000000000..888e57fd4 --- /dev/null +++ b/app/twm/man/twm.man @@ -0,0 +1,1285 @@ +.\" $Xorg: twm.man,v 1.4 2001/02/09 02:05:37 xorgcvs Exp $ +.\" Copyright 1993, 1994, 1998 The Open Group +.\" Portions copyright 1988 Evans & Sutherland Computer Corporation. +.\" Portions copyright 1989 Hewlett-Packard Company +.\" +.\" Permission to use, copy, modify, distribute, and sell this software and its +.\" documentation for any purpose is hereby granted without fee, provided that +.\" the above copyright notice appear in all copies and that both that +.\" copyright notice and this permission notice appear in supporting +.\" documentation. +.\" +.\" The above copyright notice and this permission notice shall be included +.\" in all copies or substantial portions of the Software. +.\" +.\" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +.\" OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +.\" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +.\" IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR +.\" OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +.\" ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +.\" OTHER DEALINGS IN THE SOFTWARE. +.\" +.\" Except as contained in this notice, the name of The Open Group shall +.\" not be used in advertising or otherwise to promote the sale, use or +.\" other dealings in this Software without prior written authorization +.\" from The Open Group. +.\" +.\" $XFree86: xc/programs/twm/twm.man,v 1.9 2001/12/14 20:01:10 dawes Exp $ +.\" +.de EX \"Begin example +.ne 5 +.if n .sp 1 +.if t .sp .5 +.nf +.in +.5i +.. +.de EE +.fi +.in -.5i +.if n .sp 1 +.if t .sp .5 +.. +.ta .3i .6i .9i 1.2i 1.5i 1.8i +.TH TWM 1 __xorgversion__ +.SH NAME +twm \- Tab Window Manager for the X Window System +.SH SYNTAX +\fBtwm \fP[ \fB\-display\fP \fIdpy\fP ] [ \fB\-s\fP ] +[ \fB\-f\fP \fIinitfile\fP ] [ \fB\-v\fP ] +.SH DESCRIPTION +\fITwm\fP is a window manager for the X Window System. It provides +titlebars, shaped windows, +several forms of icon management, user-defined macro functions, +click-to-type and pointer-driven keyboard focus, and user-specified +key and pointer button bindings. +.PP +This program is usually started by the user's session manager or +startup script. When used from \fIxdm(1)\fP or \fIxinit(1)\fP without +a session manager, \fItwm\fP is frequently executed in the foreground +as the last client. When run this way, exiting \fItwm\fP causes the +session to be terminated (i.e., logged out). +.PP +By default, application windows are surrounded by a ``frame'' with a +titlebar at the top and a special border around the window. The titlebar +contains the window's name, a rectangle that is lit when the window is +receiving keyboard input, and function boxes known as ``titlebuttons'' at +the left and right edges of the titlebar. +.PP +Pressing pointer Button1 (usually the left-most +button unless it has been changed with \fIxmodmap\fP) on a +titlebutton will invoke the function associated with the button. +In the default interface, windows are iconified by clicking (pressing +and then immediately releasing) the left titlebutton (which looks +like a Dot). Conversely, windows are deiconified by clicking in the +associated icon or entry in the icon manager +(see description of the variable +\fBShowIconManager\fP and of the function \fBf.showiconmgr\fP). +.PP +Windows are resized by pressing the right titlebutton (which resembles a +group of nested squares), dragging the pointer over edge that is to be +moved, and releasing the pointer when the outline of the window is the desired +size. Similarly, windows are moved by pressing in the title or highlight +region, dragging a window outline to the new location, and then releasing +when the outline is in the desired position. Just +clicking in the title or highlight region raises the window without moving it. +.PP +When new windows are created, \fItwm\fP will honor any size and location +information requested by the user (usually through \fI-geometry\fP +command line argument or resources for the individual applications). +Otherwise, an outline of the window's default size, its titlebar, and lines +dividing the +window into a 3x3 grid that track the pointer are displayed. +Clicking pointer Button1 +will position the window at the current position and give it the default +size. Pressing pointer Button2 (usually the middle pointer button) +and dragging the outline +will give the window its current position but allow the sides to be resized as +described above. Clicking pointer Button3 (usually the right pointer button) +will give the window its current position but attempt to make it long enough +to touch the bottom the screen. +.SH OPTIONS +\fITwm\fP accepts the following command line options: +.PP +.TP 8 +.B \-display \fIdpy\fP +This option specifies the X server to use. +.TP 8 +.B \-s +This option indicates that only the default screen (as specified by +\fB\-display\fP or by the \fBDISPLAY\fP environment variable) should be +managed. By default, \fItwm\fP will attempt to manage +all screens on the display. +.TP 8 +.B \-f \fIfilename\fP +This option specifies the name of the startup file to use. By default, +\fItwm\fP will look in the user's home directory for files +named \fI.twmrc.num\fP (where \fInum\fP is a screen number) or \fI.twmrc\fP. +.TP 8 +.B \-v +This option indicates that \fItwm\fP should print error messages whenever +an unexpected X Error event is received. This can be useful when debugging +applications but can be distracting in regular use. +.SH CUSTOMIZATION +.PP +Much of \fItwm\fP's appearance and behavior can be controlled by providing +a startup file in one of the following locations (searched in order for +each screen being managed when \fItwm\fP begins): +.TP 8 +.B "$HOME/.twmrc.\fIscreennumber\fP" +The \fIscreennumber\fP is a small positive number (e.g. 0, 1, etc.) +representing the screen number (e.g. the last number in the DISPLAY environment +variable \fIhost:displaynum.screennum\fP) that would be used to contact that +screen of the display. This is intended for displays with multiple screens of +differing visual types. +.TP 8 +.B "$HOME/.twmrc" +This is the usual name for an individual user's startup file. +.TP 8 +.B __projectroot__/lib/X11/twm/system.twmrc +If neither of the preceding files are found, \fItwm\fP will look in this +file for a +default configuration. This is often tailored by the site administrator to +provide convenient menus or familiar bindings for novice users. +.PP +If no startup files are found, \fItwm\fP will use the built-in defaults +described above. The only resource used by \fItwm\fP is +\fIbitmapFilePath\fP for a colon-separated list of directories to search +when looking for bitmap files (for more information, see the \fIAthena +Widgets\fP manual and \fIxrdb(1)\fP). +.PP +\fITwm\fP startup files are logically broken up into three types of +specifications: \fIVariables\fP, \fIBindings\fP, \fIMenus\fP. The +\fIVariables\fP section must come first and is used to describe the +fonts, colors, cursors, border widths, icon and window placement, highlighting, +autoraising, layout of titles, warping, use of the icon manager. +The \fIBindings\fP section usually comes second and is used to specify +the functions that should be +to be invoked when keyboard and pointer buttons are pressed in +windows, icons, titles, and frames. The \fIMenus\fP section gives any +user-defined menus (containing functions to be invoked or +commands to be executed). +.PP +Variable names and keywords are case-insensitive. Strings must be surrounded +by double quote characters (e.g. "blue") and are case-sensitive. +A pound sign (#) outside +of a string causes the remainder of the line in which the character appears to +be treated as a comment. +.SH VARIABLES +.PP +Many of the aspects of \fItwm\fP's user interface are controlled by variables +that may be set in the user's startup file. Some of the options are +enabled or disabled simply by the presence of a particular keyword. Other +options require keywords, numbers, strings, or lists of all of these. +.PP +Lists are surrounded by braces and are usually separated by +whitespace or a newline. For example: +.EX 0 +\fBAutoRaise\fP { "emacs" "XTerm" "Xmh" } +.EE +or +.EX 0 +\fBAutoRaise\fP +{ + "emacs" + "XTerm" + "Xmh" +} +.EE +When a variable containing a list of strings representing windows is searched +(e.g. to determine whether or not to enable autoraise as shown above), a string +must be an exact, case-sensitive match to +the window's name (given by the WM_NAME window property), resource name +or class name (both given by the WM_CLASS window property). The preceding +example would enable autoraise on windows named ``emacs'' as well as any +\fIxterm\fP (since they are of class ``XTerm'') or xmh windows +(which are of class ``Xmh''). +.PP +String arguments that are interpreted as filenames (see the \fBPixmaps\fP, +\fBCursors\fP, and \fBIconDirectory\fP below) will +prepend the user's directory +(specified by the \fBHOME\fP environment variable) if the first character is a +tilde (~). If, instead, the first character is a colon (:), the name is +assumed to refer to one of the internal bitmaps that are used to +create the default titlebars symbols: \fB:xlogo\fP +or \fB:delete\fP (both refer to the X logo), +\fB:dot\fP or \fB:iconify\fP (both refer to the dot), +\fB:resize\fP (the nested squares used by the resize button), +\fB:menu\fP (a page with lines), +and \fB:question\fP (the question mark used for non-existent +bitmap files). +.PP +The following variables may be specified at the top of a \fItwm\fP startup +file. Lists of Window name prefix strings are indicated by \fIwin-list\fP. +Optional arguments are shown in square brackets: +.IP "\fBAutoRaise\fP { \fIwin-list\fP }" 8 +This variable specifies a list of windows that should automatically be +raised whenever the pointer enters the window. This action can be +interactively +enabled or disabled on individual windows using the function \fBf.autoraise\fP. +.IP "\fBAutoRelativeResize\fP" 8 +This variable indicates that dragging out a window size (either when +initially sizing the window with pointer Button2 or when resizing it) +should not wait until the pointer has crossed the window edges. +Instead, moving +the pointer automatically causes the nearest edge or edges to move by the +same amount. This allows the resizing of windows that extend off +the edge of the screen. +If the pointer is +in the center of the window, or if the resize is begun by pressing a +titlebutton, \fItwm\fP will still wait for the pointer to cross a window +edge (to prevent accidents). This option is +particularly useful for people who like the press-drag-release method of +sweeping out window sizes. +.IP "\fBBorderColor\fP \fIstring\fP [{ \fIwincolorlist\fP }]" 8 +This variable specifies the default color of the border to be placed around +all +non-iconified windows, and may only be given within a \fBColor\fP, +\fBGrayscale\fP or +\fBMonochrome\fP list. The optional \fIwincolorlist\fP specifies a list +of window and color name pairs for specifying particular border colors for +different types of windows. For example: +.EX 0 +\fBBorderColor\fP "gray50" +{ + "XTerm" "red" + "xmh" "green" +} +.EE +The default is "black". +.IP "\fBBorderTileBackground\fP \fIstring\fP [{ \fIwincolorlist\fP }]" 8 +This variable specifies the default background color in the gray pattern +used in unhighlighted borders (only if \fBNoHighlight\fP hasn't been set), +and may only be given within a \fBColor\fP, \fBGrayscale\fP or \fBMonochrome\fP list. The +optional \fIwincolorlist\fP allows per-window colors to be specified. +The default is "white". +.IP "\fBBorderTileForeground\fP \fIstring\fP [{ \fIwincolorlist\fP }]" 8 +This variable specifies the default foreground color in the gray pattern +used in unhighlighted borders (only +if \fBNoHighlight\fP hasn't been set), and may only be given within a +\fBColor\fP, \fBGrayscale\fP or \fBMonochrome\fP list. The optional \fIwincolorlist\fP allows +per-window colors to be specified. The default is "black". +.IP "\fBBorderWidth\fP \fIpixels\fP" 8 +This variable specifies the width in pixels of the border surrounding +all client window frames if \fBClientBorderWidth\fP has not been specified. +This value is also used to set the border size of windows created by \fItwm\fP +(such as the icon manager). The default is 2. +.IP "\fBButtonIndent\fP \fIpixels\fP" 8 +This variable specifies the amount by which titlebuttons should be +indented on all sides. Positive values cause the buttons to be smaller than +the window text and highlight area so that they stand out. Setting this +and the \fBTitleButtonBorderWidth\fP variables to 0 makes titlebuttons be as +tall and wide as possible. The default is 1. +.IP "\fBClientBorderWidth\fP" 8 +This variable indicates that border width of a window's frame should be set to +the initial border width of the window, rather than to the value of +\fBBorderWidth\fP. +.IP "\fBColor\fP { \fIcolors-list\fP }" 8 +This variable specifies a list of color assignments to be made if the default +display is capable of displaying more than simple black and white. The +\fIcolors-list\fP is made up of the following color variables and their values: +\fBDefaultBackground\fP, +\fBDefaultForeground\fP, +\fBMenuBackground\fP, +\fBMenuForeground\fP, +\fBMenuTitleBackground\fP, +\fBMenuTitleForeground\fP, +\fBMenuShadowColor\fP, +\fBMenuBorderColor\fP, +\fBPointerForeground\fP, and +\fBPointerBackground\fP. +The following +color variables may also be given a list of window and color name pairs to +allow per-window colors to be specified (see \fBBorderColor\fP for details): +\fBBorderColor\fP, +\fBIconManagerHighlight\fP, +\fBBorderTitleBackground\fP, +\fBBorderTitleForeground\fP, +\fBTitleBackground\fP, +\fBTitleForeground\fP, +\fBIconBackground\fP, +\fBIconForeground\fP, +\fBIconBorderColor\fP, +\fBIconManagerBackground\fP, and +\fBIconManagerForeground\fP. +For example: +.EX 0 +\fBColor\fP +{ + MenuBackground "gray50" + MenuForeground "blue" + BorderColor "red" { "XTerm" "yellow" } + TitleForeground "yellow" + TitleBackground "blue" +} +.EE +All of these color variables may also be specified for the \fBMonochrome\fP +variable, allowing the same initialization file to be used on both color and +monochrome displays. +.IP "\fBConstrainedMoveTime\fP \fImilliseconds\fP" 8 +This variable specifies the length of time between button clicks needed to +begin +a constrained move operation. Double clicking within this amount +of time when invoking \fBf.move\fP will cause the window to be moved only +in a horizontal or vertical direction. Setting this value to 0 will disable +constrained moves. The default is 400 milliseconds. +.IP "\fBCursors\fP { \fIcursor-list\fP }" 8 +This variable specifies the glyphs that \fItwm\fP should use for various +pointer cursors. Each cursor +may be defined either from the \fBcursor\fP font or from two bitmap files. +Shapes from the \fBcursor\fP font may be specified directly as: +.EX 0 + \fIcursorname\fP "\fIstring\fP" +.EE +where \fIcursorname\fP is one of the cursor names listed below, and +\fIstring\fP is the name of a glyph as found in the file +.I __projectroot__/include/X11/cursorfont.h +(without the ``XC_'' prefix). +If the cursor is to be defined +from bitmap files, the following syntax is used instead: +.EX 0 + \fIcursorname\fP "\fIimage\fP" "\fImask\fP" +.EE +The \fIimage\fP and \fImask\fP strings specify the names of files containing +the glyph image and mask in \fIbitmap(1)\fP form. +The bitmap files are located in the same manner as icon bitmap files. +The following example shows the default cursor definitions: +.EX 0 +\fBCursors\fP +{ + Frame "top_left_arrow" + Title "top_left_arrow" + Icon "top_left_arrow" + IconMgr "top_left_arrow" + Move "fleur" + Resize "fleur" + Menu "sb_left_arrow" + Button "hand2" + Wait "watch" + Select "dot" + Destroy "pirate" +} +.EE +.IP "\fBDecorateTransients\fP" 8 +This variable indicates that transient windows (those containing a +WM_TRANSIENT_FOR property) should have titlebars. By default, transients +are not reparented. +.IP "\fBDefaultBackground\fP \fIstring\fP" 8 +This variable specifies the background color to be used for sizing and +information windows. The default is "white". +.IP "\fBDefaultForeground\fP \fIstring\fP" 8 +This variable specifies the foreground color to be used for sizing and +information windows. The default is "black". +.IP "\fBDontIconifyByUnmapping\fP { \fIwin-list\fP }" 8 +This variable specifies a list of windows that should not be iconified by +simply unmapping the window (as would be the case if \fBIconifyByUnmapping\fP +had been set). This is frequently used to force some windows to be treated +as icons while other windows are handled by the icon manager. +.IP "\fBDontMoveOff\fP" 8 +This variable indicates that windows should not be allowed to be moved off the +screen. It can be overridden by the \fBf.forcemove\fP function. +.IP "\fBDontSqueezeTitle\fP [{ \fIwin-list\fP }] " 8 +This variable indicates that titlebars should not be squeezed to their +minimum size as described under \fBSqueezeTitle\fP below. +If the optional window list is supplied, only those windows will be +prevented from being squeezed. +.IP "\fBForceIcons\fP" 8 +This variable indicates that icon pixmaps specified in the \fBIcons\fP +variable should override any client-supplied pixmaps. +.IP "\fBFramePadding\fP \fIpixels\fP" 8 +This variable specifies the distance between the titlebar decorations (the +button and text) and the window frame. The default is 2 pixels. +.IP "\fBGrayscale\fP { \fIcolors\fP }" 8 +This variable specifies a list of color assignments that should be made if +the screen has a GrayScale default visual. See the description of \fBColors\fP. +.IP "\fBIconBackground\fP \fIstring\fP [{ \fIwin-list\fP }]" 8 +This variable specifies the background color of icons, and may +only be specified inside of a \fBColor\fP, \fBGrayscale\fP or \fBMonochrome\fP list. +The optional \fIwin-list\fP is a list of window names and colors so that +per-window colors may be specified. See the \fBBorderColor\fP +variable for a complete description of the \fIwin-list\fP. +The default is "white". +.IP "\fBIconBorderColor\fP \fIstring\fP [{ \fIwin-list\fP }]" 8 +This variable specifies the color of the border used for icon windows, and +may only be specified inside of a \fBColor\fP, \fBGrayscale\fP or \fBMonochrome\fP list. +The optional \fIwin-list\fP is a list of window names and colors so that +per-window colors may be specified. See the \fBBorderColor\fP +variable for a complete description of the \fIwin-list\fP. +The default is "black". +.IP "\fBIconBorderWidth\fP \fIpixels\fP" 8 +This variable specifies the width in pixels of the border surrounding +icon windows. The default is 2. +.IP "\fBIconDirectory\fP \fIstring\fP" 8 +This variable specifies the directory that should be searched if +if a bitmap file cannot be found in any of the directories +in the \fBbitmapFilePath\fP resource. +.IP "\fBIconFont\fP \fIstring\fP" 8 +This variable specifies the font to be used to display icon names within +icons. The default is "variable". +.IP "\fBIconForeground\fP \fIstring\fP [{ \fIwin-list\fP }]" 8 +This variable specifies the foreground color to be used when displaying icons, +and may only be specified inside of a +\fBColor\fP, \fBGrayscale\fP or \fBMonochrome\fP list. +The optional \fIwin-list\fP is a list of window names and colors so that +per-window colors may be specified. See the \fBBorderColor\fP +variable for a complete description of the \fIwin-list\fP. +The default is "black". +.IP "\fBIconifyByUnmapping [{ \fIwin-list\fP }]\fP" 8 +This variable indicates that windows should be iconified by being unmapped +without trying to map any icons. This assumes that the user will +remap the window through the icon manager, the \fBf.warpto\fP function, or +the \fITwmWindows\fP menu. +If the optional \fIwin-list\fP is provided, only those windows will be +iconified by simply unmapping. Windows that have both this and the +\fBIconManagerDontShow\fP options set may not be accessible if no binding +to the \fITwmWindows\fP menu is set in the user's startup file. +.IP "\fBIconManagerBackground\fP \fIstring\fP [{ \fIwin-list\fP }]" 8 +This variable specifies the background color to use for icon manager entries, +and may only be specified inside of a +\fBColor\fP, \fBGrayscale\fP or \fBMonochrome\fP list. +The optional \fIwin-list\fP is a list of window names and colors so that +per-window colors may be specified. See the \fBBorderColor\fP +variable for a complete description of the \fIwin-list\fP. +The default is "white". +.IP "\fBIconManagerDontShow\fP [{ \fIwin-list\fP }]" 8 +This variable indicates that the icon manager should not display any +windows. If the optional \fIwin-list\fP is given, only those windows will +not be displayed. This variable is used to prevent windows that are rarely +iconified (such as \fIxclock\fP or \fIxload\fP) from taking up space in +the icon manager. +.IP "\fBIconManagerFont\fP \fIstring\fP" 8 +This variable specifies the font to be used when displaying icon manager +entries. The default is "variable". +.IP "\fBIconManagerForeground\fP \fIstring\fP [{ \fIwin-list\fP }]" 8 +This variable specifies the foreground color to be used when displaying +icon manager entries, and may only be specified inside of a +\fBColor\fP, \fBGrayscale\fP or \fBMonochrome\fP list. +The optional \fIwin-list\fP is a list of window names and colors so that +per-window colors may be specified. See the \fBBorderColor\fP +variable for a complete description of the \fIwin-list\fP. +The default is "black". +.IP "\fBIconManagerGeometry\fP \fIstring\fP [ \fIcolumns\fP ]" 8 +This variable specifies the geometry of the icon manager window. The +\fIstring\fP argument is standard geometry specification that indicates +the initial full size of the icon manager. The icon manager window is +then broken into \fIcolumns\fP pieces and scaled according to the number +of entries in the icon manager. Extra entries are wrapped to form +additional rows. The default number of columns is 1. +.IP "\fBIconManagerHighlight\fP \fIstring\fP [{ \fIwin-list\fP }]" 8 +This variable specifies the border color to be used when highlighting +the icon manager entry that currently has the focus, +and can only be specified inside of a +\fBColor\fP, \fBGrayscale\fP or \fBMonochrome\fP list. +The optional \fIwin-list\fP is a list of window names and colors so that +per-window colors may be specified. See the \fBBorderColor\fP +variable for a complete description of the \fIwin-list\fP. +The default is "black". +.IP "\fBIconManagers\fP { \fIiconmgr-list\fP }" 8 +This variable specifies a list of icon managers to create. Each item in the +\fIiconmgr-list\fP has the following format: +.EX 0 + "\fIwinname\fP" ["\fIiconname\fP"] "\fIgeometry\fP" \fIcolumns\fP +.EE +where \fIwinname\fP is the name of the windows that should be put into this +icon manager, \fIiconname\fP is the name of that icon manager window's icon, +\fIgeometry\fP is a standard geometry specification, and \fIcolumns\fP is +the number of columns in this icon manager as described in +\fBIconManagerGeometry\fP. For example: +.EX 0 +\fBIconManagers\fP +{ + "XTerm" "=300x5+800+5" 5 + "myhost" "=400x5+100+5" 2 +} +.EE +Clients whose name or class is ``XTerm'' will have an entry created +in the ``XTerm'' icon manager. Clients whose name was ``myhost'' would +be put into the ``myhost'' icon manager. +.IP "\fBIconManagerShow\fP { \fIwin-list\fP }" 8 +This variable specifies a list of windows that should appear in the icon +manager. When used in conjunction with the \fBIconManagerDontShow\fP +variable, only the windows in this list will be shown in the icon manager. +.IP "\fBIconRegion\fP \fIgeomstring\fP \fIvgrav hgrav gridwidth gridheight\fP" +This variable specifies an area on the root window in which icons are placed +if no specific icon location is provided by the client. The \fIgeomstring\fP +is a quoted string containing a standard geometry specification. +If more than one +\fBIconRegion\fP lines are given, +icons will be put into the succeeding icon regions when the first is full. +The \fIvgrav\fP argument should be either \fBNorth\fP or \fBSouth\fP and +control and is used to control whether icons are first filled in from the +top or bottom of the icon region. Similarly, the \fIhgrav\fP argument should +be either \fBEast\fP or \fBWest\fP and is used to control whether icons should +be filled in from left from the right. Icons are laid out within the region +in a grid with cells \fIgridwidth\fP pixels wide and \fIgridheight\fP pixels +high. +.IP "\fBIcons\fP { \fIwin-list\fP }" 8 +This variable specifies a list of window names and the bitmap filenames that +should be used as their icons. For example: +.EX 0 +\fBIcons\fP +{ + "XTerm" "xterm.icon" + "xfd" "xfd_icon" +} +.EE +Windows that match ``XTerm'' and would not be iconified by unmapping, and +would try to use +the icon bitmap in the file ``xterm.icon''. If \fBForceIcons\fP is +specified, this bitmap will be used even if the client has requested its +own icon pixmap. +.IP "\fBInterpolateMenuColors\fP" 8 +This variable indicates that menu entry colors should be interpolated between +entry specified colors. In the example below: +.EX 0 +\fBMenu\fP "mymenu" +{ + "Title" ("black":"red") f.title + "entry1" f.nop + "entry2" f.nop + "entry3" ("white":"green") f.nop + "entry4" f.nop + "entry5" ("red":"white") f.nop +} +.EE +the foreground colors for ``entry1'' and ``entry2'' will be interpolated +between black and white, and the background colors between red and green. +Similarly, the foreground for ``entry4'' will be half-way between white and +red, and the background will be half-way between green and white. +.IP "\fBMakeTitle\fP { \fIwin-list\fP }" 8 +This variable specifies a list of windows on which a titlebar should be placed +and is used to request titles on specific windows when \fBNoTitle\fP has been +set. +.IP "\fBMaxWindowSize\fP \fIstring\fP" 8 +This variable specifies a geometry in which the width and height +give the maximum size for a given window. This is typically used to +restrict windows to the size of the screen. The default width is 32767 - +screen width. The default height is 32767 - screen height. +.IP "\fBMenuBackground\fP \fIstring\fP" 8 +This variable specifies the background color used for menus, +and can only be specified inside of a +\fBColor\fP or \fBMonochrome\fP list. The default is "white". +.IP "\fBMenuBorderColor\fP \fIstring\fP" 8 +This variable specifies the color of the menu border and can only be specified +inside of a +\fBColor\fP, \fBGrayscale\fP or \fBMonochrome\fP list. The default is "black". +.IP "\fBMenuBorderWidth\fP \fIpixels\fP" 8 +This variable specifies the width in pixels of the border surrounding +menu windows. The default is 2. +.IP "\fBMenuFont\fP \fIstring\fP" 8 +This variable specifies the font to use when displaying menus. The default +is "variable". +.IP "\fBMenuForeground\fP \fIstring\fP" 8 +This variable specifies the foreground color used for menus, +and can only be specified inside of a +\fBColor\fP, \fBGrayscale\fP or \fBMonochrome\fP list. The default is "black". +.IP "\fBMenuShadowColor\fP \fIstring\fP" 8 +This variable specifies the color of the shadow behind pull-down menus +and can only be specified inside of a +\fBColor\fP, \fBGrayscale\fP or \fBMonochrome\fP list. The default is "black". +.IP "\fBMenuTitleBackground\fP \fIstring\fP" 8 +This variable specifies the background color for \fBf.title\fP entries in +menus, and +can only be specified inside of a +\fBColor\fP, \fBGrayscale\fP or \fBMonochrome\fP list. The default is "white". +.IP "\fBMenuTitleForeground\fP \fIstring\fP" 8 +This variable specifies the foreground color for \fBf.title\fP entries in +menus and +can only be specified inside of a +\fBColor\fP or \fBMonochrome\fP list. The default is "black". +.IP "\fBMonochrome\fP { \fIcolors\fP }" 8 +This variable specifies a list of color assignments that should be made if +the screen has a depth of 1. See the description of \fBColors\fP. +.IP "\fBMoveDelta\fP \fIpixels\fP" 8 +This variable specifies the number of pixels the pointer +must move before the \fBf.move\fP function starts working. Also +see the \fBf.deltastop\fP function. The default is zero pixels. +.IP "\fBNoBackingStore\fP" 8 +This variable indicates that \fItwm\fP's menus should not request backing +store to minimize repainting of menus. This is typically +used with servers that can repaint faster than they can handle backing store. +.IP "\fBNoCaseSensitive\fP" 8 +This variable indicates that case should be ignored when sorting icon names +in an icon manager. This option is typically used with applications that +capitalize the first letter of their icon name. +.IP "\fBNoDefaults\fP" 8 +This variable indicates that \fItwm\fP should not supply the default +titlebuttons and bindings. This option should only be used if the startup +file contains a completely new set of bindings and definitions. +.IP "\fBNoGrabServer\fP" 8 +This variable indicates that \fItwm\fP should not grab the server +when popping up menus and moving opaque windows. +.IP "\fBNoHighlight\fP [{ \fIwin-list\fP }]" 8 +This variable indicates that borders should not be highlighted to track the +location of the pointer. If the optional \fIwin-list\fP is given, highlighting +will only be disabled for those windows. +When the border is highlighted, it will +be drawn in the current \fBBorderColor\fP. When the border is not +highlighted, it will be stippled with a gray pattern using the +current \fBBorderTileForeground\fP and \fBBorderTileBackground\fP colors. +.IP "\fBNoIconManagers\fP" 8 +This variable indicates that no icon manager should be created. +.IP "\fBNoMenuShadows\fP" 8 +This variable indicates that menus should not have drop shadows drawn behind +them. This is typically used with slower servers since it speeds up menu +drawing at the expense of making the menu slightly harder to read. +.IP "\fBNoRaiseOnDeiconify\fP" 8 +This variable indicates that windows that are deiconified should not be +raised. +.IP "\fBNoRaiseOnMove\fP" 8 +This variable indicates that windows should not be raised when moved. This +is typically used to allow windows to slide underneath each other. +.IP "\fBNoRaiseOnResize\fP" 8 +This variable indicates that windows should not be raised when resized. This +is typically used to allow windows to be resized underneath each other. +.IP "\fBNoRaiseOnWarp\fP" 8 +This variable indicates that windows should not be raised when the pointer +is warped into them with the \fBf.warpto\fP function. If this option is set, +warping to an occluded window may result in the pointer ending up in the +occluding window instead the desired window (which causes unexpected behavior +with \fBf.warpring\fP). +.IP "\fBNoSaveUnders\fP" 8 +This variable indicates that menus should not request save-unders to minimize +window repainting following menu selection. It is typically used with displays +that can repaint faster than they can handle save-unders. +.IP "\fBNoStackMode\fP [{ \fIwin-list\fP }]" 8 +This variable indicates that client window requests to change stacking order +should be ignored. If the optional \fIwin-list\fP is given, only requests on +those windows will be ignored. This is typically used to prevent applications +from relentlessly popping themselves to the front of the window stack. +.IP "\fBNoTitle\fP [{ \fIwin-list\fP }] " 8 +This variable indicates that windows should not have titlebars. If the +optional \fIwin-list\fP is given, only those windows will not have titlebars. +\fBMakeTitle\fP may be used with this option to force titlebars to be put +on specific windows. +.IP "\fBNoTitleFocus\fP" 8 +This variable indicates that \fItwm\fP should not set keyboard input focus to +each window as it is entered. Normally, \fItwm\fP sets the focus +so that focus and key events from the titlebar and +icon managers are delivered to the application. If the pointer is moved +quickly and \fItwm\fP is slow to respond, input can be directed to the old +window instead of the new. This option is typically +used to prevent this ``input lag'' and to +work around bugs in older applications that have problems with focus events. +.IP "\fBNoTitleHighlight\fP [{ \fIwin-list\fP }]" 8 +This variable indicates that the highlight area of the titlebar, which is +used to indicate the window that currently has the input focus, should not +be displayed. If the optional \fIwin-list\fP is given, only those windows +will not have highlight areas. This and the \fBSqueezeTitle\fP options +can be set to substantially reduce the amount of screen space required by +titlebars. +.IP "\fBOpaqueMove\fP" 8 +This variable indicates that the \fBf.move\fP function should actually move +the window instead of just an outline so that the user can immediately see +what the window will look like in the new position. This option is typically +used on fast displays (particularly if \fBNoGrabServer\fP is set). +.IP "\fBPixmaps\fP { \fIpixmaps\fP }" 8 +This variable specifies a list of pixmaps that define the appearance of various +images. Each entry is a keyword indicating the pixmap to set, followed by a +string giving the name of the bitmap file. The following pixmaps +may be specified: +.EX 0 +\fBPixmaps\fP +{ + TitleHighlight "gray1" +} +.EE +The default for \fITitleHighlight\fP is to use an even stipple pattern. +.IP "\fBPriority\fP \fIpriority\fP" 8 +This variable sets \fItwm\fP's priority. \fIpriority\fP should be an +unquoted, signed number (e.g. 999). This variable has an effect only +if the server supports the SYNC extension. +.IP "\fBRandomPlacement\fP" 8 +This variable indicates that windows with no specified geometry should +be placed in a pseudo-random location instead of having the user drag out +an outline. +.IP "\fBResizeFont\fP \fIstring\fP" 8 +This variable specifies the font to be used for in the dimensions window when +resizing windows. The default is "fixed". +.IP "\fBRestartPreviousState\fP" 8 +This variable indicates that +\fItwm\fP should attempt to use the WM_STATE property on client windows +to tell which windows should be iconified and which should be left visible. +This is typically used to try to regenerate the state that the screen +was in before the previous window manager was shutdown. +.IP "\fBSaveColor\fP { \fIcolors-list\fP }" 8 +This variable indicates a list of color assignments to be stored as pixel +values in the root window property _MIT_PRIORITY_COLORS. Clients may elect +to preserve these values when installing their own colormap. Note that +use of this mechanism is a way an for application to avoid the "technicolor" +problem, whereby useful screen objects such as window borders and titlebars +disappear when a programs custom colors are installed by the window +manager. +For example: +.EX 0 +\fBSaveColor\fP +{ + BorderColor + TitleBackground + TitleForeground + "red" + "green" + "blue" +} +.EE +This would place on the root window 3 pixel values for borders and titlebars, +as well as the three color strings, all taken from the default colormap. +.IP "\fBShowIconManager\fP" 8 +This variable indicates that the icon manager window should be displayed when +\fItwm\fP is started. It can always be brought up using the +\fBf.showiconmgr\fP function. +.IP "\fBSortIconManager\fP" 8 +This variable indicates that entries in the icon manager should be +sorted alphabetically rather than by simply appending new windows to +the end. +.IP "\fBSqueezeTitle\fP [{ \fIsqueeze-list\fP }] " 8 +This variable indicates that \fItwm\fP should attempt to use the SHAPE +extension to make titlebars occupy only as much screen space as they need, +rather than extending all the way across the top of the window. +The optional \fIsqueeze-list\fP +may be used to control the location of the squeezed titlebar along the +top of the window. It contains entries of the form: +.EX 0 + "\fIname\fP" \fIjustification\fP \fInum\fP \fIdenom\fP +.EE +where \fIname\fP is a window name, \fIjustification\fP is either \fBleft\fP, +\fBcenter\fP, or \fBright\fP, and \fInum\fP and \fIdenom\fP +are numbers specifying a ratio giving the relative position about which +the titlebar is justified. The ratio is measured from left to right if +the numerator is positive, and right to left if negative. A denominator +of 0 indicates that the numerator should be measured in pixels. For +convenience, the ratio 0/0 is the same as 1/2 for \fBcenter\fP and -1/1 +for \fBright\fP. For example: +.EX 0 +\fBSqueezeTitle\fP +{ + "XTerm" left 0 0 + "xterm1" left 1 3 + "xterm2" left 2 3 + "oclock" center 0 0 + "emacs" right 0 0 +} +.EE +The \fBDontSqueezeTitle\fP list can be used to turn off squeezing on +certain titles. +.IP "\fBStartIconified\fP [{ \fIwin-list\fP }] " 8 +This variable indicates that client windows should initially be left as +icons until explicitly deiconified by the user. If the optional \fIwin-list\fP +is given, only those windows will be started iconic. This is useful for +programs that do not support an \fI-iconic\fP command line option or +resource. +.IP "\fBTitleBackground\fP \fIstring\fP [{ \fIwin-list\fP }]" 8 +This variable specifies the background color used in titlebars, +and may only be specified inside of a +\fBColor\fP, \fBGrayscale\fP or \fBMonochrome\fP list. +The optional \fIwin-list\fP is a list of window names and colors so that +per-window colors may be specified. +The default is "white". +.IP "\fBTitleButtonBorderWidth\fP \fIpixels\fP" 8 +This variable specifies the width in pixels of the border surrounding +titlebuttons. This is typically set to 0 to allow titlebuttons to take up as +much space as possible and to not have a border. +The default is 1. +.IP "\fBTitleFont\fP \fIstring\fP" 8 +This variable specifies the font to be used for displaying window names in +titlebars. The default is "variable". +.IP "\fBTitleForeground\fP \fIstring\fP [{ \fIwin-list\fP }]" 8 +This variable specifies the foreground color used in titlebars, and +may only be specified inside of a +\fBColor\fP, \fBGrayscale\fP or \fBMonochrome\fP list. +The optional \fIwin-list\fP is a list of window names and colors so that +per-window colors may be specified. +The default is "black". +.IP "\fBTitlePadding\fP \fIpixels\fP" 8 +This variable specifies the distance between the various buttons, text, and +highlight areas in the titlebar. The default is 8 pixels. +.IP "\fBUnknownIcon\fP \fIstring\fP" 8 +This variable specifies the filename of a bitmap file to be +used as the default icon. This bitmap will be used as the icon of all +clients which do not provide an icon bitmap and are not listed +in the \fBIcons\fP list. +.IP "\fBUsePPosition\fP \fIstring\fP" 8 +This variable specifies whether or not \fItwm\fP should honor +program-requested locations (given by the \fBPPosition\fP flag in the +WM_NORMAL_HINTS property) in the absence of a user-specified position. +The argument \fIstring\fP may have one of three values: \fB"off"\fP +(the default) +indicating that \fItwm\fP +should ignore the program-supplied position, +\fB"on"\fP indicating that the position +should be used, and +\fB"non-zero"\fP indicating that the position should used if +it is other than (0,0). The latter option is for working around a bug in +older toolkits. +.IP "\fBWarpCursor\fP [{ \fIwin-list\fP }]" 8 +This variable indicates that the pointer should be warped into windows when +they are deiconified. If the optional \fIwin-list\fP is given, the pointer +will only be warped when those windows are deiconified. +.IP "\fBWindowRing\fP { \fIwin-list\fP }" 8 +This variable specifies a list of windows along which the \fBf.warpring\fP +function cycles. +.IP "\fBWarpUnmapped\fP" 8 +This variable indicates that the \fBf.warpto\fP function should deiconify +any iconified windows it encounters. This is typically used to make a key +binding that will pop a particular window (such as \fIxmh\fP), no matter +where it is. The default is for \fBf.warpto\fP to ignore iconified windows. +.IP "\fBXorValue\fP \fInumber\fP" 8 +This variable specifies the value to use when drawing window outlines for +moving and resizing. This should be set to a value that will result in a +variety of +of distinguishable colors when exclusive-or'ed with the contents of the +user's typical screen. Setting this variable to 1 often gives nice results +if adjacent colors in the default colormap are distinct. By default, +\fItwm\fP will attempt to cause temporary lines to appear at the opposite +end of the colormap from the graphics. +.IP "\fBZoom\fP [ \fIcount\fP ]" 8 +This variable indicates that outlines suggesting movement of a window +to and from its iconified state should be displayed whenever a window is +iconified or deiconified. The optional \fIcount\fP argument specifies the +number of outlines to be drawn. The default count is 8. +.PP +The following variables must be set after the fonts have been +assigned, so it is usually best to put them at the end of the variables +or beginning of the bindings sections: +.IP "\fBDefaultFunction\fP \fIfunction\fP" 8 +This variable specifies the function to be executed when a key or button +event is received for which no binding is provided. This is typically +bound to \fBf.nop\fP, \fBf.beep\fP, or a menu containing window operations. +.IP "\fBWindowFunction\fP \fIfunction\fP" 8 +This variable specifies the function to execute when a window is selected +from the \fBTwmWindows\fP menu. If this variable is not set, the window +will be deiconified and raised. +.SH BINDINGS +.PP +After the desired variables have been set, functions may be attached +titlebuttons and key and pointer buttons. Titlebuttons may be added +from the left or right side and appear in the titlebar from left-to-right +according to the +order in which they are specified. Key and pointer button +bindings may be given in any order. +.PP +Titlebuttons specifications must include the name of the pixmap to use in +the button box and the function to be invoked when a pointer button is +pressed within them: +.EX 0 +\fBLeftTitleButton\fP "\fIbitmapname\fP" = \fIfunction\fP +.EE +or +.EX 0 +\fBRightTitleButton\fP "\fIbitmapname\fP" = \fIfunction\fP +.EE +The \fIbitmapname\fP may refer to one of the built-in bitmaps +(which are scaled to match \fBTitleFont\fP) by using the appropriate +colon-prefixed name described above. +.PP +Key and pointer button specifications must give the modifiers that must +be pressed, over which parts of the screen the pointer must be, and what +function is to be invoked. Keys are given as strings containing the +appropriate +keysym name; buttons are given as the keywords \fBButton1\fP-\fBButton5\fP: +.EX 0 +"FP1" = \fImodlist\fP : \fIcontext\fP : \fIfunction\fP +\fBButton1\fP = \fImodlist\fP : \fIcontext\fP : \fIfunction\fP +.EE +The \fImodlist\fP is any combination of the modifier names \fBshift\fP, +\fBcontrol\fP, \fBlock\fP, \fBmeta\fP, \fBmod1\fP, \fBmod2\fP, \fBmod3\fP, +\fBmod4\fP, or \fBmod5\fP (which may be abbreviated as +\fBs\fP, \fBc\fP, \fBl\fP, \fBm\fP, \fBm1\fP, \fBm2\fP, \fBm3\fP, \fBm4\fP, +\fBm5\fP, respectively) separated by a vertical bar (\(or). +Similarly, the \fIcontext\fP is any combination of +\fBwindow\fP, +\fBtitle\fP, +\fBicon\fP, +\fBroot\fP, +\fBframe\fP, +\fBiconmgr\fP, their first letters (\fBiconmgr\fP abbreviation is \fBm\fP), +or \fBall\fP, +separated by a vertical bar. The \fIfunction\fP is any of the \fBf.\fP +keywords described below. For example, the default startup +file contains the following bindings: +.EX 0 +Button1 = : root : f.menu "TwmWindows" +Button1 = m : window | icon : f.function "move-or-lower" +Button2 = m : window | icon : f.iconify +Button3 = m : window | icon : f.function "move-or-raise" +Button1 = : title : f.function "move-or-raise" +Button2 = : title : f.raiselower +Button1 = : icon : f.function "move-or-iconify" +Button2 = : icon : f.iconify +Button1 = : iconmgr : f.iconify +Button2 = : iconmgr : f.iconify +.EE +A user who wanted to be able to manipulate windows from the keyboard could +use the following bindings: +.EX 0 +"F1" = : all : f.iconify +"F2" = : all : f.raiselower +"F3" = : all : f.warpring "next" +"F4" = : all : f.warpto "xmh" +"F5" = : all : f.warpto "emacs" +"F6" = : all : f.colormap "next" +"F7" = : all : f.colormap "default" +"F20" = : all : f.warptoscreen "next" +"Left" = m : all : f.backiconmgr +"Right" = m | s : all : f.forwiconmgr +"Up" = m : all : f.upiconmgr +"Down" = m | s : all : f.downiconmgr +.EE +\fITwm\fP provides many more window manipulation primitives than can be +conveniently stored in a titlebar, menu, or set of key bindings. Although +a small set of defaults are supplied (unless the \fBNoDefaults\fP is +specified), most users will want to have their most common operations +bound to key and button strokes. To do this, \fItwm\fP associates names +with each of the primitives and provides \fIuser-defined functions\fP for +building higher level primitives and \fImenus\fP for interactively selecting +among groups of functions. +.PP +User-defined functions contain the name by which they are referenced in +calls to \fBf.function\fP and a list of other functions to execute. For +example: +.EX 0 +Function "move-or-lower" { f.move f.deltastop f.lower } +Function "move-or-raise" { f.move f.deltastop f.raise } +Function "move-or-iconify" { f.move f.deltastop f.iconify } +Function "restore-colormap" { f.colormap "default" f.lower } +.EE +The function name must be used in \fBf.function\fP exactly as it appears in +the function specification. +.PP +In the descriptions below, if the function is said to operate on the selected +window, but is invoked from a root menu, the cursor will be changed to +the \fBSelect\fP cursor and the next window to receive a button press will +be chosen: +.IP "\fB!\fP \fIstring\fP" 8 +This is an abbreviation for \fBf.exec\fP \fIstring\fP. +.\"OBSOLETE - use a clipboard client +.\".IP "\fB^\fP \fIstring\fP" 8 +.\"This is an abbreviation for \fBf.cut\fP \fIstring\fP. +.IP "\fBf.autoraise\fP" 8 +This function toggles whether or not the selected window is raised whenever +entered by the pointer. See the description of the variable \fBAutoRaise\fP. +.IP "\fBf.backiconmgr\fI" 8 +This function warps the pointer to the previous column in the +current icon manager, wrapping back to the previous row if necessary. +.IP "\fBf.beep\fP" 8 +This function sounds the keyboard bell. +.IP "\fBf.bottomzoom\fP" 8 +This function is similar to the \fBf.fullzoom\fP function, but +resizes the window to fill only the bottom half of the screen. +.IP "\fBf.circledown\fP" 8 +This function lowers the top-most window that occludes another window. +.IP "\fBf.circleup\fP" 8 +This function raises the bottom-most window that is occluded by another window. +.IP "\fBf.colormap\fP \fIstring\fP" 8 +This function rotates the colormaps (obtained from the WM_COLORMAP_WINDOWS +property on the window) that \fItwm\fP will display when the pointer +is in this window. The argument \fIstring\fP may have one of the following +values: \fB"next"\fP, \fB"prev"\fP, and \fB"default"\fP. It should be noted +here that in general, the installed colormap is determined by keyboard focus. +A pointer driven keyboard focus will install a private colormap upon entry +of the window owning the colormap. Using the click to type model, private +colormaps will not be installed until the user presses a mouse button on +the target window. +.\"OBSOLETE - should go away and use a clipboard. +.\".IP "\fBf.cut\fP \fIstring\fP" 8 +.\"This function places the specified \fIstring\fP (followed by a newline +.\"character) into the root window property CUT_BUFFER0. +.\".IP "\fBf.cutfile\fP" 8 +.\"This function reads the file indicated by the contents of the CUT_BUFFER0 +.\"window property and replaces the cut buffer. +.IP "\fBf.deiconify\fP" 8 +This function deiconifies the selected window. If the window is not an icon, +this function does nothing. +.IP "\fBf.delete\fP" 8 +This function sends the WM_DELETE_WINDOW message to the selected window if +the client application has requested it through the WM_PROTOCOLS window +property. The application is supposed to respond to the message by removing +the indicated window. If the window has not requested +WM_DELETE_WINDOW messages, the keyboard bell will be rung indicating that +the user should choose an alternative method. Note this is very different +from f.destroy. The intent here is to delete a single window, not +necessarily the entire application. +.IP "\fBf.deltastop\fP" 8 +This function allows a user-defined function to be aborted if the pointer has +been moved more than \fIMoveDelta\fP pixels. See the example definition +given for \fBFunction "move-or-raise"\fP at the beginning of the section. +.IP "\fBf.destroy\fP" 8 +This function instructs the X server to close the display connection of the +client that created the selected window. This should only be used as a last +resort for shutting down runaway clients. See also f.delete. +.IP "\fBf.downiconmgr\fI" 8 +This function warps the pointer to the next row in the current icon manger, +wrapping to the beginning of the next column if necessary. +.IP "\fBf.exec\fP \fIstring\fP" 8 +This function passes the argument \fIstring\fP to /bin/sh for execution. +In multiscreen mode, if \fIstring\fP starts a new X client without +giving a display argument, the client will appear on the screen from +which this function was invoked. +.\".IP "\fBf.file\fP \fIstring\fP" 8 +.\"This function assumes \fIstring\fP is a file name. This file is read into +.\"the window server's cut buffer. +.IP "\fBf.focus\fP" 8 +This function toggles the keyboard focus of the server to the +selected window, changing the focus rule from pointer-driven if necessary. +If the selected window already was focused, this function executes an +\fBf.unfocus\fP. +.IP "\fBf.forcemove\fP" 8 +This function is like \fBf.move\fP except that it ignores the \fBDontMoveOff\fP +variable. +.IP "\fBf.forwiconmgr\fI" 8 +This function warps the pointer to the next column in the current icon +manager, wrapping to the beginning of the next row if necessary. +.IP "\fBf.fullzoom\fP" 8 +This function resizes the selected window to the full size of the display or +else restores the original size if the window was already zoomed. +.IP "\fBf.function\fP \fIstring\fP" 8 +This function executes the user-defined function whose name is specified +by the argument \fIstring\fP. +.IP "\fBf.hbzoom\fP" 8 +This function is a synonym for \fBf.bottomzoom\fP. +.IP "\fBf.hideiconmgr\fP" 8 +This function unmaps the current icon manager. +.IP "\fBf.horizoom\fP" 8 +This variable is similar to the \fBf.zoom\fP function except that the +selected window is resized to the full width of the display. +.IP "\fBf.htzoom\fP" 8 +This function is a synonym for \fBf.topzoom\fP. +.IP "\fBf.hzoom\fP" 8 +This function is a synonym for \fBf.horizoom\fP. +.IP "\fBf.iconify\fP" 8 +This function iconifies or deiconifies the selected window or icon, +respectively. +.IP "\fBf.identify\fP" 8 +This function displays a summary of the name and geometry of the +selected window. If the server supports the SYNC extension, the priority +of the client owning the window is also displayed. +Clicking the pointer or pressing a key in the window +will dismiss it. +.IP "\fBf.lefticonmgr\fI" 8 +This function similar to \fBf.backiconmgr\fP except that wrapping does not +change rows. +.IP "\fBf.leftzoom\fP" 8 +This variable is similar to the \fBf.bottomzoom\fP function but causes +the selected window is only resized to the left half of the display. +.IP "\fBf.lower\fP" 8 +This function lowers the selected window. +.IP "\fBf.menu\fP \fIstring\fP" 8 +This function invokes the menu specified by the argument \fIstring\fP. +Cascaded menus may be built by nesting calls to \fBf.menu\fP. +.IP "\fBf.move\fP" 8 +This function drags an outline of the selected window (or the window itself +if the \fBOpaqueMove\fP variable is set) until the invoking pointer button +is released. Double clicking within the number of milliseconds given by +\fBConstrainedMoveTime\fP warps +the pointer to the center of the window and +constrains the move to be either horizontal or vertical depending on which +grid line is crossed. +To abort a move, press another button before releasing the +first button. +.IP "\fBf.nexticonmgr\fI" 8 +This function warps the pointer to the next icon manager containing any windows +on the current or any succeeding screen. +.IP "\fBf.nop\fP" 8 +This function does nothing and is typically used with the \fBDefaultFunction\fP +or \fBWindowFunction\fP variables or to introduce blank lines in menus. +.IP "\fBf.previconmgr\fI" 8 +This function warps the pointer to the previous icon manager containing any +windows on the current or preceding screens. +.IP "\fBf.priority\fP \fIstring\fP" 8 +This function sets the priority of the client owning the selected window to +the numeric value of the argument \fIstring\fP, which should be a signed +integer in double quotes (e.g. "999" ). This function has an effect only +if the server supports the SYNC extension. +.IP "\fBf.quit\fP" 8 +This function causes \fItwm\fP to restore the window's borders and exit. If +\fItwm\fP is the first client invoked from \fIxdm\fP, this will result in a +server reset. +.IP "\fBf.raise\fP" 8 +This function raises the selected window. +.IP "\fBf.raiselower\fP" 8 +This function raises the selected window to the top of the stacking order if +it is occluded by any windows, otherwise the window will be lowered. +.IP "\fBf.refresh\fP" 8 +This function causes all windows to be refreshed. +.IP "\fBf.resize\fP" 8 +This function displays an outline of the selected window. Crossing a border +(or setting \fBAutoRelativeResize\fP) will cause the outline to begin to +rubber band until the invoking button is released. To abort a resize, +press another button before releasing the first button. +.IP "\fBf.restart\fP" 8 +This function kills and restarts \fItwm\fP. +.IP "\fBf.startwm\fP \fIstring\fP" 8 +This function kills \fItwm\fP and starts another window manager, as +specified by \fIstring\fP. +.IP "\fBf.righticonmgr\fI" 8 +This function is similar to \fBf.nexticonmgr\fP except that wrapping does +not change rows. +.IP "\fBf.rightzoom\fP" 8 +This variable is similar to the \fBf.bottomzoom\fP function except that +the selected window is only resized to the right half of the display. +.IP "\fBf.saveyourself\fP" 8 +This function sends a WM_SAVEYOURSELF message to the selected window if it +has requested the message in its WM_PROTOCOLS window property. Clients that +accept this message are supposed to checkpoint all state associated with the +window and update the WM_COMMAND property as specified in the ICCCM. If +the selected window has not selected for this message, the keyboard bell +will be rung. +.IP "\fBf.showiconmgr\fP" 8 +This function maps the current icon manager. +.IP "\fBf.sorticonmgr\fP" 8 +This function sorts the entries in the current icon manager alphabetically. +See the variable \fBSortIconManager\fP. +.\".IP "\fBf.source\fP \fIstring\fP" 8 +.\"This function assumes \fIstring\fP is a file name. The file is read +.\"and parsed as a \fItwm\fP startup file. +.\"This +.\"function is intended to be used only to re-build pull-down menus. None +.\"of the \fItwm\fP variables are changed. +.IP "\fBf.title\fP" 8 +This function provides a centered, unselectable item in a menu definition. It +should not be used in any other context. +.IP "\fBf.topzoom\fP" 8 +This variable is similar to the \fBf.bottomzoom\fP function except that +the selected window is only resized to the top half of the display. +.\".IP "\fBf.twmrc\fP" 8 +.\"This function causes the startup customization file to be re-read. This +.\"function is exactly like the \fBf.source\fP function without having to +.\"specify the filename. +.IP "\fBf.unfocus\fP" 8 +This function resets the focus back to pointer-driven. This should be used +when a focused window is no longer desired. +.IP "\fBf.upiconmgr\fI" 8 +This function warps the pointer to the previous row in the current icon +manager, wrapping to the last row in the same column if necessary. +.\".IP "\fBf.version\fI" 8 +.\"This function causes the \fItwm\fP version window to be displayed. This +.\"window will be displayed until a pointer button is pressed or the +.\"pointer is moved from one window to another. +.IP "\fBf.vlzoom\fP" 8 +This function is a synonym for \fBf.leftzoom\fP. +.IP "\fBf.vrzoom\fP" 8 +This function is a synonym for \fBf.rightzoom\fP. +.IP "\fBf.warpring\fP \fIstring\fP" 8 +This function warps the pointer to the next or previous window (as indicated +by the argument \fIstring\fP, which may be \fB"next"\fP or \fB"prev"\fP) +specified in the \fBWindowRing\fP variable. +.IP "\fBf.warpto\fP \fIstring\fP" 8 +This function warps the pointer to the window which has a name or class +that matches \fIstring\fP. If the window is iconified, it will be deiconified +if the variable \fBWarpUnmapped\fP is set or else ignored. +.IP "\fBf.warptoiconmgr\fP \fIstring\fP" 8 +This function warps the pointer to the icon manager entry +associated with the window containing the pointer in the icon manager +specified by the argument \fIstring\fP. If \fIstring\fP is empty (i.e. ""), +the current icon manager is chosen. +.IP "\fBf.warptoscreen\fP \fIstring\fP" 8 +This function warps the pointer to the screen specified by the +argument \fIstring\fP. \fIString\fP may be a number (e.g. \fB"0"\fP or +\fB"1"\fP), the word \fB"next"\fP (indicating the current screen plus 1, +skipping over any unmanaged screens), +the word \fB"back"\fP (indicating the current screen minus 1, skipping over +any unmanaged screens), or the word +\fB"prev"\fP (indicating the last screen visited. +.IP "\fBf.winrefresh\fP" 8 +This function is similar to the \fBf.refresh\fP function except that only the +selected window is refreshed. +.IP "\fBf.zoom\fP" 8 +This function is similar to the \fBf.fullzoom\fP function, except that +the only the height of the selected window is changed. +.SH MENUS +.PP +Functions may be grouped and interactively selected using pop-up +(when bound to a pointer button) or pull-down (when associated +with a titlebutton) menus. Each menu specification contains the name of the +menu as it will be referred to by \fBf.menu\fP, optional default +foreground and background colors, the list of item names and the functions +they should invoke, and optional foreground and background colors for +individual items: +.EX 0 +\fBMenu\fP "\fImenuname\fP" [ ("\fIdeffore\fP":"\fIdefback\fP") ] +{ + \fIstring1\fP [ ("\fIfore1\fP":"\fIbackn\fP")] \fIfunction1\fP + \fIstring2\fP [ ("\fIfore2\fP":"\fIbackn\fP")] \fIfunction2\fP + . + . + . + \fIstringN\fP [ ("\fIforeN\fP":"\fIbackN\fP")] \fIfunctionN\fP +} +.EE +.PP +The \fImenuname\fP is case-sensitive. +The optional \fIdeffore\fP and \fIdefback\fP arguments specify the foreground +and background colors used on a color display +to highlight menu entries. +The \fIstring\fP portion +of each menu entry will be the text which will appear in the menu. +The optional \fIfore\fP and \fIback\fP arguments specify the foreground +and background colors of the menu entry when the pointer is not in +the entry. These colors will only be used on a color display. The +default is to use the colors specified by the +\fBMenuForeground\fP and \fBMenuBackground\fP variables. +The \fIfunction\fP portion of the menu entry is one of the functions, +including any user-defined functions, or additional menus. +.PP +There is a special menu named \fBTwmWindows\fP which contains the names of +all of the client and \fItwm\fP-supplied windows. Selecting an entry will +cause the +\fBWindowFunction\fP to be executed on that window. If \fBWindowFunction\fP +hasn't been set, the window will be deiconified and raised. +.SH ICONS +\fITwm\fP supports several different ways of manipulating iconified windows. +The common pixmap-and-text style may be laid out by hand or automatically +arranged as described by the \fBIconRegion\fP variable. In addition, a +terse grid of icon names, called an icon manager, provides a more efficient +use of screen space as well as the ability to navigate among windows from +the keyboard. +.PP +An icon manager is a window that contains names of selected or all +windows currently on the display. In addition to the window name, +a small button using the default iconify symbol will be displayed to the +left of the name when the window is iconified. By default, clicking on an +entry in the icon manager performs \fBf.iconify\fP. +To change the actions taken in the icon manager, use the +the \fBiconmgr\fP context when specifying button and keyboard bindings. +.PP +Moving the pointer into the icon manager also directs keyboard focus to +the indicated window (setting the focus explicitly or else sending synthetic +events \fBNoTitleFocus\fP is set). +Using the \fBf.upiconmgr\fP, \fBf.downiconmgr\fP +\fBf.lefticonmgr\fP, and +\fBf.righticonmgr\fP functions, +the input focus can be changed between windows directly from the keyboard. +.SH BUGS +The resource manager should have been used instead of all of the window +lists. +.PP +The \fBIconRegion\fP variable should take a list. +.PP +Double clicking very fast to get the constrained move function will sometimes +cause the window to move, even though the pointer is not moved. +.PP +If \fBIconifyByUnmapping\fP is on and windows are listed in +\fBIconManagerDontShow\fP but not in \fBDontIconifyByUnmapping\fP, +they may be lost if they are iconified and no bindings to +\fBf.menu "TwmWindows"\fP or \fBf.warpto\fP are setup. +.SH FILES +.PP +.nf +.I $HOME/.twmrc. +.I $HOME/.twmrc +.I __projectroot__/lib/X11/twm/system.twmrc +.fi +.SH "ENVIRONMENT VARIABLES" +.IP "DISPLAY" 8 +This variable is used to determine which X server to use. It is also set +during \fBf.exec\fP so that programs come up on the proper screen. +.IP "HOME" 8 +This variable is used as the prefix for files that begin with a tilde and +for locating the \fItwm\fP startup file. +.SH "SEE ALSO" +.PP +X(__miscmansuffix__), Xserver(1), xdm(1), xrdb(1) +.SH AUTHORS +Tom LaStrange, Solbourne Computer; Jim Fulton, MIT X Consortium; +Steve Pitschke, Stardent Computer; Keith Packard, MIT X Consortium; +Dave Sternlicht, MIT X Consortium; Dave Payne, Apple Computer. diff --git a/app/twm/missing b/app/twm/missing new file mode 100644 index 000000000..894e786e1 --- /dev/null +++ b/app/twm/missing @@ -0,0 +1,360 @@ +#! /bin/sh +# Common stub for a few missing GNU programs while installing. + +scriptversion=2005-06-08.21 + +# Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005 +# Free Software Foundation, Inc. +# Originally by Fran,cois Pinard , 1996. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +# 02110-1301, USA. + +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +if test $# -eq 0; then + echo 1>&2 "Try \`$0 --help' for more information" + exit 1 +fi + +run=: + +# In the cases where this matters, `missing' is being run in the +# srcdir already. +if test -f configure.ac; then + configure_ac=configure.ac +else + configure_ac=configure.in +fi + +msg="missing on your system" + +case "$1" in +--run) + # Try to run requested program, and just exit if it succeeds. + run= + shift + "$@" && exit 0 + # Exit code 63 means version mismatch. This often happens + # when the user try to use an ancient version of a tool on + # a file that requires a minimum version. In this case we + # we should proceed has if the program had been absent, or + # if --run hadn't been passed. + if test $? = 63; then + run=: + msg="probably too old" + fi + ;; + + -h|--h|--he|--hel|--help) + echo "\ +$0 [OPTION]... PROGRAM [ARGUMENT]... + +Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an +error status if there is no known handling for PROGRAM. + +Options: + -h, --help display this help and exit + -v, --version output version information and exit + --run try to run the given command, and emulate it if it fails + +Supported PROGRAM values: + aclocal touch file \`aclocal.m4' + autoconf touch file \`configure' + autoheader touch file \`config.h.in' + automake touch all \`Makefile.in' files + bison create \`y.tab.[ch]', if possible, from existing .[ch] + flex create \`lex.yy.c', if possible, from existing .c + help2man touch the output file + lex create \`lex.yy.c', if possible, from existing .c + makeinfo touch the output file + tar try tar, gnutar, gtar, then tar without non-portable flags + yacc create \`y.tab.[ch]', if possible, from existing .[ch] + +Send bug reports to ." + exit $? + ;; + + -v|--v|--ve|--ver|--vers|--versi|--versio|--version) + echo "missing $scriptversion (GNU Automake)" + exit $? + ;; + + -*) + echo 1>&2 "$0: Unknown \`$1' option" + echo 1>&2 "Try \`$0 --help' for more information" + exit 1 + ;; + +esac + +# Now exit if we have it, but it failed. Also exit now if we +# don't have it and --version was passed (most likely to detect +# the program). +case "$1" in + lex|yacc) + # Not GNU programs, they don't have --version. + ;; + + tar) + if test -n "$run"; then + echo 1>&2 "ERROR: \`tar' requires --run" + exit 1 + elif test "x$2" = "x--version" || test "x$2" = "x--help"; then + exit 1 + fi + ;; + + *) + if test -z "$run" && ($1 --version) > /dev/null 2>&1; then + # We have it, but it failed. + exit 1 + elif test "x$2" = "x--version" || test "x$2" = "x--help"; then + # Could not run --version or --help. This is probably someone + # running `$TOOL --version' or `$TOOL --help' to check whether + # $TOOL exists and not knowing $TOOL uses missing. + exit 1 + fi + ;; +esac + +# If it does not exist, or fails to run (possibly an outdated version), +# try to emulate it. +case "$1" in + aclocal*) + echo 1>&2 "\ +WARNING: \`$1' is $msg. You should only need it if + you modified \`acinclude.m4' or \`${configure_ac}'. You might want + to install the \`Automake' and \`Perl' packages. Grab them from + any GNU archive site." + touch aclocal.m4 + ;; + + autoconf) + echo 1>&2 "\ +WARNING: \`$1' is $msg. You should only need it if + you modified \`${configure_ac}'. You might want to install the + \`Autoconf' and \`GNU m4' packages. Grab them from any GNU + archive site." + touch configure + ;; + + autoheader) + echo 1>&2 "\ +WARNING: \`$1' is $msg. You should only need it if + you modified \`acconfig.h' or \`${configure_ac}'. You might want + to install the \`Autoconf' and \`GNU m4' packages. Grab them + from any GNU archive site." + files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}` + test -z "$files" && files="config.h" + touch_files= + for f in $files; do + case "$f" in + *:*) touch_files="$touch_files "`echo "$f" | + sed -e 's/^[^:]*://' -e 's/:.*//'`;; + *) touch_files="$touch_files $f.in";; + esac + done + touch $touch_files + ;; + + automake*) + echo 1>&2 "\ +WARNING: \`$1' is $msg. You should only need it if + you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'. + You might want to install the \`Automake' and \`Perl' packages. + Grab them from any GNU archive site." + find . -type f -name Makefile.am -print | + sed 's/\.am$/.in/' | + while read f; do touch "$f"; done + ;; + + autom4te) + echo 1>&2 "\ +WARNING: \`$1' is needed, but is $msg. + You might have modified some files without having the + proper tools for further handling them. + You can get \`$1' as part of \`Autoconf' from any GNU + archive site." + + file=`echo "$*" | sed -n 's/.*--output[ =]*\([^ ]*\).*/\1/p'` + test -z "$file" && file=`echo "$*" | sed -n 's/.*-o[ ]*\([^ ]*\).*/\1/p'` + if test -f "$file"; then + touch $file + else + test -z "$file" || exec >$file + echo "#! /bin/sh" + echo "# Created by GNU Automake missing as a replacement of" + echo "# $ $@" + echo "exit 0" + chmod +x $file + exit 1 + fi + ;; + + bison|yacc) + echo 1>&2 "\ +WARNING: \`$1' $msg. You should only need it if + you modified a \`.y' file. You may need the \`Bison' package + in order for those modifications to take effect. You can get + \`Bison' from any GNU archive site." + rm -f y.tab.c y.tab.h + if [ $# -ne 1 ]; then + eval LASTARG="\${$#}" + case "$LASTARG" in + *.y) + SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'` + if [ -f "$SRCFILE" ]; then + cp "$SRCFILE" y.tab.c + fi + SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'` + if [ -f "$SRCFILE" ]; then + cp "$SRCFILE" y.tab.h + fi + ;; + esac + fi + if [ ! -f y.tab.h ]; then + echo >y.tab.h + fi + if [ ! -f y.tab.c ]; then + echo 'main() { return 0; }' >y.tab.c + fi + ;; + + lex|flex) + echo 1>&2 "\ +WARNING: \`$1' is $msg. You should only need it if + you modified a \`.l' file. You may need the \`Flex' package + in order for those modifications to take effect. You can get + \`Flex' from any GNU archive site." + rm -f lex.yy.c + if [ $# -ne 1 ]; then + eval LASTARG="\${$#}" + case "$LASTARG" in + *.l) + SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'` + if [ -f "$SRCFILE" ]; then + cp "$SRCFILE" lex.yy.c + fi + ;; + esac + fi + if [ ! -f lex.yy.c ]; then + echo 'main() { return 0; }' >lex.yy.c + fi + ;; + + help2man) + echo 1>&2 "\ +WARNING: \`$1' is $msg. You should only need it if + you modified a dependency of a manual page. You may need the + \`Help2man' package in order for those modifications to take + effect. You can get \`Help2man' from any GNU archive site." + + file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'` + if test -z "$file"; then + file=`echo "$*" | sed -n 's/.*--output=\([^ ]*\).*/\1/p'` + fi + if [ -f "$file" ]; then + touch $file + else + test -z "$file" || exec >$file + echo ".ab help2man is required to generate this page" + exit 1 + fi + ;; + + makeinfo) + echo 1>&2 "\ +WARNING: \`$1' is $msg. You should only need it if + you modified a \`.texi' or \`.texinfo' file, or any other file + indirectly affecting the aspect of the manual. The spurious + call might also be the consequence of using a buggy \`make' (AIX, + DU, IRIX). You might want to install the \`Texinfo' package or + the \`GNU make' package. Grab either from any GNU archive site." + # The file to touch is that specified with -o ... + file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'` + if test -z "$file"; then + # ... or it is the one specified with @setfilename ... + infile=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'` + file=`sed -n '/^@setfilename/ { s/.* \([^ ]*\) *$/\1/; p; q; }' $infile` + # ... or it is derived from the source name (dir/f.texi becomes f.info) + test -z "$file" && file=`echo "$infile" | sed 's,.*/,,;s,.[^.]*$,,'`.info + fi + # If the file does not exist, the user really needs makeinfo; + # let's fail without touching anything. + test -f $file || exit 1 + touch $file + ;; + + tar) + shift + + # We have already tried tar in the generic part. + # Look for gnutar/gtar before invocation to avoid ugly error + # messages. + if (gnutar --version > /dev/null 2>&1); then + gnutar "$@" && exit 0 + fi + if (gtar --version > /dev/null 2>&1); then + gtar "$@" && exit 0 + fi + firstarg="$1" + if shift; then + case "$firstarg" in + *o*) + firstarg=`echo "$firstarg" | sed s/o//` + tar "$firstarg" "$@" && exit 0 + ;; + esac + case "$firstarg" in + *h*) + firstarg=`echo "$firstarg" | sed s/h//` + tar "$firstarg" "$@" && exit 0 + ;; + esac + fi + + echo 1>&2 "\ +WARNING: I can't seem to be able to run \`tar' with the given arguments. + You may want to install GNU tar or Free paxutils, or check the + command line arguments." + exit 1 + ;; + + *) + echo 1>&2 "\ +WARNING: \`$1' is needed, and is $msg. + You might have modified some files without having the + proper tools for further handling them. Check the \`README' file, + it often tells you about the needed prerequisites for installing + this package. You may also peek at any GNU archive site, in case + some other package would contain this missing \`$1' program." + exit 1 + ;; +esac + +exit 0 + +# Local variables: +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-end: "$" +# End: diff --git a/app/twm/sample-twmrc/jim.twmrc b/app/twm/sample-twmrc/jim.twmrc new file mode 100644 index 000000000..210d118f6 --- /dev/null +++ b/app/twm/sample-twmrc/jim.twmrc @@ -0,0 +1,250 @@ +#********************************************************************** +# +# .twmrc +# +#********************************************************************** + +#IconDirectory "/users/jim/icons" # use *bitmapFilePath instead. + +# +# Use the SHAPE extension to make titles use as little space as possible. The +# location of the titles is specified as a fraction of the distance from the +# left (numerator positive) or right edge (numerator negative). A denominator +# of 0 indicates that the numerator is measured in pixels. The title is then +# justified over the indicated spot (note special cases are made for center on +# 0/0 and right on 0/0 to indicate the center and right edge of the titlebar). +# +SqueezeTitle # also sets default to Squeeze all Titles +{ +# name justify num denom + "oclock" center 0 0 # centered over middle of title + "XTerm" left 0 0 # left edge of title + "xlogo" right 0 0 # for kicks + "emacs" right 0 0 # left side emacs with center tab + "xmh" center 0 0 +} +DontSqueezeTitle +{ + "XLogout" # make it stand out when mapped +} +NoDefaults # turn off iconify and resize button +LeftTitleButton "menu12" = f.menu "windowmenu" # add a menu to each window +TitleButtonBorderWidth 0 # don't want to see box around button +ButtonIndent 0 # button doesn't have to be smaller + +UsePPosition "on" # use program-specified size hints accepted +NoHighlight # do not flash borders on enter events +OpaqueMove # actually move window instead of outline +AutoRelativeResize # don't require resize to cross border to start +RestartPreviousState # reiconify iconified things on startup +ClientBorderWidth # use the application border width on frame +BorderWidth 2 # width of top level windows created by twm +NoGrabServer # don't grab server during menus, etc. +NoRaiseOnMove # allow moving under other windows +NoRaiseOnResize # allow resizing under other windows +NoTitleFocus # avoid keystrokes in wrong window cause of lag +DecorateTransients # put titlebars on transients +TitleFont "-adobe-helvetica-bold-r-normal--*-120-*-*-*-*-*-*" +MenuFont "-adobe-helvetica-bold-r-normal--*-120-*-*-*-*-*-*" +IconFont "-adobe-helvetica-bold-r-normal--*-100-*-*-*-*-*-*" +IconManagerFont "-adobe-helvetica-bold-r-normal--*-100-*-*-*" +ResizeFont "-adobe-helvetica-bold-r-normal--*-120-*-*-*" +NoSaveUnders # faster to just repaint then save +XORvalue 1 # tend to use visually distinct adjacent colors +ConstrainedMoveTime 0 # turn off horizontal/vertical only moving +NoCaseSensitive # turn off case-sensitivity in sorting icons +WarpUnmapped # allow warping to unmapped windows + +############################################################################### +# # +# Declare some nice colors # +# # +############################################################################### + +Pixmaps +{ +# TitleHighlight "solid4x4" # make it stand out +} + +Color +{ + DefaultBackground "maroon" + DefaultForeground "gray85" + BorderColor "gray70" + TitleBackground "maroon" + TitleForeground "gray85" + MenuBackground "maroon" + MenuForeground "gray85" + MenuTitleBackground "gray70" + MenuTitleForeground "maroon" + IconBackground "maroon" + IconForeground "gray85" + IconBorderColor "gray85" + IconManagerBackground "maroon" + IconManagerForeground "gray85" +} + +Monochrome +{ + IconManagerHighlight "white" + BorderColor "black" +} + + +############################################################################### +# # +# Define key bindings # +# # +############################################################################### + +MoveDelta 3 # need to move this much before takes effect +Function "move-or-raise" # simulate uwm action +{ + f.move + f.deltastop + f.raise +} + +DefaultFunction f.nop # ignore extraneous events + +Button1 = : root : f.menu "twmops" +Button2 = : root : f.menu "windowops" +Button3 = : root : f.menu "TwmWindows" +Button1 = : title : f.function "move-or-raise" +Button1 = : icon : f.iconify +Button1 = : iconmgr : f.iconify +Button1 = m : window|icon|frame|title : f.lower +Button2 = m : window : f.resize +Button3 = m : window|icon|frame|title : f.function "move-or-raise" +Button1 = c|m|s : all : f.menu "twmops" +#Button1 = c|m|s : root : f.refresh +#"F20" = : all : f.warptoscreen "next" + +"F21" = : all : f.warpring "next" +"F22" = : all : f.warptoiconmgr "" +"F23" = : all : f.raiselower +"Num_Lock" = : all : f.iconify +"F24" = : all : f.warpto "xmh" +"F25" = : all : f.warpto "[expo]" +"F26" = : all : f.warpto "emacs" +"KP_Subtract" = mod5 : all : f.colormap "prev" +"KP_Add" = mod5 : all : f.colormap "next" +"KP_Enter" = mod5 : all : f.colormap "default" +"Left" = m : all : f.backiconmgr +"Right" = m : all : f.forwiconmgr +"Up" = m : all : f.upiconmgr +"Down" = m : all : f.downiconmgr +"Left" = mod5 : all : f.warpring "prev" +"Right" = mod5 : all : f.warpring "next" + +############################################################################### +# # +# Display an icon manager across the top of the screen. Don't manage # +# the windows for which you don't show a title. # +# # +############################################################################### + +SortIconManager # keep them in alphabetic order +ShowIconManager # start with iconmgr up +IconManagerGeometry "700x50+246+2" 14 # strip across top +IconRegion "200x300+950+2" North East 50 50 +IconifyByUnmapping # just use icon manager +IconManagerDontShow # but ignore these windows +{ + "xclock" + "xbiff" + "xload" + "oclock" + "xcutsel" + "XLogout" +} +DontIconifyByUnmapping # don't lose them (still in TwmWindows menu) +{ + "xclock" + "xbiff" + "xload" + "oclock" + "xcutsel" + "Untitled" +} +NoTitle # little programs that look like icons +{ + "xclock" + "xbiff" + "xload" + "TWM Icon Manager" + "xcutsel" +} + +NoStackMode # prevent hostile clients from hosing display +{ + "saber" +} + +WindowRing # f.warpring acts along these windows +{ + "XTerm" + "emacs" + "Xmh" +} + + +############################################################################### +# # +# Define some useful menus. # +# # +############################################################################### + +menu "twmops" +{ +"System" f.title +"Restart Twm" f.restart +"Exit Twm" f.quit +"" f.nop +"xterm" !"xterm &" +"xterm -e /bin/sh" !"xterm -e /bin/sh &" +"xhost +" !"xhost + >/dev/null" +"xhost -" !"xhost - >/dev/null" +"" f.nop +"Kill" f.menu "kill" +"" f.nop +"Logout" f.warpto "xlogout" +} + +menu "windowops" +{ +"Windows" f.title +"Kill" f.menu "kill" +"Save" f.saveyourself +"Refresh" f.refresh +"" f.nop +"Iconify" f.iconify +"Resize" f.resize +"Move" f.move +"Raise" f.raise +"Lower" f.lower +"Info" f.identify +"Focus" f.focus +"Unfocus" f.unfocus +"" f.nop +"Show Iconmgr" f.showiconmgr +"Hide Iconmgr" f.hideiconmgr +"Prev Iconmgr" f.previconmgr +"Next Iconmgr" f.nexticonmgr +} + +menu "windowmenu" +{ +"Iconify" f.iconify +"RaiseLower" f.raiselower +"Refresh" f.winrefresh +"Focus" f.focus +"" f.nop +"Kill" f.menu "kill" +} + +menu "kill" +{ + "Send Delete" f.delete + "Kill Window" f.destroy +} diff --git a/app/twm/sample-twmrc/keith.twmrc b/app/twm/sample-twmrc/keith.twmrc new file mode 100644 index 000000000..b85340b4c --- /dev/null +++ b/app/twm/sample-twmrc/keith.twmrc @@ -0,0 +1,223 @@ +#********************************************************************** +# +# .twmrc +# +#********************************************************************** + +IconDirectory "/users/keith/misc/bitmaps" + +#NoDefaults +NoVersion +NoGrabServer +NoRaiseOnMove +NoRaiseOnResize +#NoMenuShadows +NoTitleHighlight +NoHighlight +NoTitleFocus +NoSaveUnders +SqueezeTitle +ConstrainedMoveTime 0 +DecorateTransients +#TitleButtonBorderWidth 0 +#ButtonIndent 0 +#LeftTitleButton "iconify.bm" = f.iconify +#RightTitleButton "resize.bm" = f.resize +OpaqueMove +#ClientBorderWidth +BorderWidth 1 +RandomPlacement +#IconRegion "1024x250+0+600" NORTH WEST 1024 25 +IconRegion "600x200-200+0" NORTH EAST 75 25 +#IconRegion "200x100-0+200" WEST NORTH 25 50 +TitleFont "-*-helvetica-bold-o-normal--*-140-*-*-*-*-iso8859-1" +MenuFont "-*-helvetica-bold-r-normal--*-140-*-*-*-*-iso8859-1" +IconFont "-*-helvetica-bold-r-normal--*-140-*-*-*-*-iso8859-1" +ResizeFont "-*-helvetica-bold-r-normal--*-120-*-*-*-*-iso8859-1" +IconManagerFont "-*-helvetica-bold-r-normal--*-120-*-*-*-*-iso8859-1" +#ShowIconManager +SortIconManager +IconManagerGeometry "=100x100-200+0" + +# nice colors: background of wheat, foreground of #d36 + +Cursors +{ + Button "left_ptr" + Menu "left_ptr" + Title "left_ptr" + Frame "left_ptr" + Icon "left_ptr" +} + +Color +{ + BorderColor "black" + TitleBackground "CadetBlue" + TitleForeground "#fffff0" + MenuBackground "#fffff0" + MenuForeground "black" + MenuTitleBackground "CadetBlue" + MenuTitleForeground "#fffff0" + IconBackground "#fffff0" + IconForeground "black" + IconBorderColor "black" +} + +Monochrome +{ + IconManagerHighlight "white" +} + +# define key bindings + +MoveDelta 3 + +Function "move-or-raise" +{ + f.move + f.deltastop + f.raise +} + +Function "move-or-raiselower" +{ + f.move + f.deltastop + f.raiselower +} + +Function "move-or-iconify" +{ + f.move + f.deltastop + f.iconify +} + +Function "next-window" +{ +} + +Function "previous-window" +{ +} + +DefaultFunction f.nop + +Button1 = : title : f.function "move-or-raiselower" +Button2 = : title : f.menu "Title Menu" +Button3 = : title : f.resize +Button1 = m : window|icon : f.iconify +Button2 = m : window|icon : f.function "move-or-raiselower" +Button3 = m : window|icon : f.resize +Button3 = c m : title : f.destroy +Button1 = : root : f.menu "Hosts" +Button2 = : root : f.menu "Toys" +Button3 = : root : f.menu "System" +Button1 = : icon : f.function "move-or-iconify" + +#ForceIcons + +Icons +{ + "Xmh" "mail-up.bm" # from IconDirectory + "XTerm" "xterm.bm" # from IconDirectory +} + +#UnknownIcon "icon" + +NoTitle +{ + "clock" + "oclock" + "xclock" + "xbiff" + "xeyes" + "xload" +} + +IconManagerDontShow { + "clock" + "oclock" + "xclock" + "xbiff" + "xeyes" + "xload" +} + +menu "Hosts" +{ +"Hosts" f.title +"xenon" !"xenon &" +"expo" !"expo &" +"kanga" !"kanga &" +"exile" !"exile &" +"expire" !"expire &" +"excalibur" !"excalibur &" +"hpx" !"hpx &" +"expo bugs" !"expo -l bugs &" +"extort" !"extort &" +"apx" !"apx &" +"mfb" !"mfb &" +"sushi" !"sushi &" +"tempura" !"tempora &" +} + +menu "Toys" +{ +"Toys" f.title +"Jove" !"xjove &" +"Mail" !"xmh &" +"Manual" !"xman &" +"Troff Viewer" !"xditview &" +"Calculator" !"xcalc &" +"Mille Bornes" !"xmille `path -n .mille` &" +"Notepad" !"xclipboard &" +"Eyes" !"xeyes &" +"Lens" !"xmag &" +"expo jove" !"expo xjove&" +"expo mail" !"expo xmh &" +} + +menu "System" +{ + "System" f.title + "Window ops" f.menu "Window Ops" + "Windows" f.menu "TwmWindows" + "" f.nop + "Refresh" f.refresh + "Unfocus" f.unfocus + "Show Icon Box" f.showiconmgr + "Hide Icon Box" f.hideiconmgr + "Version" f.version + "" f.nop + "Restart" f.restart + "Logout" f.quit +} + +menu "Window Ops" +{ + "Window Ops" f.title + "Lower" f.lower + "Raise" f.raise + "Resize" f.resize + "Move" f.move + "Deiconify" f.deiconify + "Iconify" f.iconify + "Identify" f.identify + "Focus" f.focus + "Kill" f.destroy +} + +menu "Title Menu" +{ + "Lower" f.lower + "Raise" f.raise + "Resize" f.resize + "Move" f.move + "Iconify" f.iconify + "Identify" f.identify + "Focus" f.focus + "Kill" f.destroy + "Dismiss" f.delete +} diff --git a/app/twm/sample-twmrc/lemke.twmrc b/app/twm/sample-twmrc/lemke.twmrc new file mode 100644 index 000000000..f0a12af5f --- /dev/null +++ b/app/twm/sample-twmrc/lemke.twmrc @@ -0,0 +1,255 @@ +# +# Dave Lemke's .twmrc +# + +IconDirectory "/u/lemke/lib/icons" + +#AutoRelativeResize +BorderWidth 3 +ButtonIndent 0 +ClientBorderWidth +#DefaultFunction f.nop +#DontMoveOff +IconifyByUnmapping +IconFont "-adobe-helvetica-bold-r-normal--14-100-100-100-p-82-iso8859-1" +IconManagerFont "-adobe-helvetica-bold-r-normal--14-100-100-100-p-82-iso8859-1" +IconManagerGeometry "=98x5-2+50" +#LeftTitleButton "menu12.xbm" = f.menu "window-ops" +MenuFont "-adobe-helvetica-bold-r-normal--14-100-100-100-p-82-iso8859-1" +MoveDelta 5 +#NoBackingStore +NoDefaults +NoGrabServer +NoMenuShadows +#NoRaiseOnDeiconify +NoRaiseOnMove +#NoRaiseOnResize +#NoSaveUnder +#NoTitleFocus +#NoVersion +#OpaqueMove +ResizeFont "10x20" +RestartPreviousState +#ReverseVideo +ShowIconManager +SortIconManager + +SqueezeTitle +{ + "XTerm" center 0 0 + "Xsol" center 0 0 + "Spider" center 0 0 +} + +TitleFont "-adobe-helvetica-bold-r-normal--14-100-100-100-p-82-iso8859-1" +TitleButtonBorderWidth 1 +UnknownIcon "ncdlogo64.xbm" +#WarpCursor +XORValue 1 +#Zoom + +DefaultFunction f.nop + +Function "move-or-raise" +{ + f.move + f.deltastop + f.raise +} + +AutoRaise +{ + "xtrek" + "TWM Icon Manager" + "xclock" + "xbiff" + "xeyes" +} + +Cursors +{ + Menu "right_ptr" +} + +DontIconifyByUnmapping +{ + "xclock" + "xbiff" + "twmOutput" + "xload" + "oclock" + "xeyes" +} + +IconManagerDontShow +{ + "xclock" + "xbiff" + "twmOutput" + "xload" + "oclock" + "xeyes" +} + +Monochrome +{ + DefaultForeground "black" + DefaultBackground "white" + BorderColor "black" + TitleForeground "black" + TitleBackground "white" + MenuForeground "black" + MenuBackground "white" +} + +NoTitle +{ + "xclock" + "xbiff" + "xload" + "TWM Icon Manager" + "FrameMaker" + "FrameWriter" + "oclock" + "twmOutput" + "xeyes" +} + +# +# buttons +# + +Button1 = : root : f.menu "button1" +Button2 = : root : f.menu "Util_menu" +Button3 = : root : f.menu "Hosts_menu" +Button1 = : m : f.iconify +Button2 = : m : f.lower +Button1 = : t : f.function "move-or-raise" +Button2 = : t : f.lower +Button3 = : t : f.menu "window-ops" +Button1 = : i : f.iconify +Button2 = : i : f.function "move-or-raise" + +"F1" = : w|t|i : f.iconify +"F2" = : all : f.refresh +"F3" = : w|t|i : f.raise +"F4" = : w|t|i : f.lower + +"F5" = : w|t|i : f.zoom + + + +menu "button1" +{ +"Applications" f.title +#"FrameWriter" !"rsh indian -n /usr/local/xframewriter $DISPLAY& " +#"Q Calc " !"rsh indian -n /usr/bin/X11/xterm -display $DISPLAY -T Qcalc -e /pmax/u/demo/qsp/bin/qcalc &" +#"Notepad" !"/usr/bin/dxnotepad -display $DISPLAY&" +#"Calculator" !"xcalc -display $DISPLAY&" +"Mail Box" !"/usr/bin/X11/xbiff -display $DISPLAY&" +"Clock" !"oclock -display $DISPLAY &" +"Xterm" !"/usr/bin/X11/xterm -ls -display $DISPLAY &" +"Big Xterm" !"/usr/bin/X11/xterm -ls -fn 9x15 -display $DISPLAY &" +"xsol" !"$HOME/games/bin/`arch`/xsol &" +"Spider" !"$HOME/games/bin/`arch`/spider &" +"Utility" f.title +#"Focus" f.focus +#"UnFocus" f.unfocus +#"More.." f.title +"..Hosts" f.menu "Hosts_menu" +"..Applications" f.menu "Apps_menu" +"..Utility" f.menu "Util_menu" +"" f.title +"Exit" f.quit +} + +menu "Hosts_menu" +{ +"Host Connections" f.title +"Almanor" !"rsh -n almanor exec /usr/bin/X11/xterm -ls -display $DISPLAY -T Almanor&" +"Hamilton" !"rsh -n hamilton exec /usr/bin/X11/xterm -ls -display $DISPLAY -T Hamilton&" +"Homer" !"rsh -n Homer exec /usr/bin/X11/xterm -ls -display $DISPLAY -T Homer&" +"Lupine" !"TERM=xterms xterm -fn 10x20 -T lupine -e rlogin lupine&" +"Ramona" !"rsh -n ramona exec /usr/bin/X11/xterm -ls -display $DISPLAY -T Ramona&" +"Pagemill" !"rsh pagemill -n /usr/bin/X11/xterm -display $DISPLAY -T Pagemill -e /bin/ksh&" +"Sheridan" !"rsh -n sheridan exec /usr/bin/X11/xterm -ls -display $DISPLAY -T Sheridan&" +} + +menu "Apps_menu" +{ +"Applications" f.title +"Man Pages" !"/usr/bin/X11/xman -display $DISPLAY&" +#"Notepad" !"/usr/bin/dxnotepad -display $DISPLAY&" +#"FrameMaker" !"rsh indian -n /usr/local/xframemaker $DISPLAY& " +#"Calendar" !"/usr/bin/dxcalendar -display $DISPLAY &" +"Clock" !"/usr/bin/X11/xclock -display $DISPLAY &" +#"Rolodex" !"/usr/bin/dxcardfiler -display $DISPLAY &" +#"Paint" !"/usr/bin/dxpaint -display $DISPLAY &" +"Lock Screen" !"/usr/bin/X11/xlock & " +"Preferences" !"/usr/bin/X11/xpref -display $DISPLAY&" +"Xterm" !"/usr/bin/X11/xterm -ls -display $DISPLAY &" +} + +menu "Util_menu" +{ +"Utilities" f.title +"Refresh" f.refresh +"twm Version" f.version +"Source .twmrc" f.twmrc +"Restart twm" f.restart +#"Hide IconManager" f.hideiconmgr +#"Show IconManager" f.showiconmgr +#"Destroy All Window" !"xkill -a&" +"Preferences" f.menu "Pref_menu" +"TwmWindows" f.menu "TwmWindows" +"Exit twm" f.quit +"Window Ops" f.title +"Refresh Window" f.winrefresh +"Move Window" f.move +"Resize Window" f.resize +"Lower Window" f.lower +"Raise Window" f.raise +"Iconify" f.iconify +"Window Info" f.identify +"Destroy Window" f.destroy +"Focus on Window" f.focus +"Focus on Root" f.unfocus +} + +menu "Pref_menu" +{ +"Preferences" f.title +"Bell Loud" !"xset b 75&" +"Bell Normal" !"xset b 50&" +"Bell Quiet" !"xset b 25&" +"Bell Off" !"xset b off&" +"Mouse Fast" !"xset m 5 1&" +"Mouse Normal" !"xset m 3 1&" +"Mouse Slow" !"xset m 1 1&" +"Screen Saver" f.menu "SSaver" +} + + +menu "SSaver" +{ +"Screen Saver" f.title +"Blank" !"/usr/bin/X11/xset s blank -display $DISPLAY &" +"No Blank" !"/usr/bin/X11/xset s noblank -display $DISPLAY &" +"Saver 2 Sec." !"/usr/bin/X11/xset s 2 2 -display $DISPLAY &" +"Saver 2 Min." !"/usr/bin/X11/xset s 120 120 -display $DISPLAY &" +"Saver 10 Min." !"/usr/bin/X11/xset s 600 600 -display $DISPLAY &" +} + +menu "window-ops" +{ +"Window Ops" f.title +"Iconify" f.iconify +"Refresh Window" f.winrefresh +"Move Window" f.move +"Resize Window" f.resize +"Hide Window" f.lower +"Expose Window" f.raise +"Destroy Window" f.destroy +"Delete Window" f.delete +"Save" f.saveyourself +} diff --git a/app/twm/src/Makefile.am b/app/twm/src/Makefile.am new file mode 100644 index 000000000..c882caab3 --- /dev/null +++ b/app/twm/src/Makefile.am @@ -0,0 +1,79 @@ +# +# Copyright 2005 Red Hat, Inc. +# +# Permission to use, copy, modify, distribute, and sell this software and its +# documentation for any purpose is hereby granted without fee, provided that +# the above copyright notice appear in all copies and that both that +# copyright notice and this permission notice appear in supporting +# documentation, and that the name of Red Hat not be used in +# advertising or publicity pertaining to distribution of the software without +# specific, written prior permission. Red Hat makes no +# representations about the suitability of this software for any purpose. It +# is provided "as is" without express or implied warranty. +# +# RED HAT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, +# INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO +# EVENT SHALL RED HAT BE LIABLE FOR ANY SPECIAL, INDIRECT OR +# CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, +# DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER +# TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +# PERFORMANCE OF THIS SOFTWARE. +# + +AM_YFLAGS = -d + +bin_PROGRAMS = twm + +twm_CFLAGS = $(TWM_CFLAGS) -DXVENDORNAME=\"The\ X.Org\ Foundation\" -DXORG_RELEASE=\"Release\ $(VERSION)\" -D_BSD_SOURCE +twm_LDADD = $(TWM_LIBS) + +twm_SOURCES = \ + add_window.c \ + add_window.h \ + cursor.c \ + deftwmrc.c \ + events.c \ + events.h \ + gc.c \ + gc.h \ + iconmgr.c \ + iconmgr.h \ + icons.c \ + icons.h \ + list.c \ + list.h \ + menus.c \ + menus.h \ + parse.c \ + parse.h \ + resize.c \ + resize.h \ + screen.h \ + session.c \ + session.h \ + twm.c \ + twm.h \ + util.c \ + util.h \ + version.c \ + version.h \ + gram.y \ + lex.l + +BUILT_SOURCES = gram.h gram.c lex.c deftwmrc.c +MAINTAINERCLEANFILES = $(BUILT_SOURCES) + +gram.h: gram.c + +deftwmrc.c: system.twmrc + rm -f $@ + echo '/* ' >>$@ + echo ' * This file is generated automatically from the default' >>$@ + echo ' * twm bindings file system.twmrc by the twm Imakefile.' >>$@ + echo ' */' >>$@ + echo '' >>$@ + echo 'unsigned char *defTwmrc[] = {' >>$@ + sed -f ${srcdir}/deftwmrc.sed < ${srcdir}/system.twmrc >>$@ + echo ' (unsigned char *) 0 };' >>$@ + +EXTRA_DIST = system.twmrc deftwmrc.sed siconify.bm diff --git a/app/twm/src/Makefile.in b/app/twm/src/Makefile.in new file mode 100644 index 000000000..3315b8bb2 --- /dev/null +++ b/app/twm/src/Makefile.in @@ -0,0 +1,789 @@ +# Makefile.in generated by automake 1.9.6 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005 Free Software Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +# +# Copyright 2005 Red Hat, Inc. +# +# Permission to use, copy, modify, distribute, and sell this software and its +# documentation for any purpose is hereby granted without fee, provided that +# the above copyright notice appear in all copies and that both that +# copyright notice and this permission notice appear in supporting +# documentation, and that the name of Red Hat not be used in +# advertising or publicity pertaining to distribution of the software without +# specific, written prior permission. Red Hat makes no +# representations about the suitability of this software for any purpose. It +# is provided "as is" without express or implied warranty. +# +# RED HAT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, +# INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO +# EVENT SHALL RED HAT BE LIABLE FOR ANY SPECIAL, INDIRECT OR +# CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, +# DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER +# TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +# PERFORMANCE OF THIS SOFTWARE. +# + +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +top_builddir = .. +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +INSTALL = @INSTALL@ +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +bin_PROGRAMS = twm$(EXEEXT) +subdir = src +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in gram.c \ + gram.h lex.c +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +am__installdirs = "$(DESTDIR)$(bindir)" +binPROGRAMS_INSTALL = $(INSTALL_PROGRAM) +PROGRAMS = $(bin_PROGRAMS) +am_twm_OBJECTS = twm-add_window.$(OBJEXT) twm-cursor.$(OBJEXT) \ + twm-deftwmrc.$(OBJEXT) twm-events.$(OBJEXT) twm-gc.$(OBJEXT) \ + twm-iconmgr.$(OBJEXT) twm-icons.$(OBJEXT) twm-list.$(OBJEXT) \ + twm-menus.$(OBJEXT) twm-parse.$(OBJEXT) twm-resize.$(OBJEXT) \ + twm-session.$(OBJEXT) twm-twm.$(OBJEXT) twm-util.$(OBJEXT) \ + twm-version.$(OBJEXT) twm-gram.$(OBJEXT) twm-lex.$(OBJEXT) +twm_OBJECTS = $(am_twm_OBJECTS) +am__DEPENDENCIES_1 = +twm_DEPENDENCIES = $(am__DEPENDENCIES_1) +DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) +depcomp = $(SHELL) $(top_srcdir)/depcomp +am__depfiles_maybe = depfiles +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +CCLD = $(CC) +LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ +LEXCOMPILE = $(LEX) $(LFLAGS) $(AM_LFLAGS) +YACCCOMPILE = $(YACC) $(YFLAGS) $(AM_YFLAGS) +SOURCES = $(twm_SOURCES) +DIST_SOURCES = $(twm_SOURCES) +ETAGS = etags +CTAGS = ctags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +ADMIN_MAN_DIR = @ADMIN_MAN_DIR@ +ADMIN_MAN_SUFFIX = @ADMIN_MAN_SUFFIX@ +AMDEP_FALSE = @AMDEP_FALSE@ +AMDEP_TRUE = @AMDEP_TRUE@ +AMTAR = @AMTAR@ +APP_MAN_DIR = @APP_MAN_DIR@ +APP_MAN_SUFFIX = @APP_MAN_SUFFIX@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPPFLAGS = @CPPFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DRIVER_MAN_DIR = @DRIVER_MAN_DIR@ +DRIVER_MAN_SUFFIX = @DRIVER_MAN_SUFFIX@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EXEEXT = @EXEEXT@ +FILE_MAN_DIR = @FILE_MAN_DIR@ +FILE_MAN_SUFFIX = @FILE_MAN_SUFFIX@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LDFLAGS = @LDFLAGS@ +LEX = @LEX@ +LEXLIB = @LEXLIB@ +LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIB_MAN_DIR = @LIB_MAN_DIR@ +LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@ +LTLIBOBJS = @LTLIBOBJS@ +MAINT = @MAINT@ +MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@ +MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@ +MAKEINFO = @MAKEINFO@ +MISC_MAN_DIR = @MISC_MAN_DIR@ +MISC_MAN_SUFFIX = @MISC_MAN_SUFFIX@ +OBJEXT = @OBJEXT@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PKG_CONFIG = @PKG_CONFIG@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +TWM_CFLAGS = @TWM_CFLAGS@ +TWM_LIBS = @TWM_LIBS@ +VERSION = @VERSION@ +YACC = @YACC@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_STRIP = @ac_ct_STRIP@ +ac_pt_PKG_CONFIG = @ac_pt_PKG_CONFIG@ +am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ +am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +datadir = @datadir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +AM_YFLAGS = -d +twm_CFLAGS = $(TWM_CFLAGS) -DXVENDORNAME=\"The\ X.Org\ Foundation\" -DXORG_RELEASE=\"Release\ $(VERSION)\" -D_BSD_SOURCE +twm_LDADD = $(TWM_LIBS) +twm_SOURCES = \ + add_window.c \ + add_window.h \ + cursor.c \ + deftwmrc.c \ + events.c \ + events.h \ + gc.c \ + gc.h \ + iconmgr.c \ + iconmgr.h \ + icons.c \ + icons.h \ + list.c \ + list.h \ + menus.c \ + menus.h \ + parse.c \ + parse.h \ + resize.c \ + resize.h \ + screen.h \ + session.c \ + session.h \ + twm.c \ + twm.h \ + util.c \ + util.h \ + version.c \ + version.h \ + gram.y \ + lex.l + +BUILT_SOURCES = gram.h gram.c lex.c deftwmrc.c +MAINTAINERCLEANFILES = $(BUILT_SOURCES) +EXTRA_DIST = system.twmrc deftwmrc.sed siconify.bm +all: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) all-am + +.SUFFIXES: +.SUFFIXES: .c .l .o .obj .y +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/Makefile'; \ + cd $(top_srcdir) && \ + $(AUTOMAKE) --gnu src/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +install-binPROGRAMS: $(bin_PROGRAMS) + @$(NORMAL_INSTALL) + test -z "$(bindir)" || $(mkdir_p) "$(DESTDIR)$(bindir)" + @list='$(bin_PROGRAMS)'; for p in $$list; do \ + p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ + if test -f $$p \ + ; then \ + f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \ + echo " $(INSTALL_PROGRAM_ENV) $(binPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(bindir)/$$f'"; \ + $(INSTALL_PROGRAM_ENV) $(binPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(bindir)/$$f" || exit 1; \ + else :; fi; \ + done + +uninstall-binPROGRAMS: + @$(NORMAL_UNINSTALL) + @list='$(bin_PROGRAMS)'; for p in $$list; do \ + f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \ + echo " rm -f '$(DESTDIR)$(bindir)/$$f'"; \ + rm -f "$(DESTDIR)$(bindir)/$$f"; \ + done + +clean-binPROGRAMS: + -test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS) +twm$(EXEEXT): $(twm_OBJECTS) $(twm_DEPENDENCIES) + @rm -f twm$(EXEEXT) + $(LINK) $(twm_LDFLAGS) $(twm_OBJECTS) $(twm_LDADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/twm-add_window.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/twm-cursor.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/twm-deftwmrc.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/twm-events.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/twm-gc.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/twm-gram.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/twm-iconmgr.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/twm-icons.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/twm-lex.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/twm-list.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/twm-menus.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/twm-parse.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/twm-resize.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/twm-session.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/twm-twm.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/twm-util.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/twm-version.Po@am__quote@ + +.c.o: +@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c $< + +.c.obj: +@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` + +twm-add_window.o: add_window.c +@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(twm_CFLAGS) $(CFLAGS) -MT twm-add_window.o -MD -MP -MF "$(DEPDIR)/twm-add_window.Tpo" -c -o twm-add_window.o `test -f 'add_window.c' || echo '$(srcdir)/'`add_window.c; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/twm-add_window.Tpo" "$(DEPDIR)/twm-add_window.Po"; else rm -f "$(DEPDIR)/twm-add_window.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='add_window.c' object='twm-add_window.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(twm_CFLAGS) $(CFLAGS) -c -o twm-add_window.o `test -f 'add_window.c' || echo '$(srcdir)/'`add_window.c + +twm-add_window.obj: add_window.c +@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(twm_CFLAGS) $(CFLAGS) -MT twm-add_window.obj -MD -MP -MF "$(DEPDIR)/twm-add_window.Tpo" -c -o twm-add_window.obj `if test -f 'add_window.c'; then $(CYGPATH_W) 'add_window.c'; else $(CYGPATH_W) '$(srcdir)/add_window.c'; fi`; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/twm-add_window.Tpo" "$(DEPDIR)/twm-add_window.Po"; else rm -f "$(DEPDIR)/twm-add_window.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='add_window.c' object='twm-add_window.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(twm_CFLAGS) $(CFLAGS) -c -o twm-add_window.obj `if test -f 'add_window.c'; then $(CYGPATH_W) 'add_window.c'; else $(CYGPATH_W) '$(srcdir)/add_window.c'; fi` + +twm-cursor.o: cursor.c +@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(twm_CFLAGS) $(CFLAGS) -MT twm-cursor.o -MD -MP -MF "$(DEPDIR)/twm-cursor.Tpo" -c -o twm-cursor.o `test -f 'cursor.c' || echo '$(srcdir)/'`cursor.c; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/twm-cursor.Tpo" "$(DEPDIR)/twm-cursor.Po"; else rm -f "$(DEPDIR)/twm-cursor.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='cursor.c' object='twm-cursor.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(twm_CFLAGS) $(CFLAGS) -c -o twm-cursor.o `test -f 'cursor.c' || echo '$(srcdir)/'`cursor.c + +twm-cursor.obj: cursor.c +@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(twm_CFLAGS) $(CFLAGS) -MT twm-cursor.obj -MD -MP -MF "$(DEPDIR)/twm-cursor.Tpo" -c -o twm-cursor.obj `if test -f 'cursor.c'; then $(CYGPATH_W) 'cursor.c'; else $(CYGPATH_W) '$(srcdir)/cursor.c'; fi`; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/twm-cursor.Tpo" "$(DEPDIR)/twm-cursor.Po"; else rm -f "$(DEPDIR)/twm-cursor.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='cursor.c' object='twm-cursor.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(twm_CFLAGS) $(CFLAGS) -c -o twm-cursor.obj `if test -f 'cursor.c'; then $(CYGPATH_W) 'cursor.c'; else $(CYGPATH_W) '$(srcdir)/cursor.c'; fi` + +twm-deftwmrc.o: deftwmrc.c +@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(twm_CFLAGS) $(CFLAGS) -MT twm-deftwmrc.o -MD -MP -MF "$(DEPDIR)/twm-deftwmrc.Tpo" -c -o twm-deftwmrc.o `test -f 'deftwmrc.c' || echo '$(srcdir)/'`deftwmrc.c; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/twm-deftwmrc.Tpo" "$(DEPDIR)/twm-deftwmrc.Po"; else rm -f "$(DEPDIR)/twm-deftwmrc.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='deftwmrc.c' object='twm-deftwmrc.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(twm_CFLAGS) $(CFLAGS) -c -o twm-deftwmrc.o `test -f 'deftwmrc.c' || echo '$(srcdir)/'`deftwmrc.c + +twm-deftwmrc.obj: deftwmrc.c +@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(twm_CFLAGS) $(CFLAGS) -MT twm-deftwmrc.obj -MD -MP -MF "$(DEPDIR)/twm-deftwmrc.Tpo" -c -o twm-deftwmrc.obj `if test -f 'deftwmrc.c'; then $(CYGPATH_W) 'deftwmrc.c'; else $(CYGPATH_W) '$(srcdir)/deftwmrc.c'; fi`; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/twm-deftwmrc.Tpo" "$(DEPDIR)/twm-deftwmrc.Po"; else rm -f "$(DEPDIR)/twm-deftwmrc.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='deftwmrc.c' object='twm-deftwmrc.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(twm_CFLAGS) $(CFLAGS) -c -o twm-deftwmrc.obj `if test -f 'deftwmrc.c'; then $(CYGPATH_W) 'deftwmrc.c'; else $(CYGPATH_W) '$(srcdir)/deftwmrc.c'; fi` + +twm-events.o: events.c +@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(twm_CFLAGS) $(CFLAGS) -MT twm-events.o -MD -MP -MF "$(DEPDIR)/twm-events.Tpo" -c -o twm-events.o `test -f 'events.c' || echo '$(srcdir)/'`events.c; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/twm-events.Tpo" "$(DEPDIR)/twm-events.Po"; else rm -f "$(DEPDIR)/twm-events.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='events.c' object='twm-events.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(twm_CFLAGS) $(CFLAGS) -c -o twm-events.o `test -f 'events.c' || echo '$(srcdir)/'`events.c + +twm-events.obj: events.c +@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(twm_CFLAGS) $(CFLAGS) -MT twm-events.obj -MD -MP -MF "$(DEPDIR)/twm-events.Tpo" -c -o twm-events.obj `if test -f 'events.c'; then $(CYGPATH_W) 'events.c'; else $(CYGPATH_W) '$(srcdir)/events.c'; fi`; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/twm-events.Tpo" "$(DEPDIR)/twm-events.Po"; else rm -f "$(DEPDIR)/twm-events.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='events.c' object='twm-events.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(twm_CFLAGS) $(CFLAGS) -c -o twm-events.obj `if test -f 'events.c'; then $(CYGPATH_W) 'events.c'; else $(CYGPATH_W) '$(srcdir)/events.c'; fi` + +twm-gc.o: gc.c +@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(twm_CFLAGS) $(CFLAGS) -MT twm-gc.o -MD -MP -MF "$(DEPDIR)/twm-gc.Tpo" -c -o twm-gc.o `test -f 'gc.c' || echo '$(srcdir)/'`gc.c; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/twm-gc.Tpo" "$(DEPDIR)/twm-gc.Po"; else rm -f "$(DEPDIR)/twm-gc.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='gc.c' object='twm-gc.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(twm_CFLAGS) $(CFLAGS) -c -o twm-gc.o `test -f 'gc.c' || echo '$(srcdir)/'`gc.c + +twm-gc.obj: gc.c +@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(twm_CFLAGS) $(CFLAGS) -MT twm-gc.obj -MD -MP -MF "$(DEPDIR)/twm-gc.Tpo" -c -o twm-gc.obj `if test -f 'gc.c'; then $(CYGPATH_W) 'gc.c'; else $(CYGPATH_W) '$(srcdir)/gc.c'; fi`; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/twm-gc.Tpo" "$(DEPDIR)/twm-gc.Po"; else rm -f "$(DEPDIR)/twm-gc.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='gc.c' object='twm-gc.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(twm_CFLAGS) $(CFLAGS) -c -o twm-gc.obj `if test -f 'gc.c'; then $(CYGPATH_W) 'gc.c'; else $(CYGPATH_W) '$(srcdir)/gc.c'; fi` + +twm-iconmgr.o: iconmgr.c +@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(twm_CFLAGS) $(CFLAGS) -MT twm-iconmgr.o -MD -MP -MF "$(DEPDIR)/twm-iconmgr.Tpo" -c -o twm-iconmgr.o `test -f 'iconmgr.c' || echo '$(srcdir)/'`iconmgr.c; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/twm-iconmgr.Tpo" "$(DEPDIR)/twm-iconmgr.Po"; else rm -f "$(DEPDIR)/twm-iconmgr.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='iconmgr.c' object='twm-iconmgr.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(twm_CFLAGS) $(CFLAGS) -c -o twm-iconmgr.o `test -f 'iconmgr.c' || echo '$(srcdir)/'`iconmgr.c + +twm-iconmgr.obj: iconmgr.c +@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(twm_CFLAGS) $(CFLAGS) -MT twm-iconmgr.obj -MD -MP -MF "$(DEPDIR)/twm-iconmgr.Tpo" -c -o twm-iconmgr.obj `if test -f 'iconmgr.c'; then $(CYGPATH_W) 'iconmgr.c'; else $(CYGPATH_W) '$(srcdir)/iconmgr.c'; fi`; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/twm-iconmgr.Tpo" "$(DEPDIR)/twm-iconmgr.Po"; else rm -f "$(DEPDIR)/twm-iconmgr.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='iconmgr.c' object='twm-iconmgr.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(twm_CFLAGS) $(CFLAGS) -c -o twm-iconmgr.obj `if test -f 'iconmgr.c'; then $(CYGPATH_W) 'iconmgr.c'; else $(CYGPATH_W) '$(srcdir)/iconmgr.c'; fi` + +twm-icons.o: icons.c +@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(twm_CFLAGS) $(CFLAGS) -MT twm-icons.o -MD -MP -MF "$(DEPDIR)/twm-icons.Tpo" -c -o twm-icons.o `test -f 'icons.c' || echo '$(srcdir)/'`icons.c; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/twm-icons.Tpo" "$(DEPDIR)/twm-icons.Po"; else rm -f "$(DEPDIR)/twm-icons.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='icons.c' object='twm-icons.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(twm_CFLAGS) $(CFLAGS) -c -o twm-icons.o `test -f 'icons.c' || echo '$(srcdir)/'`icons.c + +twm-icons.obj: icons.c +@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(twm_CFLAGS) $(CFLAGS) -MT twm-icons.obj -MD -MP -MF "$(DEPDIR)/twm-icons.Tpo" -c -o twm-icons.obj `if test -f 'icons.c'; then $(CYGPATH_W) 'icons.c'; else $(CYGPATH_W) '$(srcdir)/icons.c'; fi`; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/twm-icons.Tpo" "$(DEPDIR)/twm-icons.Po"; else rm -f "$(DEPDIR)/twm-icons.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='icons.c' object='twm-icons.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(twm_CFLAGS) $(CFLAGS) -c -o twm-icons.obj `if test -f 'icons.c'; then $(CYGPATH_W) 'icons.c'; else $(CYGPATH_W) '$(srcdir)/icons.c'; fi` + +twm-list.o: list.c +@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(twm_CFLAGS) $(CFLAGS) -MT twm-list.o -MD -MP -MF "$(DEPDIR)/twm-list.Tpo" -c -o twm-list.o `test -f 'list.c' || echo '$(srcdir)/'`list.c; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/twm-list.Tpo" "$(DEPDIR)/twm-list.Po"; else rm -f "$(DEPDIR)/twm-list.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='list.c' object='twm-list.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(twm_CFLAGS) $(CFLAGS) -c -o twm-list.o `test -f 'list.c' || echo '$(srcdir)/'`list.c + +twm-list.obj: list.c +@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(twm_CFLAGS) $(CFLAGS) -MT twm-list.obj -MD -MP -MF "$(DEPDIR)/twm-list.Tpo" -c -o twm-list.obj `if test -f 'list.c'; then $(CYGPATH_W) 'list.c'; else $(CYGPATH_W) '$(srcdir)/list.c'; fi`; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/twm-list.Tpo" "$(DEPDIR)/twm-list.Po"; else rm -f "$(DEPDIR)/twm-list.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='list.c' object='twm-list.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(twm_CFLAGS) $(CFLAGS) -c -o twm-list.obj `if test -f 'list.c'; then $(CYGPATH_W) 'list.c'; else $(CYGPATH_W) '$(srcdir)/list.c'; fi` + +twm-menus.o: menus.c +@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(twm_CFLAGS) $(CFLAGS) -MT twm-menus.o -MD -MP -MF "$(DEPDIR)/twm-menus.Tpo" -c -o twm-menus.o `test -f 'menus.c' || echo '$(srcdir)/'`menus.c; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/twm-menus.Tpo" "$(DEPDIR)/twm-menus.Po"; else rm -f "$(DEPDIR)/twm-menus.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='menus.c' object='twm-menus.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(twm_CFLAGS) $(CFLAGS) -c -o twm-menus.o `test -f 'menus.c' || echo '$(srcdir)/'`menus.c + +twm-menus.obj: menus.c +@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(twm_CFLAGS) $(CFLAGS) -MT twm-menus.obj -MD -MP -MF "$(DEPDIR)/twm-menus.Tpo" -c -o twm-menus.obj `if test -f 'menus.c'; then $(CYGPATH_W) 'menus.c'; else $(CYGPATH_W) '$(srcdir)/menus.c'; fi`; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/twm-menus.Tpo" "$(DEPDIR)/twm-menus.Po"; else rm -f "$(DEPDIR)/twm-menus.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='menus.c' object='twm-menus.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(twm_CFLAGS) $(CFLAGS) -c -o twm-menus.obj `if test -f 'menus.c'; then $(CYGPATH_W) 'menus.c'; else $(CYGPATH_W) '$(srcdir)/menus.c'; fi` + +twm-parse.o: parse.c +@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(twm_CFLAGS) $(CFLAGS) -MT twm-parse.o -MD -MP -MF "$(DEPDIR)/twm-parse.Tpo" -c -o twm-parse.o `test -f 'parse.c' || echo '$(srcdir)/'`parse.c; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/twm-parse.Tpo" "$(DEPDIR)/twm-parse.Po"; else rm -f "$(DEPDIR)/twm-parse.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='parse.c' object='twm-parse.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(twm_CFLAGS) $(CFLAGS) -c -o twm-parse.o `test -f 'parse.c' || echo '$(srcdir)/'`parse.c + +twm-parse.obj: parse.c +@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(twm_CFLAGS) $(CFLAGS) -MT twm-parse.obj -MD -MP -MF "$(DEPDIR)/twm-parse.Tpo" -c -o twm-parse.obj `if test -f 'parse.c'; then $(CYGPATH_W) 'parse.c'; else $(CYGPATH_W) '$(srcdir)/parse.c'; fi`; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/twm-parse.Tpo" "$(DEPDIR)/twm-parse.Po"; else rm -f "$(DEPDIR)/twm-parse.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='parse.c' object='twm-parse.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(twm_CFLAGS) $(CFLAGS) -c -o twm-parse.obj `if test -f 'parse.c'; then $(CYGPATH_W) 'parse.c'; else $(CYGPATH_W) '$(srcdir)/parse.c'; fi` + +twm-resize.o: resize.c +@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(twm_CFLAGS) $(CFLAGS) -MT twm-resize.o -MD -MP -MF "$(DEPDIR)/twm-resize.Tpo" -c -o twm-resize.o `test -f 'resize.c' || echo '$(srcdir)/'`resize.c; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/twm-resize.Tpo" "$(DEPDIR)/twm-resize.Po"; else rm -f "$(DEPDIR)/twm-resize.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='resize.c' object='twm-resize.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(twm_CFLAGS) $(CFLAGS) -c -o twm-resize.o `test -f 'resize.c' || echo '$(srcdir)/'`resize.c + +twm-resize.obj: resize.c +@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(twm_CFLAGS) $(CFLAGS) -MT twm-resize.obj -MD -MP -MF "$(DEPDIR)/twm-resize.Tpo" -c -o twm-resize.obj `if test -f 'resize.c'; then $(CYGPATH_W) 'resize.c'; else $(CYGPATH_W) '$(srcdir)/resize.c'; fi`; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/twm-resize.Tpo" "$(DEPDIR)/twm-resize.Po"; else rm -f "$(DEPDIR)/twm-resize.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='resize.c' object='twm-resize.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(twm_CFLAGS) $(CFLAGS) -c -o twm-resize.obj `if test -f 'resize.c'; then $(CYGPATH_W) 'resize.c'; else $(CYGPATH_W) '$(srcdir)/resize.c'; fi` + +twm-session.o: session.c +@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(twm_CFLAGS) $(CFLAGS) -MT twm-session.o -MD -MP -MF "$(DEPDIR)/twm-session.Tpo" -c -o twm-session.o `test -f 'session.c' || echo '$(srcdir)/'`session.c; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/twm-session.Tpo" "$(DEPDIR)/twm-session.Po"; else rm -f "$(DEPDIR)/twm-session.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='session.c' object='twm-session.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(twm_CFLAGS) $(CFLAGS) -c -o twm-session.o `test -f 'session.c' || echo '$(srcdir)/'`session.c + +twm-session.obj: session.c +@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(twm_CFLAGS) $(CFLAGS) -MT twm-session.obj -MD -MP -MF "$(DEPDIR)/twm-session.Tpo" -c -o twm-session.obj `if test -f 'session.c'; then $(CYGPATH_W) 'session.c'; else $(CYGPATH_W) '$(srcdir)/session.c'; fi`; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/twm-session.Tpo" "$(DEPDIR)/twm-session.Po"; else rm -f "$(DEPDIR)/twm-session.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='session.c' object='twm-session.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(twm_CFLAGS) $(CFLAGS) -c -o twm-session.obj `if test -f 'session.c'; then $(CYGPATH_W) 'session.c'; else $(CYGPATH_W) '$(srcdir)/session.c'; fi` + +twm-twm.o: twm.c +@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(twm_CFLAGS) $(CFLAGS) -MT twm-twm.o -MD -MP -MF "$(DEPDIR)/twm-twm.Tpo" -c -o twm-twm.o `test -f 'twm.c' || echo '$(srcdir)/'`twm.c; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/twm-twm.Tpo" "$(DEPDIR)/twm-twm.Po"; else rm -f "$(DEPDIR)/twm-twm.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='twm.c' object='twm-twm.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(twm_CFLAGS) $(CFLAGS) -c -o twm-twm.o `test -f 'twm.c' || echo '$(srcdir)/'`twm.c + +twm-twm.obj: twm.c +@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(twm_CFLAGS) $(CFLAGS) -MT twm-twm.obj -MD -MP -MF "$(DEPDIR)/twm-twm.Tpo" -c -o twm-twm.obj `if test -f 'twm.c'; then $(CYGPATH_W) 'twm.c'; else $(CYGPATH_W) '$(srcdir)/twm.c'; fi`; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/twm-twm.Tpo" "$(DEPDIR)/twm-twm.Po"; else rm -f "$(DEPDIR)/twm-twm.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='twm.c' object='twm-twm.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(twm_CFLAGS) $(CFLAGS) -c -o twm-twm.obj `if test -f 'twm.c'; then $(CYGPATH_W) 'twm.c'; else $(CYGPATH_W) '$(srcdir)/twm.c'; fi` + +twm-util.o: util.c +@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(twm_CFLAGS) $(CFLAGS) -MT twm-util.o -MD -MP -MF "$(DEPDIR)/twm-util.Tpo" -c -o twm-util.o `test -f 'util.c' || echo '$(srcdir)/'`util.c; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/twm-util.Tpo" "$(DEPDIR)/twm-util.Po"; else rm -f "$(DEPDIR)/twm-util.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='util.c' object='twm-util.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(twm_CFLAGS) $(CFLAGS) -c -o twm-util.o `test -f 'util.c' || echo '$(srcdir)/'`util.c + +twm-util.obj: util.c +@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(twm_CFLAGS) $(CFLAGS) -MT twm-util.obj -MD -MP -MF "$(DEPDIR)/twm-util.Tpo" -c -o twm-util.obj `if test -f 'util.c'; then $(CYGPATH_W) 'util.c'; else $(CYGPATH_W) '$(srcdir)/util.c'; fi`; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/twm-util.Tpo" "$(DEPDIR)/twm-util.Po"; else rm -f "$(DEPDIR)/twm-util.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='util.c' object='twm-util.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(twm_CFLAGS) $(CFLAGS) -c -o twm-util.obj `if test -f 'util.c'; then $(CYGPATH_W) 'util.c'; else $(CYGPATH_W) '$(srcdir)/util.c'; fi` + +twm-version.o: version.c +@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(twm_CFLAGS) $(CFLAGS) -MT twm-version.o -MD -MP -MF "$(DEPDIR)/twm-version.Tpo" -c -o twm-version.o `test -f 'version.c' || echo '$(srcdir)/'`version.c; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/twm-version.Tpo" "$(DEPDIR)/twm-version.Po"; else rm -f "$(DEPDIR)/twm-version.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='version.c' object='twm-version.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(twm_CFLAGS) $(CFLAGS) -c -o twm-version.o `test -f 'version.c' || echo '$(srcdir)/'`version.c + +twm-version.obj: version.c +@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(twm_CFLAGS) $(CFLAGS) -MT twm-version.obj -MD -MP -MF "$(DEPDIR)/twm-version.Tpo" -c -o twm-version.obj `if test -f 'version.c'; then $(CYGPATH_W) 'version.c'; else $(CYGPATH_W) '$(srcdir)/version.c'; fi`; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/twm-version.Tpo" "$(DEPDIR)/twm-version.Po"; else rm -f "$(DEPDIR)/twm-version.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='version.c' object='twm-version.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(twm_CFLAGS) $(CFLAGS) -c -o twm-version.obj `if test -f 'version.c'; then $(CYGPATH_W) 'version.c'; else $(CYGPATH_W) '$(srcdir)/version.c'; fi` + +twm-gram.o: gram.c +@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(twm_CFLAGS) $(CFLAGS) -MT twm-gram.o -MD -MP -MF "$(DEPDIR)/twm-gram.Tpo" -c -o twm-gram.o `test -f 'gram.c' || echo '$(srcdir)/'`gram.c; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/twm-gram.Tpo" "$(DEPDIR)/twm-gram.Po"; else rm -f "$(DEPDIR)/twm-gram.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='gram.c' object='twm-gram.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(twm_CFLAGS) $(CFLAGS) -c -o twm-gram.o `test -f 'gram.c' || echo '$(srcdir)/'`gram.c + +twm-gram.obj: gram.c +@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(twm_CFLAGS) $(CFLAGS) -MT twm-gram.obj -MD -MP -MF "$(DEPDIR)/twm-gram.Tpo" -c -o twm-gram.obj `if test -f 'gram.c'; then $(CYGPATH_W) 'gram.c'; else $(CYGPATH_W) '$(srcdir)/gram.c'; fi`; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/twm-gram.Tpo" "$(DEPDIR)/twm-gram.Po"; else rm -f "$(DEPDIR)/twm-gram.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='gram.c' object='twm-gram.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(twm_CFLAGS) $(CFLAGS) -c -o twm-gram.obj `if test -f 'gram.c'; then $(CYGPATH_W) 'gram.c'; else $(CYGPATH_W) '$(srcdir)/gram.c'; fi` + +twm-lex.o: lex.c +@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(twm_CFLAGS) $(CFLAGS) -MT twm-lex.o -MD -MP -MF "$(DEPDIR)/twm-lex.Tpo" -c -o twm-lex.o `test -f 'lex.c' || echo '$(srcdir)/'`lex.c; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/twm-lex.Tpo" "$(DEPDIR)/twm-lex.Po"; else rm -f "$(DEPDIR)/twm-lex.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='lex.c' object='twm-lex.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(twm_CFLAGS) $(CFLAGS) -c -o twm-lex.o `test -f 'lex.c' || echo '$(srcdir)/'`lex.c + +twm-lex.obj: lex.c +@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(twm_CFLAGS) $(CFLAGS) -MT twm-lex.obj -MD -MP -MF "$(DEPDIR)/twm-lex.Tpo" -c -o twm-lex.obj `if test -f 'lex.c'; then $(CYGPATH_W) 'lex.c'; else $(CYGPATH_W) '$(srcdir)/lex.c'; fi`; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/twm-lex.Tpo" "$(DEPDIR)/twm-lex.Po"; else rm -f "$(DEPDIR)/twm-lex.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='lex.c' object='twm-lex.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(twm_CFLAGS) $(CFLAGS) -c -o twm-lex.obj `if test -f 'lex.c'; then $(CYGPATH_W) 'lex.c'; else $(CYGPATH_W) '$(srcdir)/lex.c'; fi` + +.l.c: + $(LEXCOMPILE) $< + sed '/^#/ s|$(LEX_OUTPUT_ROOT)\.c|$@|' $(LEX_OUTPUT_ROOT).c >$@ + rm -f $(LEX_OUTPUT_ROOT).c + +.y.c: + $(YACCCOMPILE) $< + if test -f y.tab.h; then \ + to=`echo "$*_H" | sed \ + -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/' \ + -e 's/[^ABCDEFGHIJKLMNOPQRSTUVWXYZ]/_/g'`; \ + sed -e "/^#/!b" -e "s/Y_TAB_H/$$to/g" -e "s|y\.tab\.h|$*.h|" \ + y.tab.h >$*.ht; \ + rm -f y.tab.h; \ + if cmp -s $*.ht $*.h; then \ + rm -f $*.ht ;\ + else \ + mv $*.ht $*.h; \ + fi; \ + fi + if test -f y.output; then \ + mv y.output $*.output; \ + fi + sed '/^#/ s|y\.tab\.c|$@|' y.tab.c >$@t && mv $@t $@ + rm -f y.tab.c +uninstall-info-am: + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$tags $$unique; \ + fi +ctags: CTAGS +CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + test -z "$(CTAGS_ARGS)$$tags$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$tags $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && cd $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) $$here + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ + list='$(DISTFILES)'; for file in $$list; do \ + case $$file in \ + $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ + $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ + esac; \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test "$$dir" != "$$file" && test "$$dir" != "."; then \ + dir="/$$dir"; \ + $(mkdir_p) "$(distdir)$$dir"; \ + else \ + dir=''; \ + fi; \ + if test -d $$d/$$file; then \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ + fi; \ + cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ + else \ + test -f $(distdir)/$$file \ + || cp -p $$d/$$file $(distdir)/$$file \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) check-am +all-am: Makefile $(PROGRAMS) +installdirs: + for dir in "$(DESTDIR)$(bindir)"; do \ + test -z "$$dir" || $(mkdir_p) "$$dir"; \ + done +install: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." + -rm -f gram.c + -rm -f gram.h + -rm -f lex.c + -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES) + -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) +clean: clean-am + +clean-am: clean-binPROGRAMS clean-generic mostlyclean-am + +distclean: distclean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +info: info-am + +info-am: + +install-data-am: + +install-exec-am: install-binPROGRAMS + +install-info: install-info-am + +install-man: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-binPROGRAMS uninstall-info-am + +.PHONY: CTAGS GTAGS all all-am check check-am clean clean-binPROGRAMS \ + clean-generic ctags distclean distclean-compile \ + distclean-generic distclean-tags distdir dvi dvi-am html \ + html-am info info-am install install-am install-binPROGRAMS \ + install-data install-data-am install-exec install-exec-am \ + install-info install-info-am install-man install-strip \ + installcheck installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-compile \ + mostlyclean-generic pdf pdf-am ps ps-am tags uninstall \ + uninstall-am uninstall-binPROGRAMS uninstall-info-am + + +gram.h: gram.c + +deftwmrc.c: system.twmrc + rm -f $@ + echo '/* ' >>$@ + echo ' * This file is generated automatically from the default' >>$@ + echo ' * twm bindings file system.twmrc by the twm Imakefile.' >>$@ + echo ' */' >>$@ + echo '' >>$@ + echo 'unsigned char *defTwmrc[] = {' >>$@ + sed -f ${srcdir}/deftwmrc.sed < ${srcdir}/system.twmrc >>$@ + echo ' (unsigned char *) 0 };' >>$@ +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/app/twm/src/add_window.c b/app/twm/src/add_window.c new file mode 100644 index 000000000..47610a6b6 --- /dev/null +++ b/app/twm/src/add_window.c @@ -0,0 +1,1594 @@ +/* $XFree86: xc/programs/twm/add_window.c,v 1.11 2002/04/04 14:05:58 eich Exp $ */ +/*****************************************************************************/ +/* + +Copyright 1989,1998 The Open Group + +Permission to use, copy, modify, distribute, and sell this software and its +documentation for any purpose is hereby granted without fee, provided that +the above copyright notice appear in all copies and that both that +copyright notice and this permission notice appear in supporting +documentation. + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the name of The Open Group shall not be +used in advertising or otherwise to promote the sale, use or other dealings +in this Software without prior written authorization from The Open Group. + +*/ +/** Copyright 1988 by Evans & Sutherland Computer Corporation, **/ +/** Salt Lake City, Utah **/ +/** Cambridge, Massachusetts **/ +/** **/ +/** All Rights Reserved **/ +/** **/ +/** Permission to use, copy, modify, and distribute this software and **/ +/** its documentation for any purpose and without fee is hereby **/ +/** granted, provided that the above copyright notice appear in all **/ +/** copies and that both that copyright notice and this permis- **/ +/** sion notice appear in supporting documentation, and that the **/ +/** name of Evans & Sutherland not be used in advertising **/ +/** in publicity pertaining to distribution of the software without **/ +/** specific, written prior permission. **/ +/** **/ +/** EVANS & SUTHERLAND DISCLAIMs ALL WARRANTIES WITH REGARD **/ +/** TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANT- **/ +/** ABILITY AND FITNESS, IN NO EVENT SHALL EVANS & SUTHERLAND **/ +/** BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAM- **/ +/** AGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA **/ +/** OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER **/ +/** TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE **/ +/** OR PERFORMANCE OF THIS SOFTWARE. **/ +/*****************************************************************************/ + + +/********************************************************************** + * + * $Xorg: add_window.c,v 1.5 2001/02/09 02:05:36 xorgcvs Exp $ + * + * Add a new window, put the titlbar and other stuff around + * the window + * + * 31-Mar-88 Tom LaStrange Initial Version. + * + **********************************************************************/ + +#include +#include "twm.h" +#include +#include "util.h" +#include "resize.h" +#include "parse.h" +#include "list.h" +#include "events.h" +#include "menus.h" +#include "screen.h" +#include "iconmgr.h" +#include "session.h" +#include "add_window.h" + +#define gray_width 2 +#define gray_height 2 +static char gray_bits[] = { + 0x02, 0x01}; + +int AddingX; +int AddingY; +int AddingW; +int AddingH; + +static int PlaceX = 50; +static int PlaceY = 50; + +static void do_add_binding ( int button, int context, int modifier, int func ); +static Window CreateHighlightWindow ( TwmWindow *tmp_win ); +static void CreateWindowTitlebarButtons ( TwmWindow *tmp_win ); + + +char NoName[] = "Untitled"; /* name if no name is specified */ + + +/** + * map gravity to (x,y) offset signs for adding to x and y when window is + * mapped to get proper placement. + * + * \param tmp window from which to get gravity + * \param xp,yp return values + * + */ +void +GetGravityOffsets (TwmWindow *tmp, int *xp, int *yp) +{ + static struct _gravity_offset { + int x, y; + } gravity_offsets[11] = { + { 0, 0 }, /* ForgetGravity */ + { -1, -1 }, /* NorthWestGravity */ + { 0, -1 }, /* NorthGravity */ + { 1, -1 }, /* NorthEastGravity */ + { -1, 0 }, /* WestGravity */ + { 0, 0 }, /* CenterGravity */ + { 1, 0 }, /* EastGravity */ + { -1, 1 }, /* SouthWestGravity */ + { 0, 1 }, /* SouthGravity */ + { 1, 1 }, /* SouthEastGravity */ + { 0, 0 }, /* StaticGravity */ + }; + register int g = ((tmp->hints.flags & PWinGravity) + ? tmp->hints.win_gravity : NorthWestGravity); + + if (g < ForgetGravity || g > StaticGravity) { + *xp = *yp = 0; + } else { + *xp = gravity_offsets[g].x; + *yp = gravity_offsets[g].y; + } +} + + + + +/** + * add a new window to the twm list. + * + * \return pointer to the TwmWindow structure + * + * \param w the window id of the window to add + * \param iconm flag to tell if this is an icon manager window + * \param iconp pointer to icon manager struct + */ +TwmWindow * +AddWindow(Window w, int iconm, IconMgr *iconp) +{ + TwmWindow *tmp_win; /* new twm window structure */ + int stat; + XEvent event; + unsigned long valuemask; /* mask for create windows */ + XSetWindowAttributes attributes; /* attributes for create windows */ + int width, height; /* tmp variable */ + int ask_user; /* don't know where to put the window */ + int gravx, gravy; /* gravity signs for positioning */ + int namelen; + int bw2; + short saved_x, saved_y, restore_icon_x, restore_icon_y; + unsigned short saved_width, saved_height; + Bool restore_iconified = 0; + Bool restore_icon_info_present = 0; + int restoredFromPrevSession; + Bool width_ever_changed_by_user; + Bool height_ever_changed_by_user; + char *name; + +#ifdef DEBUG + fprintf(stderr, "AddWindow: w = 0x%x\n", w); +#endif + + /* allocate space for the twm window */ + tmp_win = (TwmWindow *)calloc(1, sizeof(TwmWindow)); + if (tmp_win == 0) + { + fprintf (stderr, "%s: Unable to allocate memory to manage window ID %lx.\n", + ProgramName, w); + return NULL; + } + tmp_win->w = w; + tmp_win->zoomed = ZOOM_NONE; + tmp_win->iconmgr = iconm; + tmp_win->iconmgrp = iconp; + tmp_win->cmaps.number_cwins = 0; + + XSelectInput(dpy, tmp_win->w, PropertyChangeMask); + + XGetWindowAttributes(dpy, tmp_win->w, &tmp_win->attr); + + if (!I18N_FetchName(dpy, tmp_win->w, &name)) + name = NULL; + tmp_win->class = NoClass; + XGetClassHint(dpy, tmp_win->w, &tmp_win->class); + FetchWmProtocols (tmp_win); + FetchWmColormapWindows (tmp_win); + + if (name == NULL) + tmp_win->name = strdup(NoName); + else { + tmp_win->name = strdup(name); + free(name); + } + + if (GetWindowConfig (tmp_win, + &saved_x, &saved_y, &saved_width, &saved_height, + &restore_iconified, &restore_icon_info_present, + &restore_icon_x, &restore_icon_y, + &width_ever_changed_by_user, &height_ever_changed_by_user)) + { + tmp_win->attr.x = saved_x; + tmp_win->attr.y = saved_y; + + tmp_win->widthEverChangedByUser = width_ever_changed_by_user; + tmp_win->heightEverChangedByUser = height_ever_changed_by_user; + + if (width_ever_changed_by_user) + tmp_win->attr.width = saved_width; + + if (height_ever_changed_by_user) + tmp_win->attr.height = saved_height; + + restoredFromPrevSession = 1; + } + else + { + tmp_win->widthEverChangedByUser = False; + tmp_win->heightEverChangedByUser = False; + + restoredFromPrevSession = 0; + } + + + /* + * do initial clip; should look at window gravity + */ + if (tmp_win->attr.width > Scr->MaxWindowWidth) + tmp_win->attr.width = Scr->MaxWindowWidth; + if (tmp_win->attr.height > Scr->MaxWindowHeight) + tmp_win->attr.height = Scr->MaxWindowHeight; + + tmp_win->wmhints = XGetWMHints(dpy, tmp_win->w); + + if (tmp_win->wmhints) + { + if (restore_iconified) + { + tmp_win->wmhints->initial_state = IconicState; + tmp_win->wmhints->flags |= StateHint; + } + + if (restore_icon_info_present) + { + tmp_win->wmhints->icon_x = restore_icon_x; + tmp_win->wmhints->icon_y = restore_icon_y; + tmp_win->wmhints->flags |= IconPositionHint; + } + } + + if (tmp_win->wmhints && (tmp_win->wmhints->flags & WindowGroupHint)) + tmp_win->group = tmp_win->wmhints->window_group; + else + tmp_win->group = tmp_win->w/* NULL */; + + /* + * The July 27, 1988 draft of the ICCCM ignores the size and position + * fields in the WM_NORMAL_HINTS property. + */ + + tmp_win->transient = Transient(tmp_win->w, &tmp_win->transientfor); + + tmp_win->nameChanged = 0; + if (tmp_win->class.res_name == NULL) + tmp_win->class.res_name = NoName; + if (tmp_win->class.res_class == NULL) + tmp_win->class.res_class = NoName; + + tmp_win->full_name = strdup(tmp_win->name); + namelen = strlen (tmp_win->name); + + tmp_win->highlight = Scr->Highlight && + (!(short)(long) LookInList(Scr->NoHighlight, tmp_win->full_name, + &tmp_win->class)); + + tmp_win->stackmode = Scr->StackMode && + (!(short)(long) LookInList(Scr->NoStackModeL, tmp_win->full_name, + &tmp_win->class)); + + tmp_win->titlehighlight = Scr->TitleHighlight && + (!(short)(long) LookInList(Scr->NoTitleHighlight, tmp_win->full_name, + &tmp_win->class)); + + tmp_win->auto_raise = (short)(long) LookInList(Scr->AutoRaise, + tmp_win->full_name, + &tmp_win->class); + if (tmp_win->auto_raise) Scr->NumAutoRaises++; + tmp_win->iconify_by_unmapping = Scr->IconifyByUnmapping; + if (Scr->IconifyByUnmapping) + { + tmp_win->iconify_by_unmapping = iconm ? FALSE : + !(short)(long) LookInList(Scr->DontIconify, tmp_win->full_name, + &tmp_win->class); + } + tmp_win->iconify_by_unmapping |= + (short)(long) LookInList(Scr->IconifyByUn, tmp_win->full_name, + &tmp_win->class); + + if (LookInList(Scr->WindowRingL, tmp_win->full_name, &tmp_win->class)) { + if (Scr->Ring) { + tmp_win->ring.next = Scr->Ring->ring.next; + if (Scr->Ring->ring.next->ring.prev) + Scr->Ring->ring.next->ring.prev = tmp_win; + Scr->Ring->ring.next = tmp_win; + tmp_win->ring.prev = Scr->Ring; + } else { + tmp_win->ring.next = tmp_win->ring.prev = Scr->Ring = tmp_win; + } + } else + tmp_win->ring.next = tmp_win->ring.prev = NULL; + tmp_win->ring.cursor_valid = False; + + tmp_win->squeeze_info = NULL; + /* + * get the squeeze information; note that this does not have to be freed + * since it is coming from the screen list + */ + if (HasShape) { + if (!LookInList (Scr->DontSqueezeTitleL, tmp_win->full_name, + &tmp_win->class)) { + tmp_win->squeeze_info = (SqueezeInfo *) + LookInList (Scr->SqueezeTitleL, tmp_win->full_name, + &tmp_win->class); + if (!tmp_win->squeeze_info) { + static SqueezeInfo default_squeeze = { J_LEFT, 0, 0 }; + if (Scr->SqueezeTitle) + tmp_win->squeeze_info = &default_squeeze; + } + } + } + + tmp_win->old_bw = tmp_win->attr.border_width; + + if (Scr->ClientBorderWidth) { + tmp_win->frame_bw = tmp_win->old_bw; + } else { + tmp_win->frame_bw = Scr->BorderWidth; + } + bw2 = tmp_win->frame_bw * 2; + + tmp_win->title_height = Scr->TitleHeight + tmp_win->frame_bw; + if (Scr->NoTitlebar) + tmp_win->title_height = 0; + if (LookInList(Scr->MakeTitle, tmp_win->full_name, &tmp_win->class)) + tmp_win->title_height = Scr->TitleHeight + tmp_win->frame_bw; + if (LookInList(Scr->NoTitle, tmp_win->full_name, &tmp_win->class)) + tmp_win->title_height = 0; + + /* if it is a transient window, don't put a title on it */ + if (tmp_win->transient && !Scr->DecorateTransients) + tmp_win->title_height = 0; + + if (LookInList(Scr->StartIconified, tmp_win->full_name, &tmp_win->class)) + { + if (!tmp_win->wmhints) + { + tmp_win->wmhints = (XWMHints *)malloc(sizeof(XWMHints)); + tmp_win->wmhints->flags = 0; + } + tmp_win->wmhints->initial_state = IconicState; + tmp_win->wmhints->flags |= StateHint; + } + + GetWindowSizeHints (tmp_win); + + if (restoredFromPrevSession) + { + /* + * When restoring window positions from the previous session, + * we always use NorthWest gravity. + */ + + gravx = gravy = -1; + } + else + { + GetGravityOffsets (tmp_win, &gravx, &gravy); + } + + /* + * Don't bother user if: + * + * o the window is a transient, or + * + * o a USPosition was requested, or + * + * o a PPosition was requested and UsePPosition is ON or + * NON_ZERO if the window is at other than (0,0) + */ + ask_user = TRUE; + if (tmp_win->transient || + (tmp_win->hints.flags & USPosition) || + ((tmp_win->hints.flags & PPosition) && Scr->UsePPosition && + (Scr->UsePPosition == PPOS_ON || + tmp_win->attr.x != 0 || tmp_win->attr.y != 0))) + ask_user = FALSE; + + /* + * do any prompting for position + */ + if (HandlingEvents && ask_user && !restoredFromPrevSession) { + if (Scr->RandomPlacement) { /* just stick it somewhere */ + if ((PlaceX + tmp_win->attr.width) > Scr->MyDisplayWidth) + PlaceX = 50; + if ((PlaceY + tmp_win->attr.height) > Scr->MyDisplayHeight) + PlaceY = 50; + + tmp_win->attr.x = PlaceX; + tmp_win->attr.y = PlaceY; + PlaceX += 30; + PlaceY += 30; + } else { /* else prompt */ + if (!(tmp_win->wmhints && tmp_win->wmhints->flags & StateHint && + tmp_win->wmhints->initial_state == IconicState)) + { + Bool firsttime = True; + + /* better wait until all the mouse buttons have been + * released. + */ + while (TRUE) + { + XUngrabServer(dpy); + XSync(dpy, 0); + XGrabServer(dpy); + + JunkMask = 0; + if (!XQueryPointer (dpy, Scr->Root, &JunkRoot, + &JunkChild, &JunkX, &JunkY, + &AddingX, &AddingY, &JunkMask)) + JunkMask = 0; + + JunkMask &= (Button1Mask | Button2Mask | Button3Mask | + Button4Mask | Button5Mask); + + /* + * watch out for changing screens + */ + if (firsttime) { + if (JunkRoot != Scr->Root) { + register int scrnum; + + for (scrnum = 0; scrnum < NumScreens; scrnum++) { + if (JunkRoot == RootWindow (dpy, scrnum)) break; + } + + if (scrnum != NumScreens) PreviousScreen = scrnum; + } + firsttime = False; + } + + /* + * wait for buttons to come up; yuck + */ + if (JunkMask != 0) continue; + + /* + * this will cause a warp to the indicated root + */ + stat = XGrabPointer(dpy, Scr->Root, False, + ButtonPressMask | ButtonReleaseMask | + PointerMotionMask | PointerMotionHintMask, + GrabModeAsync, GrabModeAsync, + Scr->Root, UpperLeftCursor, CurrentTime); + + if (stat == GrabSuccess) + break; + } + + width = (SIZE_HINDENT + MyFont_TextWidth (&Scr->SizeFont, + tmp_win->name, namelen)); + height = Scr->SizeFont.height + SIZE_VINDENT * 2; + + XResizeWindow (dpy, Scr->SizeWindow, width + SIZE_HINDENT, height); + XMapRaised(dpy, Scr->SizeWindow); + InstallRootColormap(); + + MyFont_ChangeGC(Scr->DefaultC.fore, Scr->DefaultC.back, + &Scr->SizeFont); + MyFont_DrawImageString (dpy, Scr->SizeWindow, &Scr->SizeFont, + Scr->NormalGC, + SIZE_HINDENT, + SIZE_VINDENT + Scr->SizeFont.ascent, + tmp_win->name, namelen); + + AddingW = tmp_win->attr.width + bw2; + AddingH = tmp_win->attr.height + tmp_win->title_height + bw2; + + if (Scr->DontMoveOff) { + /* + * Make sure the initial outline comes up on the screen. + */ + if (AddingX < 0) + AddingX = 0; + if (AddingX > Scr->MyDisplayWidth - AddingW) + AddingX = Scr->MyDisplayWidth - AddingW; + + if (AddingY < 0) + AddingY = 0; + if (AddingY > Scr->MyDisplayHeight - AddingH) + AddingY = Scr->MyDisplayHeight - AddingH; + } + + MoveOutline(Scr->Root, AddingX, AddingY, AddingW, AddingH, + tmp_win->frame_bw, tmp_win->title_height); + + while (TRUE) + { + XMaskEvent(dpy, ButtonPressMask | PointerMotionMask, &event); + + if (Event.type == MotionNotify) { + /* discard any extra motion events before a release */ + while(XCheckMaskEvent(dpy, + ButtonMotionMask | ButtonPressMask, &Event)) + if (Event.type == ButtonPress) + break; + } + + if (event.type == ButtonPress) { + AddingX = event.xbutton.x_root; + AddingY = event.xbutton.y_root; + + /* DontMoveOff prohibits user form off-screen placement */ + if (Scr->DontMoveOff) + { + int AddingR, AddingB; + + AddingR = AddingX + AddingW; + AddingB = AddingY + AddingH; + + if (AddingX < 0) + AddingX = 0; + if (AddingR > Scr->MyDisplayWidth) + AddingX = Scr->MyDisplayWidth - AddingW; + + if (AddingY < 0) + AddingY = 0; + if (AddingB > Scr->MyDisplayHeight) + AddingY = Scr->MyDisplayHeight - AddingH; + + } + break; + } + + if (event.type != MotionNotify) { + continue; + } + + XQueryPointer(dpy, Scr->Root, &JunkRoot, &JunkChild, + &JunkX, &JunkY, &AddingX, &AddingY, &JunkMask); + + if (Scr->DontMoveOff) + { + int AddingR, AddingB; + + AddingR = AddingX + AddingW; + AddingB = AddingY + AddingH; + + if (AddingX < 0) + AddingX = 0; + if (AddingR > Scr->MyDisplayWidth) + AddingX = Scr->MyDisplayWidth - AddingW; + + if (AddingY < 0) + AddingY = 0; + if (AddingB > Scr->MyDisplayHeight) + AddingY = Scr->MyDisplayHeight - AddingH; + } + + MoveOutline(Scr->Root, AddingX, AddingY, AddingW, AddingH, + tmp_win->frame_bw, tmp_win->title_height); + + } + + if (event.xbutton.button == Button2) { + int lastx, lasty; + + Scr->SizeStringOffset = width + + MyFont_TextWidth(&Scr->SizeFont, ": ", 2); + XResizeWindow (dpy, Scr->SizeWindow, Scr->SizeStringOffset + + Scr->SizeStringWidth, height); + MyFont_DrawImageString (dpy, Scr->SizeWindow, &Scr->SizeFont, + Scr->NormalGC, width, + SIZE_VINDENT + Scr->SizeFont.ascent, + ": ", 2); + if (0/*Scr->AutoRelativeResize*/) { + int dx = (tmp_win->attr.width / 4); + int dy = (tmp_win->attr.height / 4); + +#define HALF_AVE_CURSOR_SIZE 8 /* so that it is visible */ + if (dx < HALF_AVE_CURSOR_SIZE) dx = HALF_AVE_CURSOR_SIZE; + if (dy < HALF_AVE_CURSOR_SIZE) dy = HALF_AVE_CURSOR_SIZE; +#undef HALF_AVE_CURSOR_SIZE + dx += (tmp_win->frame_bw + 1); + dy += (bw2 + tmp_win->title_height + 1); + if (AddingX + dx >= Scr->MyDisplayWidth) + dx = Scr->MyDisplayWidth - AddingX - 1; + if (AddingY + dy >= Scr->MyDisplayHeight) + dy = Scr->MyDisplayHeight - AddingY - 1; + if (dx > 0 && dy > 0) + XWarpPointer (dpy, None, None, 0, 0, 0, 0, dx, dy); + } else { + XWarpPointer (dpy, None, Scr->Root, 0, 0, 0, 0, + AddingX + AddingW/2, AddingY + AddingH/2); + } + AddStartResize(tmp_win, AddingX, AddingY, AddingW, AddingH); + + lastx = -10000; + lasty = -10000; + while (TRUE) + { + XMaskEvent(dpy, + ButtonReleaseMask | ButtonMotionMask, &event); + + if (Event.type == MotionNotify) { + /* discard any extra motion events before a release */ + while(XCheckMaskEvent(dpy, + ButtonMotionMask | ButtonReleaseMask, &Event)) + if (Event.type == ButtonRelease) + break; + } + + if (event.type == ButtonRelease) + { + AddEndResize(tmp_win); + break; + } + + if (event.type != MotionNotify) { + continue; + } + + /* + * XXX - if we are going to do a loop, we ought to consider + * using multiple GXxor lines so that we don't need to + * grab the server. + */ + XQueryPointer(dpy, Scr->Root, &JunkRoot, &JunkChild, + &JunkX, &JunkY, &AddingX, &AddingY, &JunkMask); + + if (lastx != AddingX || lasty != AddingY) + { + DoResize(AddingX, AddingY, tmp_win); + + lastx = AddingX; + lasty = AddingY; + } + + } + } + else if (event.xbutton.button == Button3) + { + int maxw = Scr->MyDisplayWidth - AddingX - bw2; + int maxh = Scr->MyDisplayHeight - AddingY - bw2; + + /* + * Make window go to bottom of screen, and clip to right edge. + * This is useful when popping up large windows and fixed + * column text windows. + */ + if (AddingW > maxw) AddingW = maxw; + AddingH = maxh; + + ConstrainSize (tmp_win, &AddingW, &AddingH); /* w/o borders */ + AddingW += bw2; + AddingH += bw2; + } + else + { + XMaskEvent(dpy, ButtonReleaseMask, &event); + } + + MoveOutline(Scr->Root, 0, 0, 0, 0, 0, 0); + XUnmapWindow(dpy, Scr->SizeWindow); + UninstallRootColormap(); + XUngrabPointer(dpy, CurrentTime); + + tmp_win->attr.x = AddingX; + tmp_win->attr.y = AddingY + tmp_win->title_height; + tmp_win->attr.width = AddingW - bw2; + tmp_win->attr.height = AddingH - tmp_win->title_height - bw2; + + XUngrabServer(dpy); + } + } + } else { /* put it where asked, mod title bar */ + /* if the gravity is towards the top, move it by the title height */ + if (gravy < 0) tmp_win->attr.y -= gravy * tmp_win->title_height; + } + + +#ifdef DEBUG + fprintf(stderr, " position window %d, %d %dx%d\n", + tmp_win->attr.x, + tmp_win->attr.y, + tmp_win->attr.width, + tmp_win->attr.height); +#endif + + if (!Scr->ClientBorderWidth) { /* need to adjust for twm borders */ + int delta = tmp_win->attr.border_width - tmp_win->frame_bw; + tmp_win->attr.x += gravx * delta; + tmp_win->attr.y += gravy * delta; + } + + tmp_win->title_width = tmp_win->attr.width; + + if (tmp_win->old_bw) XSetWindowBorderWidth (dpy, tmp_win->w, 0); + + tmp_win->name_width = MyFont_TextWidth(&Scr->TitleBarFont, tmp_win->name, + namelen); + + if (!I18N_GetIconName(dpy, tmp_win->w, &name)) { + tmp_win->icon_name = strdup(tmp_win->name); + } else { + if (name == NULL) { + tmp_win->icon_name = strdup(tmp_win->name); + } else { + tmp_win->icon_name = strdup(name); + free(name); + } + } + + tmp_win->iconified = FALSE; + tmp_win->icon = FALSE; + tmp_win->icon_on = FALSE; + + XGrabServer(dpy); + + /* + * Make sure the client window still exists. We don't want to leave an + * orphan frame window if it doesn't. Since we now have the server + * grabbed, the window can't disappear later without having been + * reparented, so we'll get a DestroyNotify for it. We won't have + * gotten one for anything up to here, however. + */ + if (XGetGeometry(dpy, tmp_win->w, &JunkRoot, &JunkX, &JunkY, + &JunkWidth, &JunkHeight, &JunkBW, &JunkDepth) == 0) + { + free((char *)tmp_win); + XUngrabServer(dpy); + return(NULL); + } + + /* add the window into the twm list */ + tmp_win->next = Scr->TwmRoot.next; + if (Scr->TwmRoot.next != NULL) + Scr->TwmRoot.next->prev = tmp_win; + tmp_win->prev = &Scr->TwmRoot; + Scr->TwmRoot.next = tmp_win; + + /* get all the colors for the window */ + + tmp_win->border = Scr->BorderColor; + tmp_win->icon_border = Scr->IconBorderColor; + tmp_win->border_tile.fore = Scr->BorderTileC.fore; + tmp_win->border_tile.back = Scr->BorderTileC.back; + tmp_win->title.fore = Scr->TitleC.fore; + tmp_win->title.back = Scr->TitleC.back; + tmp_win->iconc.fore = Scr->IconC.fore; + tmp_win->iconc.back = Scr->IconC.back; + + GetColorFromList(Scr->BorderColorL, tmp_win->full_name, &tmp_win->class, + &tmp_win->border); + GetColorFromList(Scr->IconBorderColorL, tmp_win->full_name, &tmp_win->class, + &tmp_win->icon_border); + GetColorFromList(Scr->BorderTileForegroundL, tmp_win->full_name, + &tmp_win->class, &tmp_win->border_tile.fore); + GetColorFromList(Scr->BorderTileBackgroundL, tmp_win->full_name, + &tmp_win->class, &tmp_win->border_tile.back); + GetColorFromList(Scr->TitleForegroundL, tmp_win->full_name, &tmp_win->class, + &tmp_win->title.fore); + GetColorFromList(Scr->TitleBackgroundL, tmp_win->full_name, &tmp_win->class, + &tmp_win->title.back); + GetColorFromList(Scr->IconForegroundL, tmp_win->full_name, &tmp_win->class, + &tmp_win->iconc.fore); + GetColorFromList(Scr->IconBackgroundL, tmp_win->full_name, &tmp_win->class, + &tmp_win->iconc.back); + + + /* create windows */ + + tmp_win->frame_x = tmp_win->attr.x + tmp_win->old_bw - tmp_win->frame_bw; + tmp_win->frame_y = tmp_win->attr.y - tmp_win->title_height + + tmp_win->old_bw - tmp_win->frame_bw; + tmp_win->frame_width = tmp_win->attr.width; + tmp_win->frame_height = tmp_win->attr.height + tmp_win->title_height; + + valuemask = CWBackPixmap | CWBorderPixel | CWCursor | CWEventMask; + attributes.background_pixmap = None; + attributes.border_pixel = tmp_win->border; + attributes.cursor = Scr->FrameCursor; + attributes.event_mask = (SubstructureRedirectMask | + ButtonPressMask | ButtonReleaseMask | + EnterWindowMask | LeaveWindowMask); + if (tmp_win->attr.save_under) { + attributes.save_under = True; + valuemask |= CWSaveUnder; + } + + tmp_win->frame = XCreateWindow (dpy, Scr->Root, tmp_win->frame_x, + tmp_win->frame_y, + (unsigned int) tmp_win->frame_width, + (unsigned int) tmp_win->frame_height, + (unsigned int) tmp_win->frame_bw, + Scr->d_depth, + (unsigned int) CopyFromParent, + Scr->d_visual, valuemask, &attributes); + + if (tmp_win->title_height) + { + valuemask = (CWEventMask | CWBorderPixel | CWBackPixel); + attributes.event_mask = (KeyPressMask | ButtonPressMask | + ButtonReleaseMask | ExposureMask); + attributes.border_pixel = tmp_win->border; + attributes.background_pixel = tmp_win->title.back; + tmp_win->title_w = XCreateWindow (dpy, tmp_win->frame, + -tmp_win->frame_bw, + -tmp_win->frame_bw, + (unsigned int) tmp_win->attr.width, + (unsigned int) Scr->TitleHeight, + (unsigned int) tmp_win->frame_bw, + Scr->d_depth, + (unsigned int) CopyFromParent, + Scr->d_visual, valuemask, + &attributes); + } + else { + tmp_win->title_w = 0; + tmp_win->squeeze_info = NULL; + } + + if (tmp_win->highlight) + { + tmp_win->gray = XCreatePixmapFromBitmapData(dpy, Scr->Root, + gray_bits, gray_width, gray_height, + tmp_win->border_tile.fore, tmp_win->border_tile.back, + Scr->d_depth); + + SetBorder (tmp_win, False); + } + else + tmp_win->gray = None; + + + if (tmp_win->title_w) { + CreateWindowTitlebarButtons (tmp_win); + ComputeTitleLocation (tmp_win); + XMoveWindow (dpy, tmp_win->title_w, + tmp_win->title_x, tmp_win->title_y); + XDefineCursor(dpy, tmp_win->title_w, Scr->TitleCursor); + } + + valuemask = (CWEventMask | CWDontPropagate); + attributes.event_mask = (StructureNotifyMask | PropertyChangeMask | + ColormapChangeMask | VisibilityChangeMask | + EnterWindowMask | LeaveWindowMask); + attributes.do_not_propagate_mask = ButtonPressMask | ButtonReleaseMask; + XChangeWindowAttributes (dpy, tmp_win->w, valuemask, &attributes); + + if (HasShape) + XShapeSelectInput (dpy, tmp_win->w, ShapeNotifyMask); + + if (tmp_win->title_w) { + XMapWindow (dpy, tmp_win->title_w); + } + + if (HasShape) { + int xws, yws, xbs, ybs; + unsigned wws, hws, wbs, hbs; + int boundingShaped, clipShaped; + + XShapeSelectInput (dpy, tmp_win->w, ShapeNotifyMask); + XShapeQueryExtents (dpy, tmp_win->w, + &boundingShaped, &xws, &yws, &wws, &hws, + &clipShaped, &xbs, &ybs, &wbs, &hbs); + tmp_win->wShaped = boundingShaped; + } + + if (!tmp_win->iconmgr) + XAddToSaveSet(dpy, tmp_win->w); + + XReparentWindow(dpy, tmp_win->w, tmp_win->frame, 0, tmp_win->title_height); + /* + * Reparenting generates an UnmapNotify event, followed by a MapNotify. + * Set the map state to FALSE to prevent a transition back to + * WithdrawnState in HandleUnmapNotify. Map state gets set correctly + * again in HandleMapNotify. + */ + tmp_win->mapped = FALSE; + + SetupFrame (tmp_win, tmp_win->frame_x, tmp_win->frame_y, + tmp_win->frame_width, tmp_win->frame_height, -1, True); + + /* wait until the window is iconified and the icon window is mapped + * before creating the icon window + */ + tmp_win->icon_w = (Window) 0; + + if (!tmp_win->iconmgr) + { + GrabButtons(tmp_win); + GrabKeys(tmp_win); + } + + (void) AddIconManager(tmp_win); + + XSaveContext(dpy, tmp_win->w, TwmContext, (caddr_t) tmp_win); + XSaveContext(dpy, tmp_win->w, ScreenContext, (caddr_t) Scr); + XSaveContext(dpy, tmp_win->frame, TwmContext, (caddr_t) tmp_win); + XSaveContext(dpy, tmp_win->frame, ScreenContext, (caddr_t) Scr); + if (tmp_win->title_height) + { + int i; + int nb = Scr->TBInfo.nleft + Scr->TBInfo.nright; + + XSaveContext(dpy, tmp_win->title_w, TwmContext, (caddr_t) tmp_win); + XSaveContext(dpy, tmp_win->title_w, ScreenContext, (caddr_t) Scr); + for (i = 0; i < nb; i++) { + XSaveContext(dpy, tmp_win->titlebuttons[i].window, TwmContext, + (caddr_t) tmp_win); + XSaveContext(dpy, tmp_win->titlebuttons[i].window, ScreenContext, + (caddr_t) Scr); + } + if (tmp_win->hilite_w) + { + XSaveContext(dpy, tmp_win->hilite_w, TwmContext, (caddr_t)tmp_win); + XSaveContext(dpy, tmp_win->hilite_w, ScreenContext, (caddr_t)Scr); + } + } + + XUngrabServer(dpy); + + /* if we were in the middle of a menu activated function, regrab + * the pointer + */ + if (RootFunction) + ReGrab(); + + return (tmp_win); +} + + +/** + * checks to see if we should really put a twm frame on the window + * + * \return TRUE - go ahead and place the window + * \return FALSE - don't frame the window + * \param w the window to check + */ +int +MappedNotOverride(Window w) +{ + XWindowAttributes wa; + + XGetWindowAttributes(dpy, w, &wa); + return ((wa.map_state != IsUnmapped) && (wa.override_redirect != True)); +} + + +/** + * attach default bindings so that naive users don't get messed up if they + * provide a minimal twmrc. + */ +static void do_add_binding (int button, int context, int modifier, int func) +{ + MouseButton *mb = &Scr->Mouse[button][context][modifier]; + + if (mb->func) return; /* already defined */ + + mb->func = func; + mb->item = NULL; +} + +void +AddDefaultBindings () +{ + /* + * The bindings are stored in Scr->Mouse, indexed by + * Mouse[button_number][C_context][modifier]. + */ + +#define NoModifierMask 0 + + do_add_binding (Button1, C_TITLE, NoModifierMask, F_MOVE); + do_add_binding (Button1, C_ICON, NoModifierMask, F_ICONIFY); + do_add_binding (Button1, C_ICONMGR, NoModifierMask, F_ICONIFY); + + do_add_binding (Button2, C_TITLE, NoModifierMask, F_RAISELOWER); + do_add_binding (Button2, C_ICON, NoModifierMask, F_ICONIFY); + do_add_binding (Button2, C_ICONMGR, NoModifierMask, F_ICONIFY); + +#undef NoModifierMask +} + + + + +/** + * grab needed buttons for the window + * + * \param[in] tmp_win the twm window structure to use + */ +void +GrabButtons(TwmWindow *tmp_win) +{ + int i, j; + + for (i = 0; i < MAX_BUTTONS+1; i++) + { + for (j = 0; j < MOD_SIZE; j++) + { + if (Scr->Mouse[i][C_WINDOW][j].func != 0) + { + /* twm used to do this grab on the application main window, + * tmp_win->w . This was not ICCCM complient and was changed. + */ + XGrabButton(dpy, i, j, tmp_win->frame, + True, ButtonPressMask | ButtonReleaseMask, + GrabModeAsync, GrabModeAsync, None, + Scr->FrameCursor); + } + } + } +} + +/** + * grab needed keys for the window + * + * \param[in] tmp_win the twm window structure to use + */ +void +GrabKeys(TwmWindow *tmp_win) +{ + FuncKey *tmp; + IconMgr *p; + + for (tmp = Scr->FuncKeyRoot.next; tmp != NULL; tmp = tmp->next) + { + switch (tmp->cont) + { + case C_WINDOW: + XGrabKey(dpy, tmp->keycode, tmp->mods, tmp_win->w, True, + GrabModeAsync, GrabModeAsync); + break; + + case C_ICON: + if (tmp_win->icon_w) + XGrabKey(dpy, tmp->keycode, tmp->mods, tmp_win->icon_w, True, + GrabModeAsync, GrabModeAsync); + + case C_TITLE: + if (tmp_win->title_w) + XGrabKey(dpy, tmp->keycode, tmp->mods, tmp_win->title_w, True, + GrabModeAsync, GrabModeAsync); + break; + + case C_NAME: + XGrabKey(dpy, tmp->keycode, tmp->mods, tmp_win->w, True, + GrabModeAsync, GrabModeAsync); + if (tmp_win->icon_w) + XGrabKey(dpy, tmp->keycode, tmp->mods, tmp_win->icon_w, True, + GrabModeAsync, GrabModeAsync); + if (tmp_win->title_w) + XGrabKey(dpy, tmp->keycode, tmp->mods, tmp_win->title_w, True, + GrabModeAsync, GrabModeAsync); + break; + /* + case C_ROOT: + XGrabKey(dpy, tmp->keycode, tmp->mods, Scr->Root, True, + GrabModeAsync, GrabModeAsync); + break; + */ + } + } + for (tmp = Scr->FuncKeyRoot.next; tmp != NULL; tmp = tmp->next) + { + if (tmp->cont == C_ICONMGR && !Scr->NoIconManagers) + { + for (p = &Scr->iconmgr; p != NULL; p = p->next) + { + XUngrabKey(dpy, tmp->keycode, tmp->mods, p->twm_win->w); + } + } + } +} + +static Window CreateHighlightWindow (TwmWindow *tmp_win) +{ + XSetWindowAttributes attributes; /* attributes for create windows */ + Pixmap pm = None; + GC gc; + XGCValues gcv; + unsigned long valuemask; + int h = (Scr->TitleHeight - 2 * Scr->FramePadding); + Window w; + + + /* + * If a special highlight pixmap was given, use that. Otherwise, + * use a nice, even gray pattern. The old horizontal lines look really + * awful on interlaced monitors (as well as resembling other looks a + * little bit too closely), but can be used by putting + * + * Pixmaps { TitleHighlight "hline2" } + * + * (or whatever the horizontal line bitmap is named) in the startup + * file. If all else fails, use the foreground color to look like a + * solid line. + */ + if (!Scr->hilitePm) { + Scr->hilitePm = XCreateBitmapFromData (dpy, tmp_win->title_w, + gray_bits, gray_width, + gray_height); + Scr->hilite_pm_width = gray_width; + Scr->hilite_pm_height = gray_height; + } + if (Scr->hilitePm) { + pm = XCreatePixmap (dpy, tmp_win->title_w, + Scr->hilite_pm_width, Scr->hilite_pm_height, + Scr->d_depth); + gcv.foreground = tmp_win->title.fore; + gcv.background = tmp_win->title.back; + gcv.graphics_exposures = False; + gc = XCreateGC (dpy, pm, + (GCForeground|GCBackground|GCGraphicsExposures), + &gcv); + if (gc) { + XCopyPlane (dpy, Scr->hilitePm, pm, gc, 0, 0, + Scr->hilite_pm_width, Scr->hilite_pm_height, + 0, 0, 1); + XFreeGC (dpy, gc); + } else { + XFreePixmap (dpy, pm); + pm = None; + } + } + if (pm) { + valuemask = CWBackPixmap; + attributes.background_pixmap = pm; + } else { + valuemask = CWBackPixel; + attributes.background_pixel = tmp_win->title.fore; + } + + w = XCreateWindow (dpy, tmp_win->title_w, 0, Scr->FramePadding, + (unsigned int) Scr->TBInfo.width, (unsigned int) h, + (unsigned int) 0, + Scr->d_depth, (unsigned int) CopyFromParent, + Scr->d_visual, valuemask, &attributes); + if (pm) XFreePixmap (dpy, pm); + return w; +} + + +void ComputeCommonTitleOffsets () +{ + int buttonwidth = (Scr->TBInfo.width + Scr->TBInfo.pad); + + Scr->TBInfo.leftx = Scr->TBInfo.rightoff = Scr->FramePadding; + if (Scr->TBInfo.nleft > 0) + Scr->TBInfo.leftx += Scr->ButtonIndent; + Scr->TBInfo.titlex = (Scr->TBInfo.leftx + + (Scr->TBInfo.nleft * buttonwidth) - Scr->TBInfo.pad + + Scr->TitlePadding); + if (Scr->TBInfo.nright > 0) + Scr->TBInfo.rightoff += (Scr->ButtonIndent + + ((Scr->TBInfo.nright * buttonwidth) - + Scr->TBInfo.pad)); + return; +} + +void ComputeWindowTitleOffsets (TwmWindow *tmp_win, int width, Bool squeeze) +{ + tmp_win->highlightx = (Scr->TBInfo.titlex + tmp_win->name_width); + if (tmp_win->hilite_w || Scr->TBInfo.nright > 0) + tmp_win->highlightx += Scr->TitlePadding; + tmp_win->rightx = width - Scr->TBInfo.rightoff; + if (squeeze && tmp_win->squeeze_info) { + int rx = (tmp_win->highlightx + + (tmp_win->hilite_w + ? Scr->TBInfo.width * 2 : 0) + + (Scr->TBInfo.nright > 0 ? Scr->TitlePadding : 0) + + Scr->FramePadding); + if (rx < tmp_win->rightx) tmp_win->rightx = rx; + } + return; +} + + +/** + * calculate the position of the title window. We need to take the frame_bw + * into account since we want (0,0) of the title window to line up with (0,0) + * of the frame window. + */ +void ComputeTitleLocation (register TwmWindow *tmp) +{ + tmp->title_x = -tmp->frame_bw; + tmp->title_y = -tmp->frame_bw; + + if (tmp->squeeze_info) { + register SqueezeInfo *si = tmp->squeeze_info; + int basex; + int maxwidth = tmp->frame_width; + int tw = tmp->title_width; + + /* + * figure label base from squeeze info (justification fraction) + */ + if (si->denom == 0) { /* num is pixel based */ + if ((basex = si->num) == 0) { /* look for special cases */ + switch (si->justify) { + case J_RIGHT: + basex = maxwidth; + break; + case J_CENTER: + basex = maxwidth / 2; + break; + } + } + } else { /* num/denom is fraction */ + basex = ((si->num * maxwidth) / si->denom); + if (si->num < 0) basex += maxwidth; + } + + /* + * adjust for left (nop), center, right justify and clip + */ + switch (si->justify) { + case J_CENTER: + basex -= tw / 2; + break; + case J_RIGHT: + basex -= tw - 1; + break; + } + if (basex > maxwidth - tw + 1) + basex = maxwidth - tw + 1; + if (basex < 0) basex = 0; + + tmp->title_x = basex - tmp->frame_bw; + } +} + + +static void CreateWindowTitlebarButtons (TwmWindow *tmp_win) +{ + unsigned long valuemask; /* mask for create windows */ + XSetWindowAttributes attributes; /* attributes for create windows */ + int leftx, rightx, y; + TitleButton *tb; + int nb; + + if (tmp_win->title_height == 0) + { + tmp_win->hilite_w = 0; + return; + } + + + /* + * create the title bar windows; let the event handler deal with painting + * so that we don't have to spend two pixmaps (or deal with hashing) + */ + ComputeWindowTitleOffsets (tmp_win, tmp_win->attr.width, False); + + leftx = y = Scr->TBInfo.leftx; + rightx = tmp_win->rightx; + + attributes.win_gravity = NorthWestGravity; + attributes.background_pixel = tmp_win->title.back; + attributes.border_pixel = tmp_win->title.fore; + attributes.event_mask = (ButtonPressMask | ButtonReleaseMask | + ExposureMask); + attributes.cursor = Scr->ButtonCursor; + valuemask = (CWWinGravity | CWBackPixel | CWBorderPixel | CWEventMask | + CWCursor); + + tmp_win->titlebuttons = NULL; + nb = Scr->TBInfo.nleft + Scr->TBInfo.nright; + if (nb > 0) { + tmp_win->titlebuttons = (TBWindow *) malloc (nb * sizeof(TBWindow)); + if (!tmp_win->titlebuttons) { + fprintf (stderr, "%s: unable to allocate %d titlebuttons\n", + ProgramName, nb); + } else { + TBWindow *tbw; + int boxwidth = (Scr->TBInfo.width + Scr->TBInfo.pad); + unsigned int h = (Scr->TBInfo.width - Scr->TBInfo.border * 2); + + for (tb = Scr->TBInfo.head, tbw = tmp_win->titlebuttons; tb; + tb = tb->next, tbw++) { + int x; + if (tb->rightside) { + x = rightx; + rightx += boxwidth; + attributes.win_gravity = NorthEastGravity; + } else { + x = leftx; + leftx += boxwidth; + attributes.win_gravity = NorthWestGravity; + } + tbw->window = XCreateWindow (dpy, tmp_win->title_w, x, y, h, h, + (unsigned int) Scr->TBInfo.border, + 0, (unsigned int) CopyFromParent, + (Visual *) CopyFromParent, + valuemask, &attributes); + tbw->info = tb; + } + } + } + + tmp_win->hilite_w = (tmp_win->titlehighlight + ? CreateHighlightWindow (tmp_win) : None); + + XMapSubwindows(dpy, tmp_win->title_w); + if (tmp_win->hilite_w) + XUnmapWindow(dpy, tmp_win->hilite_w); + return; +} + + +void +SetHighlightPixmap (char *filename) +{ + Pixmap pm = GetBitmap (filename); + + if (pm) { + if (Scr->hilitePm) { + XFreePixmap (dpy, Scr->hilitePm); + } + Scr->hilitePm = pm; + Scr->hilite_pm_width = JunkWidth; + Scr->hilite_pm_height = JunkHeight; + } +} + + +void +FetchWmProtocols (TwmWindow *tmp) +{ + unsigned long flags = 0L; + Atom *protocols = NULL; + int n; + + if (XGetWMProtocols (dpy, tmp->w, &protocols, &n)) { + register int i; + register Atom *ap; + + for (i = 0, ap = protocols; i < n; i++, ap++) { + if (*ap == _XA_WM_TAKE_FOCUS) flags |= DoesWmTakeFocus; + if (*ap == _XA_WM_SAVE_YOURSELF) flags |= DoesWmSaveYourself; + if (*ap == _XA_WM_DELETE_WINDOW) flags |= DoesWmDeleteWindow; + } + if (protocols) XFree ((char *) protocols); + } + tmp->protocols = flags; +} + +TwmColormap * +CreateTwmColormap(Colormap c) +{ + TwmColormap *cmap; + cmap = (TwmColormap *) malloc(sizeof(TwmColormap)); + if (!cmap || + XSaveContext(dpy, c, ColormapContext, (caddr_t) cmap)) { + if (cmap) free((char *) cmap); + return (NULL); + } + cmap->c = c; + cmap->state = 0; + cmap->install_req = 0; + cmap->w = None; + cmap->refcnt = 1; + return (cmap); +} + +ColormapWindow * +CreateColormapWindow(Window w, Bool creating_parent, Bool property_window) +{ + ColormapWindow *cwin; + TwmColormap *cmap; + XWindowAttributes attributes; + + cwin = (ColormapWindow *) malloc(sizeof(ColormapWindow)); + if (cwin) { + if (!XGetWindowAttributes(dpy, w, &attributes) || + XSaveContext(dpy, w, ColormapContext, (caddr_t) cwin)) { + free((char *) cwin); + return (NULL); + } + + if (XFindContext(dpy, attributes.colormap, ColormapContext, + (caddr_t *)&cwin->colormap) == XCNOENT) { + cwin->colormap = cmap = CreateTwmColormap(attributes.colormap); + if (!cmap) { + XDeleteContext(dpy, w, ColormapContext); + free((char *) cwin); + return (NULL); + } + } else { + cwin->colormap->refcnt++; + } + + cwin->w = w; + /* + * Assume that windows in colormap list are + * obscured if we are creating the parent window. + * Otherwise, we assume they are unobscured. + */ + cwin->visibility = creating_parent ? + VisibilityPartiallyObscured : VisibilityUnobscured; + cwin->refcnt = 1; + + /* + * If this is a ColormapWindow property window and we + * are not monitoring ColormapNotify or VisibilityNotify + * events, we need to. + */ + if (property_window && + (attributes.your_event_mask & + (ColormapChangeMask|VisibilityChangeMask)) != + (ColormapChangeMask|VisibilityChangeMask)) { + XSelectInput(dpy, w, attributes.your_event_mask | + (ColormapChangeMask|VisibilityChangeMask)); + } + } + + return (cwin); +} + +void +FetchWmColormapWindows (TwmWindow *tmp) +{ + register int i, j; + Window *cmap_windows = NULL; + Bool can_free_cmap_windows = False; + int number_cmap_windows = 0; + ColormapWindow **cwins = NULL; + int previously_installed; + + number_cmap_windows = 0; + + if (/* SUPPRESS 560 */(previously_installed = + (Scr->cmapInfo.cmaps == &tmp->cmaps && tmp->cmaps.number_cwins))) { + cwins = tmp->cmaps.cwins; + for (i = 0; i < tmp->cmaps.number_cwins; i++) + cwins[i]->colormap->state = 0; + } + + if (XGetWMColormapWindows (dpy, tmp->w, &cmap_windows, + &number_cmap_windows) && + number_cmap_windows > 0) { + + can_free_cmap_windows = False; + /* + * check if the top level is in the list, add to front if not + */ + for (i = 0; i < number_cmap_windows; i++) { + if (cmap_windows[i] == tmp->w) break; + } + if (i == number_cmap_windows) { /* not in list */ + Window *new_cmap_windows = + (Window *) malloc (sizeof(Window) * (number_cmap_windows + 1)); + + if (!new_cmap_windows) { + fprintf (stderr, + "%s: unable to allocate %d element colormap window array\n", + ProgramName, number_cmap_windows+1); + goto done; + } + new_cmap_windows[0] = tmp->w; /* add to front */ + for (i = 0; i < number_cmap_windows; i++) { /* append rest */ + new_cmap_windows[i+1] = cmap_windows[i]; + } + XFree ((char *) cmap_windows); + can_free_cmap_windows = True; /* do not use XFree any more */ + cmap_windows = new_cmap_windows; + number_cmap_windows++; + } + + cwins = (ColormapWindow **) malloc(sizeof(ColormapWindow *) * + number_cmap_windows); + if (cwins) { + for (i = 0; i < number_cmap_windows; i++) { + + /* + * Copy any existing entries into new list. + */ + for (j = 0; j < tmp->cmaps.number_cwins; j++) { + if (tmp->cmaps.cwins[j]->w == cmap_windows[i]) { + cwins[i] = tmp->cmaps.cwins[j]; + cwins[i]->refcnt++; + break; + } + } + + /* + * If the colormap window is not being pointed by + * some other applications colormap window list, + * create a new entry. + */ + if (j == tmp->cmaps.number_cwins) { + if (XFindContext(dpy, cmap_windows[i], ColormapContext, + (caddr_t *)&cwins[i]) == XCNOENT) { + if ((cwins[i] = CreateColormapWindow(cmap_windows[i], + (Bool) tmp->cmaps.number_cwins == 0, + True)) == NULL) { + int k; + for (k = i + 1; k < number_cmap_windows; k++) + cmap_windows[k-1] = cmap_windows[k]; + i--; + number_cmap_windows--; + } + } else + cwins[i]->refcnt++; + } + } + } + } + + /* No else here, in case we bailed out of clause above. + */ + if (number_cmap_windows == 0) { + + number_cmap_windows = 1; + + cwins = (ColormapWindow **) malloc(sizeof(ColormapWindow *)); + if (XFindContext(dpy, tmp->w, ColormapContext, (caddr_t *)&cwins[0]) == + XCNOENT) + cwins[0] = CreateColormapWindow(tmp->w, + (Bool) tmp->cmaps.number_cwins == 0, False); + else + cwins[0]->refcnt++; + } + + if (tmp->cmaps.number_cwins) + free_cwins(tmp); + + tmp->cmaps.cwins = cwins; + tmp->cmaps.number_cwins = number_cmap_windows; + if (number_cmap_windows > 1) + tmp->cmaps.scoreboard = + (char *) calloc(1, ColormapsScoreboardLength(&tmp->cmaps)); + + if (previously_installed) + InstallWindowColormaps(PropertyNotify, (TwmWindow *) NULL); + + done: + if (cmap_windows) { + if (can_free_cmap_windows) + free ((char *) cmap_windows); + else + XFree ((char *) cmap_windows); + } + + return; +} + + +void GetWindowSizeHints (TwmWindow *tmp) +{ + long supplied = 0; + + if (!XGetWMNormalHints (dpy, tmp->w, &tmp->hints, &supplied)) + tmp->hints.flags = 0; + + if (tmp->hints.flags & PResizeInc) { + if (tmp->hints.width_inc == 0) tmp->hints.width_inc = 1; + if (tmp->hints.height_inc == 0) tmp->hints.height_inc = 1; + } + + if (!(supplied & PWinGravity) && (tmp->hints.flags & USPosition)) { + static int gravs[] = { SouthEastGravity, SouthWestGravity, + NorthEastGravity, NorthWestGravity }; + int right = tmp->attr.x + tmp->attr.width + 2 * tmp->old_bw; + int bottom = tmp->attr.y + tmp->attr.height + 2 * tmp->old_bw; + tmp->hints.win_gravity = + gravs[((Scr->MyDisplayHeight - bottom < tmp->title_height) ? 0 : 2) | + ((Scr->MyDisplayWidth - right < tmp->title_height) ? 0 : 1)]; + tmp->hints.flags |= PWinGravity; + } +} diff --git a/app/twm/src/add_window.h b/app/twm/src/add_window.h new file mode 100644 index 000000000..190c9ff49 --- /dev/null +++ b/app/twm/src/add_window.h @@ -0,0 +1,89 @@ +/*****************************************************************************/ +/* + +Copyright 1989, 1998 The Open Group + +Permission to use, copy, modify, distribute, and sell this software and its +documentation for any purpose is hereby granted without fee, provided that +the above copyright notice appear in all copies and that both that +copyright notice and this permission notice appear in supporting +documentation. + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the name of The Open Group shall not be +used in advertising or otherwise to promote the sale, use or other dealings +in this Software without prior written authorization from The Open Group. + +*/ +/** Copyright 1988 by Evans & Sutherland Computer Corporation, **/ +/** Salt Lake City, Utah **/ +/** Cambridge, Massachusetts **/ +/** **/ +/** All Rights Reserved **/ +/** **/ +/** Permission to use, copy, modify, and distribute this software and **/ +/** its documentation for any purpose and without fee is hereby **/ +/** granted, provided that the above copyright notice appear in all **/ +/** copies and that both that copyright notice and this permis- **/ +/** sion notice appear in supporting documentation, and that the **/ +/** name of Evans & Sutherland not be used in advertising **/ +/** in publicity pertaining to distribution of the software without **/ +/** specific, written prior permission. **/ +/** **/ +/** EVANS & SUTHERLAND DISCLAIMs ALL WARRANTIES WITH REGARD **/ +/** TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANT- **/ +/** ABILITY AND FITNESS, IN NO EVENT SHALL EVANS & SUTHERLAND **/ +/** BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAM- **/ +/** AGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA **/ +/** OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER **/ +/** TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE **/ +/** OR PERFORMANCE OF THIS SOFTWARE. **/ +/*****************************************************************************/ +/* $XFree86: xc/programs/twm/add_window.h,v 1.5 2001/08/27 21:11:39 dawes Exp $ */ + + +/********************************************************************** + * + * $Xorg: add_window.h,v 1.4 2001/02/09 02:05:36 xorgcvs Exp $ + * + * AddWindow include file + * + * 31-Mar-88 Tom LaStrange Initial Version. + * + **********************************************************************/ + +#ifndef _ADD_WINDOW_ +#define _ADD_WINDOW_ + +#include "iconmgr.h" + +extern char NoName[]; + +extern void AddDefaultBindings ( void ); +extern TwmWindow * AddWindow ( Window w, int iconm, IconMgr *iconp ); +extern ColormapWindow * CreateColormapWindow ( Window w, Bool creating_parent, Bool property_window ); +extern TwmColormap * CreateTwmColormap ( Colormap c ); +extern void FetchWmColormapWindows ( TwmWindow *tmp ); +extern void FetchWmProtocols ( TwmWindow *tmp ); +extern void GetGravityOffsets ( TwmWindow *tmp, int *xp, int *yp ); +extern void GetWindowSizeHints ( TwmWindow *tmp ); +extern void GrabButtons ( TwmWindow *tmp_win ); +extern void GrabKeys ( TwmWindow *tmp_win ); +extern int MappedNotOverride ( Window w ); +extern void SetHighlightPixmap ( char *filename ); +extern int AddingX; +extern int AddingY; +extern int AddingW; +extern int AddingH; + +#endif /* _ADD_WINDOW_ */ + diff --git a/app/twm/src/cursor.c b/app/twm/src/cursor.c new file mode 100644 index 000000000..3c15bd4f8 --- /dev/null +++ b/app/twm/src/cursor.c @@ -0,0 +1,174 @@ +/* + * +Copyright 1989, 1998 The Open Group + +Permission to use, copy, modify, distribute, and sell this software and its +documentation for any purpose is hereby granted without fee, provided that +the above copyright notice appear in all copies and that both that +copyright notice and this permission notice appear in supporting +documentation. + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the name of The Open Group shall not be +used in advertising or otherwise to promote the sale, use or other dealings +in this Software without prior written authorization from The Open Group. + * */ +/* $XFree86: xc/programs/twm/cursor.c,v 1.4 2001/01/17 23:45:05 dawes Exp $ */ + +/*********************************************************************** + * + * $Xorg: cursor.c,v 1.5 2001/02/09 02:05:36 xorgcvs Exp $ + * + * cursor creation code + * + * 05-Apr-89 Thomas E. LaStrange File created + * + ***********************************************************************/ + +#include +#include "twm.h" +#include +#include "screen.h" +#include "util.h" + +static struct _CursorName { + char *name; + unsigned int shape; + Cursor cursor; +} cursor_names[] = { + +{"X_cursor", XC_X_cursor, None}, +{"arrow", XC_arrow, None}, +{"based_arrow_down", XC_based_arrow_down, None}, +{"based_arrow_up", XC_based_arrow_up, None}, +{"boat", XC_boat, None}, +{"bogosity", XC_bogosity, None}, +{"bottom_left_corner", XC_bottom_left_corner, None}, +{"bottom_right_corner", XC_bottom_right_corner, None}, +{"bottom_side", XC_bottom_side, None}, +{"bottom_tee", XC_bottom_tee, None}, +{"box_spiral", XC_box_spiral, None}, +{"center_ptr", XC_center_ptr, None}, +{"circle", XC_circle, None}, +{"clock", XC_clock, None}, +{"coffee_mug", XC_coffee_mug, None}, +{"cross", XC_cross, None}, +{"cross_reverse", XC_cross_reverse, None}, +{"crosshair", XC_crosshair, None}, +{"diamond_cross", XC_diamond_cross, None}, +{"dot", XC_dot, None}, +{"dotbox", XC_dotbox, None}, +{"double_arrow", XC_double_arrow, None}, +{"draft_large", XC_draft_large, None}, +{"draft_small", XC_draft_small, None}, +{"draped_box", XC_draped_box, None}, +{"exchange", XC_exchange, None}, +{"fleur", XC_fleur, None}, +{"gobbler", XC_gobbler, None}, +{"gumby", XC_gumby, None}, +{"hand1", XC_hand1, None}, +{"hand2", XC_hand2, None}, +{"heart", XC_heart, None}, +{"icon", XC_icon, None}, +{"iron_cross", XC_iron_cross, None}, +{"left_ptr", XC_left_ptr, None}, +{"left_side", XC_left_side, None}, +{"left_tee", XC_left_tee, None}, +{"leftbutton", XC_leftbutton, None}, +{"ll_angle", XC_ll_angle, None}, +{"lr_angle", XC_lr_angle, None}, +{"man", XC_man, None}, +{"middlebutton", XC_middlebutton, None}, +{"mouse", XC_mouse, None}, +{"pencil", XC_pencil, None}, +{"pirate", XC_pirate, None}, +{"plus", XC_plus, None}, +{"question_arrow", XC_question_arrow, None}, +{"right_ptr", XC_right_ptr, None}, +{"right_side", XC_right_side, None}, +{"right_tee", XC_right_tee, None}, +{"rightbutton", XC_rightbutton, None}, +{"rtl_logo", XC_rtl_logo, None}, +{"sailboat", XC_sailboat, None}, +{"sb_down_arrow", XC_sb_down_arrow, None}, +{"sb_h_double_arrow", XC_sb_h_double_arrow, None}, +{"sb_left_arrow", XC_sb_left_arrow, None}, +{"sb_right_arrow", XC_sb_right_arrow, None}, +{"sb_up_arrow", XC_sb_up_arrow, None}, +{"sb_v_double_arrow", XC_sb_v_double_arrow, None}, +{"shuttle", XC_shuttle, None}, +{"sizing", XC_sizing, None}, +{"spider", XC_spider, None}, +{"spraycan", XC_spraycan, None}, +{"star", XC_star, None}, +{"target", XC_target, None}, +{"tcross", XC_tcross, None}, +{"top_left_arrow", XC_top_left_arrow, None}, +{"top_left_corner", XC_top_left_corner, None}, +{"top_right_corner", XC_top_right_corner, None}, +{"top_side", XC_top_side, None}, +{"top_tee", XC_top_tee, None}, +{"trek", XC_trek, None}, +{"ul_angle", XC_ul_angle, None}, +{"umbrella", XC_umbrella, None}, +{"ur_angle", XC_ur_angle, None}, +{"watch", XC_watch, None}, +{"xterm", XC_xterm, None}, +}; + +void +NewFontCursor (Cursor *cp, char *str) +{ + int i; + + for (i = 0; i < sizeof(cursor_names)/sizeof(struct _CursorName); i++) + { + if (strcmp(str, cursor_names[i].name) == 0) + { + if (cursor_names[i].cursor == None) + cursor_names[i].cursor = XCreateFontCursor(dpy, + cursor_names[i].shape); + *cp = cursor_names[i].cursor; + return; + } + } + fprintf (stderr, "%s: unable to find font cursor \"%s\"\n", + ProgramName, str); +} + +void +NewBitmapCursor(Cursor *cp, char *source, char *mask) +{ + int hotx, hoty; + int sx, sy, mx, my; + unsigned int sw, sh, mw, mh; + Pixmap spm, mpm; + + spm = GetBitmap(source); + if ((hotx = HotX) < 0) hotx = 0; + if ((hoty = HotY) < 0) hoty = 0; + mpm = GetBitmap(mask); + + /* make sure they are the same size */ + + XGetGeometry(dpy, spm, &JunkRoot, &sx, &sy, &sw, &sh, &JunkBW,&JunkDepth); + XGetGeometry(dpy, mpm, &JunkRoot, &mx, &my, &mw, &mh, &JunkBW,&JunkDepth); + if (sw != mw || sh != mh) + { + fprintf (stderr, + "%s: cursor bitmaps \"%s\" and \"%s\" not the same size\n", + ProgramName, source, mask); + return; + } + *cp = XCreatePixmapCursor(dpy, spm, mpm, &Scr->PointerForeground, + &Scr->PointerBackground, hotx,hoty); +} diff --git a/app/twm/src/deftwmrc.c b/app/twm/src/deftwmrc.c new file mode 100644 index 000000000..c0debe0bf --- /dev/null +++ b/app/twm/src/deftwmrc.c @@ -0,0 +1,78 @@ +/* + * This file is generated automatically from the default + * twm bindings file system.twmrc by the twm Imakefile. + */ + +unsigned char *defTwmrc[] = { + (unsigned char *) "", + (unsigned char *) "NoGrabServer", + (unsigned char *) "RestartPreviousState", + (unsigned char *) "DecorateTransients", + (unsigned char *) "TitleFont \"-adobe-helvetica-bold-r-normal--*-120-*-*-*-*-*-*\"", + (unsigned char *) "ResizeFont \"-adobe-helvetica-bold-r-normal--*-120-*-*-*-*-*-*\"", + (unsigned char *) "MenuFont \"-adobe-helvetica-bold-r-normal--*-120-*-*-*-*-*-*\"", + (unsigned char *) "IconFont \"-adobe-helvetica-bold-r-normal--*-100-*-*-*-*-*-*\"", + (unsigned char *) "IconManagerFont \"-adobe-helvetica-bold-r-normal--*-100-*-*-*\"", + (unsigned char *) "", + (unsigned char *) "Color", + (unsigned char *) "{", + (unsigned char *) " BorderColor \"slategrey\"", + (unsigned char *) " DefaultBackground \"rgb:2/a/9\"", + (unsigned char *) " DefaultForeground \"gray85\"", + (unsigned char *) " TitleBackground \"rgb:2/a/9\"", + (unsigned char *) " TitleForeground \"gray85\"", + (unsigned char *) " MenuBackground \"rgb:2/a/9\"", + (unsigned char *) " MenuForeground \"gray85\"", + (unsigned char *) " MenuBorderColor \"slategrey\"", + (unsigned char *) " MenuTitleBackground \"gray70\"", + (unsigned char *) " MenuTitleForeground \"rgb:2/a/9\"", + (unsigned char *) " IconBackground \"rgb:2/a/9\"", + (unsigned char *) " IconForeground \"gray85\"", + (unsigned char *) " IconBorderColor \"gray85\"", + (unsigned char *) " IconManagerBackground \"rgb:2/a/9\"", + (unsigned char *) " IconManagerForeground \"gray85\"", + (unsigned char *) "}", + (unsigned char *) "", + (unsigned char *) "MoveDelta 3", + (unsigned char *) "Function \"move-or-lower\" { f.move f.deltastop f.lower }", + (unsigned char *) "Function \"move-or-raise\" { f.move f.deltastop f.raise }", + (unsigned char *) "Function \"move-or-iconify\" { f.move f.deltastop f.iconify }", + (unsigned char *) "", + (unsigned char *) "Button1 = : root : f.menu \"defops\"", + (unsigned char *) "", + (unsigned char *) "Button1 = m : window|icon : f.function \"move-or-lower\"", + (unsigned char *) "Button2 = m : window|icon : f.iconify", + (unsigned char *) "Button3 = m : window|icon : f.function \"move-or-raise\"", + (unsigned char *) "", + (unsigned char *) "Button1 = : title : f.function \"move-or-raise\"", + (unsigned char *) "Button2 = : title : f.raiselower", + (unsigned char *) "", + (unsigned char *) "Button1 = : icon : f.function \"move-or-iconify\"", + (unsigned char *) "Button2 = : icon : f.iconify", + (unsigned char *) "", + (unsigned char *) "Button1 = : iconmgr : f.iconify", + (unsigned char *) "Button2 = : iconmgr : f.iconify", + (unsigned char *) "", + (unsigned char *) "menu \"defops\"", + (unsigned char *) "{", + (unsigned char *) "\"Twm\" f.title", + (unsigned char *) "\"Iconify\" f.iconify", + (unsigned char *) "\"Resize\" f.resize", + (unsigned char *) "\"Move\" f.move", + (unsigned char *) "\"Raise\" f.raise", + (unsigned char *) "\"Lower\" f.lower", + (unsigned char *) "\"\" f.nop", + (unsigned char *) "\"Focus\" f.focus", + (unsigned char *) "\"Unfocus\" f.unfocus", + (unsigned char *) "\"Show Iconmgr\" f.showiconmgr", + (unsigned char *) "\"Hide Iconmgr\" f.hideiconmgr", + (unsigned char *) "\"\" f.nop", + (unsigned char *) "\"Xterm\" f.exec \"exec xterm &\"", + (unsigned char *) "\"\" f.nop", + (unsigned char *) "\"Kill\" f.destroy", + (unsigned char *) "\"Delete\" f.delete", + (unsigned char *) "\"\" f.nop", + (unsigned char *) "\"Restart\" f.restart", + (unsigned char *) "\"Exit\" f.quit", + (unsigned char *) "}", + (unsigned char *) 0 }; diff --git a/app/twm/src/deftwmrc.sed b/app/twm/src/deftwmrc.sed new file mode 100644 index 000000000..d26926aab --- /dev/null +++ b/app/twm/src/deftwmrc.sed @@ -0,0 +1,4 @@ +/^#/d +s/"/\\"/g +s/^/ (unsigned char *) "/ +s/$/",/ diff --git a/app/twm/src/events.c b/app/twm/src/events.c new file mode 100644 index 000000000..57399a104 --- /dev/null +++ b/app/twm/src/events.c @@ -0,0 +1,2653 @@ +/* $XFree86: xc/programs/twm/events.c,v 1.12 2001/12/14 20:01:06 dawes Exp $ */ +/*****************************************************************************/ +/* + +Copyright 1989, 1998 The Open Group + +Permission to use, copy, modify, distribute, and sell this software and its +documentation for any purpose is hereby granted without fee, provided that +the above copyright notice appear in all copies and that both that +copyright notice and this permission notice appear in supporting +documentation. + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the name of The Open Group shall not be +used in advertising or otherwise to promote the sale, use or other dealings +in this Software without prior written authorization from The Open Group. + +*/ +/** Copyright 1988 by Evans & Sutherland Computer Corporation, **/ +/** Salt Lake City, Utah **/ +/** Cambridge, Massachusetts **/ +/** **/ +/** All Rights Reserved **/ +/** **/ +/** Permission to use, copy, modify, and distribute this software and **/ +/** its documentation for any purpose and without fee is hereby **/ +/** granted, provided that the above copyright notice appear in all **/ +/** copies and that both that copyright notice and this permis- **/ +/** sion notice appear in supporting documentation, and that the **/ +/** name of Evans & Sutherland not be used in advertising **/ +/** in publicity pertaining to distribution of the software without **/ +/** specific, written prior permission. **/ +/** **/ +/** EVANS & SUTHERLAND DISCLAIMs ALL WARRANTIES WITH REGARD **/ +/** TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANT- **/ +/** ABILITY AND FITNESS, IN NO EVENT SHALL EVANS & SUTHERLAND **/ +/** BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAM- **/ +/** AGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA **/ +/** OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER **/ +/** TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE **/ +/** OR PERFORMANCE OF THIS SOFTWARE. **/ +/*****************************************************************************/ + + +/*********************************************************************** + * + * $Xorg: events.c,v 1.4 2001/02/09 02:05:36 xorgcvs Exp $ + * + * twm event handling + * + * 17-Nov-87 Thomas E. LaStrange File created + * + ***********************************************************************/ + +#include +#include "twm.h" +#include +#include "iconmgr.h" +#include "add_window.h" +#include "menus.h" +#include "events.h" +#include "resize.h" +#include "parse.h" +#include "gram.h" +#include "util.h" +#include "screen.h" +#include "icons.h" +#include "version.h" + + +#define MAX_X_EVENT 256 +event_proc EventHandler[MAX_X_EVENT]; /* event handler jump table */ +char *Action; +int Context = C_NO_CONTEXT; /* current button press context */ +TwmWindow *ButtonWindow; /* button press window structure */ +XEvent ButtonEvent; /* button press event */ +XEvent Event; /* the current event */ +TwmWindow *Tmp_win; /* the current twm window */ + +/** Used in HandleEnterNotify to remove border highlight from a window + * that has not recieved a LeaveNotify event because of a pointer grab + */ +TwmWindow *UnHighLight_win = NULL; + +Window DragWindow; /* variables used in moving windows */ +int origDragX; +int origDragY; +int DragX; +int DragY; +int DragWidth; +int DragHeight; +int CurrentDragX; +int CurrentDragY; + +static int enter_flag; +static int ColortableThrashing; +static TwmWindow *enter_win, *raise_win; + +static void free_window_names ( TwmWindow *tmp, Bool nukefull, Bool nukename, Bool nukeicon ); +static void remove_window_from_ring ( TwmWindow *tmp ); +static void do_menu ( MenuRoot *menu, Window w ); +static Bool HENQueueScanner ( Display *dpy, XEvent *ev, char *args ); +static Bool HLNQueueScanner ( Display *dpy, XEvent *ev, char *args ); +static void flush_expose ( Window w ); +static Bool UninstallRootColormapQScanner ( Display *dpy, XEvent *ev, char *args ); + +int ButtonPressed = -1; +int Cancel = FALSE; + + +void AutoRaiseWindow (TwmWindow *tmp) +{ + XRaiseWindow (dpy, tmp->frame); + XSync (dpy, 0); + enter_win = NULL; + enter_flag = TRUE; + raise_win = tmp; +} + +void SetRaiseWindow (TwmWindow *tmp) +{ + enter_flag = TRUE; + enter_win = NULL; + raise_win = tmp; + XSync (dpy, 0); +} + + + +/** + * initialize the event jump table. + */ +void +InitEvents() +{ + int i; + + + ResizeWindow = (Window) 0; + DragWindow = (Window) 0; + enter_flag = FALSE; + enter_win = raise_win = NULL; + + for (i = 0; i < MAX_X_EVENT; i++) + EventHandler[i] = HandleUnknown; + + EventHandler[Expose] = HandleExpose; + EventHandler[CreateNotify] = HandleCreateNotify; + EventHandler[DestroyNotify] = HandleDestroyNotify; + EventHandler[MapRequest] = HandleMapRequest; + EventHandler[MapNotify] = HandleMapNotify; + EventHandler[UnmapNotify] = HandleUnmapNotify; + EventHandler[MotionNotify] = HandleMotionNotify; + EventHandler[ButtonRelease] = HandleButtonRelease; + EventHandler[ButtonPress] = HandleButtonPress; + EventHandler[EnterNotify] = HandleEnterNotify; + EventHandler[LeaveNotify] = HandleLeaveNotify; + EventHandler[ConfigureRequest] = HandleConfigureRequest; + EventHandler[ClientMessage] = HandleClientMessage; + EventHandler[PropertyNotify] = HandlePropertyNotify; + EventHandler[KeyPress] = HandleKeyPress; + EventHandler[ColormapNotify] = HandleColormapNotify; + EventHandler[VisibilityNotify] = HandleVisibilityNotify; + if (HasShape) + EventHandler[ShapeEventBase+ShapeNotify] = HandleShapeNotify; +} + + + + +Time lastTimestamp = CurrentTime; /* until Xlib does this for us */ + +Bool StashEventTime (XEvent *ev) +{ + switch (ev->type) { + case KeyPress: + case KeyRelease: + lastTimestamp = ev->xkey.time; + return True; + case ButtonPress: + case ButtonRelease: + lastTimestamp = ev->xbutton.time; + return True; + case MotionNotify: + lastTimestamp = ev->xmotion.time; + return True; + case EnterNotify: + case LeaveNotify: + lastTimestamp = ev->xcrossing.time; + return True; + case PropertyNotify: + lastTimestamp = ev->xproperty.time; + return True; + case SelectionClear: + lastTimestamp = ev->xselectionclear.time; + return True; + case SelectionRequest: + lastTimestamp = ev->xselectionrequest.time; + return True; + case SelectionNotify: + lastTimestamp = ev->xselection.time; + return True; + } + return False; +} + + + +/** + * return the window about which this event is concerned; this + * window may not be the same as XEvent.xany.window (the first window listed + * in the structure). + */ +Window WindowOfEvent (XEvent *e) +{ + /* + * Each window subfield is marked with whether or not it is the same as + * XEvent.xany.window or is different (which is the case for some of the + * notify events). + */ + switch (e->type) { + case KeyPress: + case KeyRelease: return e->xkey.window; /* same */ + case ButtonPress: + case ButtonRelease: return e->xbutton.window; /* same */ + case MotionNotify: return e->xmotion.window; /* same */ + case EnterNotify: + case LeaveNotify: return e->xcrossing.window; /* same */ + case FocusIn: + case FocusOut: return e->xfocus.window; /* same */ + case KeymapNotify: return e->xkeymap.window; /* same */ + case Expose: return e->xexpose.window; /* same */ + case GraphicsExpose: return e->xgraphicsexpose.drawable; /* same */ + case NoExpose: return e->xnoexpose.drawable; /* same */ + case VisibilityNotify: return e->xvisibility.window; /* same */ + case CreateNotify: return e->xcreatewindow.window; /* DIFF */ + case DestroyNotify: return e->xdestroywindow.window; /* DIFF */ + case UnmapNotify: return e->xunmap.window; /* DIFF */ + case MapNotify: return e->xmap.window; /* DIFF */ + case MapRequest: return e->xmaprequest.window; /* DIFF */ + case ReparentNotify: return e->xreparent.window; /* DIFF */ + case ConfigureNotify: return e->xconfigure.window; /* DIFF */ + case ConfigureRequest: return e->xconfigurerequest.window; /* DIFF */ + case GravityNotify: return e->xgravity.window; /* DIFF */ + case ResizeRequest: return e->xresizerequest.window; /* same */ + case CirculateNotify: return e->xcirculate.window; /* DIFF */ + case CirculateRequest: return e->xcirculaterequest.window; /* DIFF */ + case PropertyNotify: return e->xproperty.window; /* same */ + case SelectionClear: return e->xselectionclear.window; /* same */ + case SelectionRequest: return e->xselectionrequest.requestor; /* DIFF */ + case SelectionNotify: return e->xselection.requestor; /* same */ + case ColormapNotify: return e->xcolormap.window; /* same */ + case ClientMessage: return e->xclient.window; /* same */ + case MappingNotify: return None; + } + return None; +} + + + +/** + * handle a single X event stored in global var Event + * this routine for is for a call during an f.move + */ +Bool DispatchEvent2 () +{ + Window w = Event.xany.window; + StashEventTime (&Event); + + if (XFindContext (dpy, w, TwmContext, (caddr_t *) &Tmp_win) == XCNOENT) + Tmp_win = NULL; + + if (XFindContext (dpy, w, ScreenContext, (caddr_t *)&Scr) == XCNOENT) { + Scr = FindScreenInfo (WindowOfEvent (&Event)); + } + + if (!Scr) return False; + + if (menuFromFrameOrWindowOrTitlebar && Event.type == Expose) + HandleExpose(); + + if (!menuFromFrameOrWindowOrTitlebar && Event.type>= 0 && Event.type < MAX_X_EVENT) { + (*EventHandler[Event.type])(); + } + + return True; +} + +/** + * handle a single X event stored in global var Event + */ +Bool DispatchEvent () +{ + Window w = Event.xany.window; + StashEventTime (&Event); + + if (XFindContext (dpy, w, TwmContext, (caddr_t *) &Tmp_win) == XCNOENT) + Tmp_win = NULL; + + if (XFindContext (dpy, w, ScreenContext, (caddr_t *)&Scr) == XCNOENT) { + Scr = FindScreenInfo (WindowOfEvent (&Event)); + } + + if (!Scr) return False; + + if (Event.type>= 0 && Event.type < MAX_X_EVENT) { + (*EventHandler[Event.type])(); + } + + return True; +} + + + +/** + * handle X events + */ +void +HandleEvents() +{ + while (TRUE) + { + if (enter_flag && !QLength(dpy)) { + if (enter_win && enter_win != raise_win) { + AutoRaiseWindow (enter_win); /* sets enter_flag T */ + } else { + enter_flag = FALSE; + } + } + if (ColortableThrashing && !QLength(dpy) && Scr) { + InstallWindowColormaps(ColormapNotify, (TwmWindow *) NULL); + } + WindowMoved = FALSE; + XtAppNextEvent(appContext, &Event); + if (Event.type>= 0 && Event.type < MAX_X_EVENT) + (void) DispatchEvent (); + else + XtDispatchEvent (&Event); + } +} + + + +/** + * colormap notify event handler. + * + * This procedure handles both a client changing its own colormap, and + * a client explicitly installing its colormap itself (only the window + * manager should do that, so we must set it correctly). + * + */ +void +HandleColormapNotify() +{ + XColormapEvent *cevent = (XColormapEvent *) &Event; + ColormapWindow *cwin, **cwins; + TwmColormap *cmap; + int lost, won, n, number_cwins; + + if (XFindContext(dpy, cevent->window, ColormapContext, (caddr_t *)&cwin) == XCNOENT) + return; + cmap = cwin->colormap; + + if (cevent->new) + { + if (XFindContext(dpy, cevent->colormap, ColormapContext, + (caddr_t *)&cwin->colormap) == XCNOENT) + cwin->colormap = CreateTwmColormap(cevent->colormap); + else + cwin->colormap->refcnt++; + + cmap->refcnt--; + + if (cevent->state == ColormapUninstalled) + cmap->state &= ~CM_INSTALLED; + else + cmap->state |= CM_INSTALLED; + + if (cmap->state & CM_INSTALLABLE) + InstallWindowColormaps(ColormapNotify, (TwmWindow *) NULL); + + if (cmap->refcnt == 0) + { + XDeleteContext(dpy, cmap->c, ColormapContext); + free((char *) cmap); + } + + return; + } + + if (cevent->state == ColormapUninstalled && + (cmap->state & CM_INSTALLABLE)) + { + if (!(cmap->state & CM_INSTALLED)) + return; + cmap->state &= ~CM_INSTALLED; + + if (!ColortableThrashing) + { + ColortableThrashing = TRUE; + XSync(dpy, 0); + } + + if (cevent->serial >= Scr->cmapInfo.first_req) + { + number_cwins = Scr->cmapInfo.cmaps->number_cwins; + + /* + * Find out which colortables collided. + */ + + cwins = Scr->cmapInfo.cmaps->cwins; + for (lost = won = -1, n = 0; + (lost == -1 || won == -1) && n < number_cwins; + n++) + { + if (lost == -1 && cwins[n] == cwin) + { + lost = n; /* This is the window which lost its colormap */ + continue; + } + + if (won == -1 && + cwins[n]->colormap->install_req == cevent->serial) + { + won = n; /* This is the window whose colormap caused */ + continue; /* the de-install of the previous colormap */ + } + } + + /* + ** Cases are: + ** Both the request and the window were found: + ** One of the installs made honoring the WM_COLORMAP + ** property caused another of the colormaps to be + ** de-installed, just mark the scoreboard. + ** + ** Only the request was found: + ** One of the installs made honoring the WM_COLORMAP + ** property caused a window not in the WM_COLORMAP + ** list to lose its map. This happens when the map + ** it is losing is one which is trying to be installed, + ** but is getting getting de-installed by another map + ** in this case, we'll get a scoreable event later, + ** this one is meaningless. + ** + ** Neither the request nor the window was found: + ** Somebody called installcolormap, but it doesn't + ** affect the WM_COLORMAP windows. This case will + ** probably never occur. + ** + ** Only the window was found: + ** One of the WM_COLORMAP windows lost its colormap + ** but it wasn't one of the requests known. This is + ** probably because someone did an "InstallColormap". + ** The colormap policy is "enforced" by re-installing + ** the colormaps which are believed to be correct. + */ + + if (won != -1) { + if (lost != -1) + { + /* lower diagonal index calculation */ + if (lost > won) + n = lost*(lost-1)/2 + won; + else + n = won*(won-1)/2 + lost; + Scr->cmapInfo.cmaps->scoreboard[n] = 1; + } else + { + /* + ** One of the cwin installs caused one of the cwin + ** colormaps to be de-installed, so I'm sure to get an + ** UninstallNotify for the cwin I know about later. + ** I haven't got it yet, or the test of CM_INSTALLED + ** above would have failed. Turning the CM_INSTALLED + ** bit back on makes sure we get back here to score + ** the collision. + */ + cmap->state |= CM_INSTALLED; + } + } else if (lost != -1) { + InstallWindowColormaps(ColormapNotify, (TwmWindow *) NULL); + } + } + } + + else if (cevent->state == ColormapUninstalled) + cmap->state &= ~CM_INSTALLED; + + else if (cevent->state == ColormapInstalled) + cmap->state |= CM_INSTALLED; +} + + + +/** + * visibility notify event handler. + * + * This routine keeps track of visibility events so that colormap + * installation can keep the maximum number of useful colormaps + * installed at one time. + * + */ +void +HandleVisibilityNotify() +{ + XVisibilityEvent *vevent = (XVisibilityEvent *) &Event; + ColormapWindow *cwin; + TwmColormap *cmap; + + if (XFindContext(dpy, vevent->window, ColormapContext, (caddr_t *)&cwin) == XCNOENT) + return; + + /* + * when Saber complains about retreiving an from an + * just type "touch vevent->state" and "cont" + */ + cmap = cwin->colormap; + if ((cmap->state & CM_INSTALLABLE) && + vevent->state != cwin->visibility && + (vevent->state == VisibilityFullyObscured || + cwin->visibility == VisibilityFullyObscured) && + cmap->w == cwin->w) { + cwin->visibility = vevent->state; + InstallWindowColormaps(VisibilityNotify, (TwmWindow *) NULL); + } else + cwin->visibility = vevent->state; +} + + + + +int MovedFromKeyPress = False; + +/** + * key press event handler + */ +void +HandleKeyPress() +{ + KeySym ks; + FuncKey *key; + int len; + unsigned int modifier; + + if (InfoLines) XUnmapWindow(dpy, Scr->InfoWindow); + Context = C_NO_CONTEXT; + + if (Event.xany.window == Scr->Root) + Context = C_ROOT; + if (Tmp_win) + { + if (Event.xany.window == Tmp_win->title_w) + Context = C_TITLE; + if (Event.xany.window == Tmp_win->w) + Context = C_WINDOW; + if (Event.xany.window == Tmp_win->icon_w) + Context = C_ICON; + if (Event.xany.window == Tmp_win->frame) + Context = C_FRAME; + if (Tmp_win->list && Event.xany.window == Tmp_win->list->w) + Context = C_ICONMGR; + if (Tmp_win->list && Event.xany.window == Tmp_win->list->icon) + Context = C_ICONMGR; + } + + modifier = (Event.xkey.state & mods_used); + ks = XLookupKeysym((XKeyEvent *) &Event, /* KeySyms index */ 0); + for (key = Scr->FuncKeyRoot.next; key != NULL; key = key->next) + { + if (key->keysym == ks && + key->mods == modifier && + (key->cont == Context || key->cont == C_NAME)) + { + /* weed out the functions that don't make sense to execute + * from a key press + */ + if (key->func == F_RESIZE) + return; + /* special case for F_MOVE/F_FORCEMOVE activated from a keypress */ + if (key->func == F_MOVE || key->func == F_FORCEMOVE) + MovedFromKeyPress = True; + + if (key->cont != C_NAME) + { + ExecuteFunction(key->func, key->action, Event.xany.window, + Tmp_win, &Event, Context, FALSE); + XUngrabPointer(dpy, CurrentTime); + return; + } + else + { + int matched = FALSE; + len = strlen(key->win_name); + + /* try and match the name first */ + for (Tmp_win = Scr->TwmRoot.next; Tmp_win != NULL; + Tmp_win = Tmp_win->next) + { + if (!strncmp(key->win_name, Tmp_win->name, len)) + { + matched = TRUE; + ExecuteFunction(key->func, key->action, Tmp_win->frame, + Tmp_win, &Event, C_FRAME, FALSE); + XUngrabPointer(dpy, CurrentTime); + } + } + + /* now try the res_name */ + if (!matched) + for (Tmp_win = Scr->TwmRoot.next; Tmp_win != NULL; + Tmp_win = Tmp_win->next) + { + if (!strncmp(key->win_name, Tmp_win->class.res_name, len)) + { + matched = TRUE; + ExecuteFunction(key->func, key->action, Tmp_win->frame, + Tmp_win, &Event, C_FRAME, FALSE); + XUngrabPointer(dpy, CurrentTime); + } + } + + /* now try the res_class */ + if (!matched) + for (Tmp_win = Scr->TwmRoot.next; Tmp_win != NULL; + Tmp_win = Tmp_win->next) + { + if (!strncmp(key->win_name, Tmp_win->class.res_class, len)) + { + matched = TRUE; + ExecuteFunction(key->func, key->action, Tmp_win->frame, + Tmp_win, &Event, C_FRAME, FALSE); + XUngrabPointer(dpy, CurrentTime); + } + } + if (matched) + return; + } + } + } + + /* if we get here, no function key was bound to the key. Send it + * to the client if it was in a window we know about. + */ + if (Tmp_win) + { + if (Event.xany.window == Tmp_win->icon_w || + Event.xany.window == Tmp_win->frame || + Event.xany.window == Tmp_win->title_w || + (Tmp_win->list && (Event.xany.window == Tmp_win->list->w))) + { + Event.xkey.window = Tmp_win->w; + XSendEvent(dpy, Tmp_win->w, False, KeyPressMask, &Event); + } + } + +} + + + +static void +free_window_names (TwmWindow *tmp, Bool nukefull, Bool nukename, Bool nukeicon) +{ +/* + * XXX - are we sure that nobody ever sets these to another constant (check + * twm windows)? + */ + if (tmp->name == tmp->full_name) nukefull = False; + if (tmp->icon_name == tmp->name) nukename = False; + + if (nukefull && tmp->full_name) free (tmp->full_name); + if (nukename && tmp->name) free (tmp->name); + if (nukeicon && tmp->icon_name) free (tmp->icon_name); + return; +} + + + +void +free_cwins (TwmWindow *tmp) +{ + int i; + TwmColormap *cmap; + + if (tmp->cmaps.number_cwins) { + for (i = 0; i < tmp->cmaps.number_cwins; i++) { + if (--tmp->cmaps.cwins[i]->refcnt == 0) { + cmap = tmp->cmaps.cwins[i]->colormap; + if (--cmap->refcnt == 0) { + XDeleteContext(dpy, cmap->c, ColormapContext); + free((char *) cmap); + } + XDeleteContext(dpy, tmp->cmaps.cwins[i]->w, ColormapContext); + free((char *) tmp->cmaps.cwins[i]); + } + } + free((char *) tmp->cmaps.cwins); + if (tmp->cmaps.number_cwins > 1) { + free(tmp->cmaps.scoreboard); + tmp->cmaps.scoreboard = NULL; + } + tmp->cmaps.number_cwins = 0; + } +} + + + +/** + * property notify event handler + */ +void +HandlePropertyNotify() +{ + char *name = NULL; + unsigned long valuemask; /* mask for create windows */ + XSetWindowAttributes attributes; /* attributes for create windows */ + Pixmap pm; + + /* watch for standard colormap changes */ + if (Event.xproperty.window == Scr->Root) { + XStandardColormap *maps = NULL; + int nmaps; + + switch (Event.xproperty.state) { + case PropertyNewValue: + if (XGetRGBColormaps (dpy, Scr->Root, &maps, &nmaps, + Event.xproperty.atom)) { + /* if got one, then replace any existing entry */ + InsertRGBColormap (Event.xproperty.atom, maps, nmaps, True); + } + return; + + case PropertyDelete: + RemoveRGBColormap (Event.xproperty.atom); + return; + } + } + + if (!Tmp_win) return; /* unknown window */ + +#define MAX_NAME_LEN 200L /* truncate to this many */ +#define MAX_ICON_NAME_LEN 200L /* ditto */ + + switch (Event.xproperty.atom) { + case XA_WM_NAME: + if (!I18N_FetchName(dpy, Tmp_win->w, &name)) return; + free_window_names (Tmp_win, True, True, False); + + Tmp_win->full_name = strdup(name ? name : NoName); + Tmp_win->name = strdup(name ? name : NoName); + if (name) free(name); + + Tmp_win->nameChanged = 1; + + Tmp_win->name_width = MyFont_TextWidth (&Scr->TitleBarFont, + Tmp_win->name, + strlen (Tmp_win->name)); + + SetupWindow (Tmp_win, Tmp_win->frame_x, Tmp_win->frame_y, + Tmp_win->frame_width, Tmp_win->frame_height, -1); + + if (Tmp_win->title_w) XClearArea(dpy, Tmp_win->title_w, 0,0,0,0, True); + + /* + * if the icon name is NoName, set the name of the icon to be + * the same as the window + */ + if (Tmp_win->icon_name == NoName) { + Tmp_win->icon_name = Tmp_win->name; + RedoIconName(); + } + break; + + case XA_WM_ICON_NAME: + if (!I18N_GetIconName(dpy, Tmp_win->w, &name)) return; + free_window_names (Tmp_win, False, False, True); + Tmp_win->icon_name = strdup(name ? name : NoName); + if (name) free(name); + + RedoIconName(); + break; + + case XA_WM_HINTS: + if (Tmp_win->wmhints) XFree ((char *) Tmp_win->wmhints); + Tmp_win->wmhints = XGetWMHints(dpy, Event.xany.window); + + if (Tmp_win->wmhints && (Tmp_win->wmhints->flags & WindowGroupHint)) + Tmp_win->group = Tmp_win->wmhints->window_group; + + if (Tmp_win->icon_not_ours && Tmp_win->wmhints && + !(Tmp_win->wmhints->flags & IconWindowHint)) { + /* IconWindowHint was formerly on, now off; revert + // to a default icon */ + int icon_x = 0, icon_y = 0; + XGetGeometry (dpy, Tmp_win->icon_w, &JunkRoot, + &icon_x, &icon_y, + &JunkWidth, &JunkHeight, &JunkBW, &JunkDepth); + XSelectInput (dpy, Tmp_win->icon_w, None); + XDeleteContext (dpy, Tmp_win->icon_w, TwmContext); + XDeleteContext (dpy, Tmp_win->icon_w, ScreenContext); + CreateIconWindow(Tmp_win, icon_x, icon_y); + break; + } + + if (!Tmp_win->forced && Tmp_win->wmhints && + Tmp_win->wmhints->flags & IconWindowHint) { + if (Tmp_win->icon_w) { + int icon_x, icon_y; + + /* + * There's already an icon window. + * Try to find out where it is; if we succeed, move the new + * window to where the old one is. + */ + if (XGetGeometry (dpy, Tmp_win->icon_w, &JunkRoot, &icon_x, + &icon_y, &JunkWidth, &JunkHeight, &JunkBW, &JunkDepth)) { + /* + * Move the new icon window to where the old one was. + */ + XMoveWindow(dpy, Tmp_win->wmhints->icon_window, icon_x, + icon_y); + } + + /* + * If the window is iconic, map the new icon window. + */ + if (Tmp_win->icon) + XMapWindow(dpy, Tmp_win->wmhints->icon_window); + + /* + * Now, if the old window isn't ours, unmap it, otherwise + * just get rid of it completely. + */ + if (Tmp_win->icon_not_ours) { + if (Tmp_win->icon_w != Tmp_win->wmhints->icon_window) + XUnmapWindow(dpy, Tmp_win->icon_w); + } else + XDestroyWindow(dpy, Tmp_win->icon_w); + + XDeleteContext(dpy, Tmp_win->icon_w, TwmContext); + XDeleteContext(dpy, Tmp_win->icon_w, ScreenContext); + + /* + * The new icon window isn't our window, so note that fact + * so that we don't treat it as ours. + */ + Tmp_win->icon_not_ours = TRUE; + + /* + * Now make the new window the icon window for this window, + * and set it up to work as such (select for key presses + * and button presses/releases, set up the contexts for it, + * and define the cursor for it). + */ + Tmp_win->icon_w = Tmp_win->wmhints->icon_window; + XSelectInput (dpy, Tmp_win->icon_w, + KeyPressMask | ButtonPressMask | ButtonReleaseMask); + XSaveContext(dpy, Tmp_win->icon_w, TwmContext, (caddr_t)Tmp_win); + XSaveContext(dpy, Tmp_win->icon_w, ScreenContext, (caddr_t)Scr); + XDefineCursor(dpy, Tmp_win->icon_w, Scr->IconCursor); + } + } + + if (Tmp_win->icon_w && !Tmp_win->forced && Tmp_win->wmhints && + (Tmp_win->wmhints->flags & IconPixmapHint)) { + if (!XGetGeometry (dpy, Tmp_win->wmhints->icon_pixmap, &JunkRoot, + &JunkX, &JunkY, (unsigned int *)&Tmp_win->icon_width, + (unsigned int *)&Tmp_win->icon_height, &JunkBW, &JunkDepth)) { + return; + } + + pm = XCreatePixmap (dpy, Scr->Root, Tmp_win->icon_width, + Tmp_win->icon_height, Scr->d_depth); + + FB(Tmp_win->iconc.fore, Tmp_win->iconc.back); + XCopyPlane(dpy, Tmp_win->wmhints->icon_pixmap, pm, + Scr->NormalGC, + 0,0, Tmp_win->icon_width, Tmp_win->icon_height, 0, 0, 1 ); + + valuemask = CWBackPixmap; + attributes.background_pixmap = pm; + + if (Tmp_win->icon_bm_w) + XDestroyWindow(dpy, Tmp_win->icon_bm_w); + + Tmp_win->icon_bm_w = + XCreateWindow (dpy, Tmp_win->icon_w, 0, 0, + (unsigned int) Tmp_win->icon_width, + (unsigned int) Tmp_win->icon_height, + (unsigned int) 0, Scr->d_depth, + (unsigned int) CopyFromParent, Scr->d_visual, + valuemask, &attributes); + + XFreePixmap (dpy, pm); + RedoIconName(); + } + break; + + case XA_WM_NORMAL_HINTS: + GetWindowSizeHints (Tmp_win); + break; + + default: + if (Event.xproperty.atom == _XA_WM_COLORMAP_WINDOWS) { + FetchWmColormapWindows (Tmp_win); /* frees old data */ + break; + } else if (Event.xproperty.atom == _XA_WM_PROTOCOLS) { + FetchWmProtocols (Tmp_win); + break; + } + break; + } +} + + + +/** + * procedure to re-position the icon window and name + */ +void +RedoIconName() +{ + int x, y; + + if (Tmp_win->list) + { + /* let the expose event cause the repaint */ + XClearArea(dpy, Tmp_win->list->w, 0,0,0,0, True); + + if (Scr->SortIconMgr) + SortIconManager(Tmp_win->list->iconmgr); + } + + if (Tmp_win->icon_w == (Window) 0) + return; + + if (Tmp_win->icon_not_ours) + return; + + Tmp_win->icon_w_width = MyFont_TextWidth(&Scr->IconFont, + Tmp_win->icon_name, strlen(Tmp_win->icon_name)); + + Tmp_win->icon_w_width += 6; + if (Tmp_win->icon_w_width < Tmp_win->icon_width) + { + Tmp_win->icon_x = (Tmp_win->icon_width - Tmp_win->icon_w_width)/2; + Tmp_win->icon_x += 3; + Tmp_win->icon_w_width = Tmp_win->icon_width; + } + else + { + Tmp_win->icon_x = 3; + } + + if (Tmp_win->icon_w_width == Tmp_win->icon_width) + x = 0; + else + x = (Tmp_win->icon_w_width - Tmp_win->icon_width)/2; + + y = 0; + + Tmp_win->icon_w_height = Tmp_win->icon_height + Scr->IconFont.height + 4; + Tmp_win->icon_y = Tmp_win->icon_height + Scr->IconFont.height; + + XResizeWindow(dpy, Tmp_win->icon_w, Tmp_win->icon_w_width, + Tmp_win->icon_w_height); + if (Tmp_win->icon_bm_w) + { + XMoveWindow(dpy, Tmp_win->icon_bm_w, x, y); + XMapWindow(dpy, Tmp_win->icon_bm_w); + } + if (Tmp_win->icon) + { + XClearArea(dpy, Tmp_win->icon_w, 0, 0, 0, 0, True); + } +} + + + +/** + *client message event handler + */ +void +HandleClientMessage() +{ + if (Event.xclient.message_type == _XA_WM_CHANGE_STATE) + { + if (Tmp_win != NULL) + { + if (Event.xclient.data.l[0] == IconicState && !Tmp_win->icon) + { + XEvent button; + + XQueryPointer( dpy, Scr->Root, &JunkRoot, &JunkChild, + &(button.xmotion.x_root), + &(button.xmotion.y_root), + &JunkX, &JunkY, &JunkMask); + + ExecuteFunction(F_ICONIFY, NULLSTR, Event.xany.window, + Tmp_win, &button, FRAME, FALSE); + XUngrabPointer(dpy, CurrentTime); + } + } + } +} + + + +/** + * expose event handler + */ +void +HandleExpose() +{ + MenuRoot *tmp; + if (XFindContext(dpy, Event.xany.window, MenuContext, (caddr_t *)&tmp) == 0) + { + PaintMenu(tmp, &Event); + return; + } + + if (Event.xexpose.count != 0) + return; + + if (Event.xany.window == Scr->InfoWindow && InfoLines) + { + int i; + int height; + + MyFont_ChangeGC(Scr->DefaultC.fore, Scr->DefaultC.back, + &Scr->DefaultFont); + + height = Scr->DefaultFont.height+2; + for (i = 0; i < InfoLines; i++) + { + MyFont_DrawString(dpy, Scr->InfoWindow, &Scr->DefaultFont, + Scr->NormalGC, 5, (i*height) + Scr->DefaultFont.y, Info[i], + strlen(Info[i])); + } + flush_expose (Event.xany.window); + } + else if (Tmp_win != NULL) + { + if (Event.xany.window == Tmp_win->title_w) + { + MyFont_ChangeGC(Tmp_win->title.fore, Tmp_win->title.back, + &Scr->TitleBarFont); + + MyFont_DrawString (dpy, Tmp_win->title_w, &Scr->TitleBarFont, + Scr->NormalGC, Scr->TBInfo.titlex, Scr->TitleBarFont.y, + Tmp_win->name, strlen(Tmp_win->name)); + flush_expose (Event.xany.window); + } + else if (Event.xany.window == Tmp_win->icon_w) + { + MyFont_ChangeGC(Tmp_win->iconc.fore, Tmp_win->iconc.back, + &Scr->IconFont); + + MyFont_DrawString (dpy, Tmp_win->icon_w, &Scr->IconFont, + Scr->NormalGC, Tmp_win->icon_x, Tmp_win->icon_y, + Tmp_win->icon_name, strlen(Tmp_win->icon_name)); + flush_expose (Event.xany.window); + return; + } else if (Tmp_win->titlebuttons) { + int i; + Window w = Event.xany.window; + register TBWindow *tbw; + int nb = Scr->TBInfo.nleft + Scr->TBInfo.nright; + + for (i = 0, tbw = Tmp_win->titlebuttons; i < nb; i++, tbw++) { + if (w == tbw->window) { + register TitleButton *tb = tbw->info; + + FB(Tmp_win->title.fore, Tmp_win->title.back); + XCopyPlane (dpy, tb->bitmap, w, Scr->NormalGC, + tb->srcx, tb->srcy, tb->width, tb->height, + tb->dstx, tb->dsty, 1); + flush_expose (w); + return; + } + } + } + if (Tmp_win->list) { + if (Event.xany.window == Tmp_win->list->w) + { + MyFont_ChangeGC(Tmp_win->list->fore, Tmp_win->list->back, + &Scr->IconManagerFont); + MyFont_DrawString (dpy, Event.xany.window, + &Scr->IconManagerFont, Scr->NormalGC, + iconmgr_textx, Scr->IconManagerFont.y+4, + Tmp_win->icon_name, strlen(Tmp_win->icon_name)); + DrawIconManagerBorder(Tmp_win->list); + flush_expose (Event.xany.window); + return; + } + if (Event.xany.window == Tmp_win->list->icon) + { + FB(Tmp_win->list->fore, Tmp_win->list->back); + XCopyPlane(dpy, Scr->siconifyPm, Tmp_win->list->icon, + Scr->NormalGC, + 0,0, iconifybox_width, iconifybox_height, 0, 0, 1); + flush_expose (Event.xany.window); + return; + } + } + } +} + + + +static void remove_window_from_ring (TwmWindow *tmp) +{ + TwmWindow *prev = tmp->ring.prev, *next = tmp->ring.next; + + if (enter_win == tmp) { + enter_flag = FALSE; + enter_win = NULL; + } + if (raise_win == Tmp_win) raise_win = NULL; + + /* + * 1. Unlink window + * 2. If window was only thing in ring, null out ring + * 3. If window was ring leader, set to next (or null) + */ + if (prev) prev->ring.next = next; + if (next) next->ring.prev = prev; + if (Scr->Ring == tmp) + Scr->Ring = (next != tmp ? next : (TwmWindow *) NULL); + + if (!Scr->Ring || Scr->RingLeader == tmp) Scr->RingLeader = Scr->Ring; +} + + + +/** + * DestroyNotify event handler + */ +void +HandleDestroyNotify() +{ + int i; + + /* + * Warning, this is also called by HandleUnmapNotify; if it ever needs to + * look at the event, HandleUnmapNotify will have to mash the UnmapNotify + * into a DestroyNotify. + */ + + if (Tmp_win == NULL) + return; + + if (Tmp_win == Scr->Focus) + { + FocusOnRoot(); + } + XDeleteContext(dpy, Tmp_win->w, TwmContext); + XDeleteContext(dpy, Tmp_win->w, ScreenContext); + XDeleteContext(dpy, Tmp_win->frame, TwmContext); + XDeleteContext(dpy, Tmp_win->frame, ScreenContext); + if (Tmp_win->icon_w) + { + XDeleteContext(dpy, Tmp_win->icon_w, TwmContext); + XDeleteContext(dpy, Tmp_win->icon_w, ScreenContext); + } + if (Tmp_win->title_height) + { + int nb = Scr->TBInfo.nleft + Scr->TBInfo.nright; + XDeleteContext(dpy, Tmp_win->title_w, TwmContext); + XDeleteContext(dpy, Tmp_win->title_w, ScreenContext); + if (Tmp_win->hilite_w) + { + XDeleteContext(dpy, Tmp_win->hilite_w, TwmContext); + XDeleteContext(dpy, Tmp_win->hilite_w, ScreenContext); + } + if (Tmp_win->titlebuttons) { + for (i = 0; i < nb; i++) { + XDeleteContext (dpy, Tmp_win->titlebuttons[i].window, + TwmContext); + XDeleteContext (dpy, Tmp_win->titlebuttons[i].window, + ScreenContext); + } + } + } + + if (Scr->cmapInfo.cmaps == &Tmp_win->cmaps) + InstallWindowColormaps(DestroyNotify, &Scr->TwmRoot); + + /* + * TwmWindows contain the following pointers + * + * 1. full_name + * 2. name + * 3. icon_name + * 4. wmhints + * 5. class.res_name + * 6. class.res_class + * 7. list + * 8. iconmgrp + * 9. cwins + * 10. titlebuttons + * 11. window ring + */ + if (Tmp_win->gray) XFreePixmap (dpy, Tmp_win->gray); + + XDestroyWindow(dpy, Tmp_win->frame); + if (Tmp_win->icon_w && !Tmp_win->icon_not_ours) { + XDestroyWindow(dpy, Tmp_win->icon_w); + IconDown (Tmp_win); + } + RemoveIconManager(Tmp_win); /* 7 */ + Tmp_win->prev->next = Tmp_win->next; + if (Tmp_win->next != NULL) + Tmp_win->next->prev = Tmp_win->prev; + if (Tmp_win->auto_raise) Scr->NumAutoRaises--; + + free_window_names (Tmp_win, True, True, True); /* 1, 2, 3 */ + if (Tmp_win->wmhints) /* 4 */ + XFree ((char *)Tmp_win->wmhints); + if (Tmp_win->class.res_name && Tmp_win->class.res_name != NoName) /* 5 */ + XFree ((char *)Tmp_win->class.res_name); + if (Tmp_win->class.res_class && Tmp_win->class.res_class != NoName) /* 6 */ + XFree ((char *)Tmp_win->class.res_class); + free_cwins (Tmp_win); /* 9 */ + if (Tmp_win->titlebuttons) /* 10 */ + free ((char *) Tmp_win->titlebuttons); + remove_window_from_ring (Tmp_win); /* 11 */ + + if (UnHighLight_win == Tmp_win) + UnHighLight_win = NULL; + + free((char *)Tmp_win); +} + + + +void +HandleCreateNotify() +{ +#ifdef DEBUG_EVENTS + fprintf(stderr, "CreateNotify w = 0x%x\n", Event.xcreatewindow.window); + fflush(stderr); + Bell(XkbBI_Info,0,Event.xcreatewindow.window); + XSync(dpy, 0); +#endif +} + + + +/** + * HandleMapRequest - MapRequest event handler + */ +void +HandleMapRequest() +{ + int stat; + int zoom_save; + + Event.xany.window = Event.xmaprequest.window; + stat = XFindContext(dpy, Event.xany.window, TwmContext, (caddr_t *)&Tmp_win); + if (stat == XCNOENT) + Tmp_win = NULL; + + /* If the window has never been mapped before ... */ + if (Tmp_win == NULL) + { + /* Add decorations. */ + Tmp_win = AddWindow(Event.xany.window, FALSE, (IconMgr *) NULL); + if (Tmp_win == NULL) + return; + } + else + { + /* + * If the window has been unmapped by the client, it won't be listed + * in the icon manager. Add it again, if requested. + */ + if (Tmp_win->list == NULL) + (void) AddIconManager (Tmp_win); + } + + /* If it's not merely iconified, and we have hints, use them. */ + if ((! Tmp_win->icon) && + Tmp_win->wmhints && (Tmp_win->wmhints->flags & StateHint)) + { + int state; + Window icon; + + /* use WM_STATE if enabled */ + if (!(RestartPreviousState && GetWMState(Tmp_win->w, &state, &icon) && + (state == NormalState || state == IconicState))) + state = Tmp_win->wmhints->initial_state; + + switch (state) + { + case DontCareState: + case NormalState: + case ZoomState: + case InactiveState: + XMapWindow(dpy, Tmp_win->w); + XMapWindow(dpy, Tmp_win->frame); + SetMapStateProp(Tmp_win, NormalState); + SetRaiseWindow (Tmp_win); + break; + + case IconicState: + zoom_save = Scr->DoZoom; + Scr->DoZoom = FALSE; + Iconify(Tmp_win, 0, 0); + Scr->DoZoom = zoom_save; + break; + } + } + /* If no hints, or currently an icon, just "deiconify" */ + else + { + DeIconify(Tmp_win); + SetRaiseWindow (Tmp_win); + } +} + + + +void SimulateMapRequest (w) + Window w; +{ + Event.xmaprequest.window = w; + HandleMapRequest (); +} + + + +/** + * MapNotify event handler + */ +void +HandleMapNotify() +{ + if (Tmp_win == NULL) + return; + + /* + * Need to do the grab to avoid race condition of having server send + * MapNotify to client before the frame gets mapped; this is bad because + * the client would think that the window has a chance of being viewable + * when it really isn't. + */ + XGrabServer (dpy); + if (Tmp_win->icon_w) + XUnmapWindow(dpy, Tmp_win->icon_w); + if (Tmp_win->title_w) + XMapSubwindows(dpy, Tmp_win->title_w); + XMapSubwindows(dpy, Tmp_win->frame); + if (Scr->Focus != Tmp_win && Tmp_win->hilite_w) + XUnmapWindow(dpy, Tmp_win->hilite_w); + + XMapWindow(dpy, Tmp_win->frame); + XUngrabServer (dpy); + XFlush (dpy); + Tmp_win->mapped = TRUE; + Tmp_win->icon = FALSE; + Tmp_win->icon_on = FALSE; +} + + + +/** + * UnmapNotify event handler + */ +void +HandleUnmapNotify() +{ + int dstx, dsty; + Window dumwin; + + /* + * The July 27, 1988 ICCCM spec states that a client wishing to switch + * to WithdrawnState should send a synthetic UnmapNotify with the + * event field set to (pseudo-)root, in case the window is already + * unmapped (which is the case for twm for IconicState). Unfortunately, + * we looked for the TwmContext using that field, so try the window + * field also. + */ + if (Tmp_win == NULL) + { + Event.xany.window = Event.xunmap.window; + if (XFindContext(dpy, Event.xany.window, + TwmContext, (caddr_t *)&Tmp_win) == XCNOENT) + Tmp_win = NULL; + } + + if (Tmp_win == NULL || (!Tmp_win->mapped && !Tmp_win->icon)) + return; + + /* + * The program may have unmapped the client window, from either + * NormalState or IconicState. Handle the transition to WithdrawnState. + * + * We need to reparent the window back to the root (so that twm exiting + * won't cause it to get mapped) and then throw away all state (pretend + * that we've received a DestroyNotify). + */ + + XGrabServer (dpy); + if (XTranslateCoordinates (dpy, Event.xunmap.window, Tmp_win->attr.root, + 0, 0, &dstx, &dsty, &dumwin)) { + XEvent ev; + Bool reparented = XCheckTypedWindowEvent (dpy, Event.xunmap.window, + ReparentNotify, &ev); + SetMapStateProp (Tmp_win, WithdrawnState); + if (reparented) { + if (Tmp_win->old_bw) XSetWindowBorderWidth (dpy, + Event.xunmap.window, + Tmp_win->old_bw); + if (Tmp_win->wmhints && (Tmp_win->wmhints->flags & IconWindowHint)) + XUnmapWindow (dpy, Tmp_win->wmhints->icon_window); + } else { + XReparentWindow (dpy, Event.xunmap.window, Tmp_win->attr.root, + dstx, dsty); + RestoreWithdrawnLocation (Tmp_win); + } + XRemoveFromSaveSet (dpy, Event.xunmap.window); + XSelectInput (dpy, Event.xunmap.window, NoEventMask); + HandleDestroyNotify (); /* do not need to mash event before */ + } /* else window no longer exists and we'll get a destroy notify */ + XUngrabServer (dpy); + XFlush (dpy); +} + + + +/** + * MotionNotify event handler + */ +void +HandleMotionNotify() +{ + if (ResizeWindow != (Window) 0) + { + XQueryPointer( dpy, Event.xany.window, + &(Event.xmotion.root), &JunkChild, + &(Event.xmotion.x_root), &(Event.xmotion.y_root), + &(Event.xmotion.x), &(Event.xmotion.y), + &JunkMask); + + /* Set WindowMoved appropriately so that f.deltastop will + work with resize as well as move. */ + if (abs (Event.xmotion.x - ResizeOrigX) >= Scr->MoveDelta + || abs (Event.xmotion.y - ResizeOrigY) >= Scr->MoveDelta) + WindowMoved = TRUE; + + XFindContext(dpy, ResizeWindow, TwmContext, (caddr_t *)&Tmp_win); + DoResize(Event.xmotion.x_root, Event.xmotion.y_root, Tmp_win); + } +} + + + +/** + * ButtonRelease event handler + */ +void +HandleButtonRelease() +{ + int xl, xr, yt, yb, w, h; + unsigned mask; + + if (InfoLines) /* delete info box on 2nd button release */ + if (Context == C_IDENTIFY) { + XUnmapWindow(dpy, Scr->InfoWindow); + InfoLines = 0; + Context = C_NO_CONTEXT; + } + + if (DragWindow != None) + { + MoveOutline(Scr->Root, 0, 0, 0, 0, 0, 0); + + XFindContext(dpy, DragWindow, TwmContext, (caddr_t *)&Tmp_win); + if (DragWindow == Tmp_win->frame) + { + xl = Event.xbutton.x_root - DragX - Tmp_win->frame_bw; + yt = Event.xbutton.y_root - DragY - Tmp_win->frame_bw; + w = DragWidth + 2 * Tmp_win->frame_bw; + h = DragHeight + 2 * Tmp_win->frame_bw; + } + else + { + xl = Event.xbutton.x_root - DragX - Scr->IconBorderWidth; + yt = Event.xbutton.y_root - DragY - Scr->IconBorderWidth; + w = DragWidth + 2 * Scr->IconBorderWidth; + h = DragHeight + 2 * Scr->IconBorderWidth; + } + + if (ConstMove) + { + if (ConstMoveDir == MOVE_HORIZ) + yt = ConstMoveY; + + if (ConstMoveDir == MOVE_VERT) + xl = ConstMoveX; + + if (ConstMoveDir == MOVE_NONE) + { + yt = ConstMoveY; + xl = ConstMoveX; + } + } + + if (Scr->DontMoveOff && MoveFunction != F_FORCEMOVE) + { + xr = xl + w; + yb = yt + h; + + if (xl < 0) + xl = 0; + if (xr > Scr->MyDisplayWidth) + xl = Scr->MyDisplayWidth - w; + + if (yt < 0) + yt = 0; + if (yb > Scr->MyDisplayHeight) + yt = Scr->MyDisplayHeight - h; + } + + CurrentDragX = xl; + CurrentDragY = yt; + if (DragWindow == Tmp_win->frame) + SetupWindow (Tmp_win, xl, yt, + Tmp_win->frame_width, Tmp_win->frame_height, -1); + else + XMoveWindow (dpy, DragWindow, xl, yt); + + if (!Scr->NoRaiseMove && !Scr->OpaqueMove) /* opaque already did */ + XRaiseWindow(dpy, DragWindow); + + if (!Scr->OpaqueMove) + UninstallRootColormap(); + else + XSync(dpy, 0); + + if (Scr->NumAutoRaises) { + enter_flag = TRUE; + enter_win = NULL; + raise_win = ((DragWindow == Tmp_win->frame && !Scr->NoRaiseMove) + ? Tmp_win : NULL); + } + + DragWindow = (Window) 0; + ConstMove = FALSE; + } + + if (ResizeWindow != (Window) 0) + { + EndResize(); + } + + if (ActiveMenu != NULL && RootFunction == 0) + { + if (ActiveItem != NULL) + { + int func = ActiveItem->func; + Action = ActiveItem->action; + switch (func) { + case F_MOVE: + case F_FORCEMOVE: + ButtonPressed = -1; + break; + case F_WARPTOSCREEN: + XUngrabPointer(dpy, CurrentTime); + /* fall through */ + case F_CIRCLEUP: + case F_CIRCLEDOWN: + case F_REFRESH: + PopDownMenu(); + break; + default: + break; + } + ExecuteFunction(func, Action, + ButtonWindow ? ButtonWindow->frame : None, + ButtonWindow, &Event/*&ButtonEvent*/, Context, TRUE); + Context = C_NO_CONTEXT; + ButtonWindow = NULL; + + /* if we are not executing a defered command, then take down the + * menu + */ + if (RootFunction == 0) + { + PopDownMenu(); + } + } + else + PopDownMenu(); + } + + mask = (Button1Mask|Button2Mask|Button3Mask|Button4Mask|Button5Mask); + switch (Event.xbutton.button) + { + case Button1: mask &= ~Button1Mask; break; + case Button2: mask &= ~Button2Mask; break; + case Button3: mask &= ~Button3Mask; break; + case Button4: mask &= ~Button4Mask; break; + case Button5: mask &= ~Button5Mask; break; + } + + if (RootFunction != 0 || + ResizeWindow != None || + DragWindow != None) + ButtonPressed = -1; + + if (RootFunction == 0 && + (Event.xbutton.state & mask) == 0 && + DragWindow == None && + ResizeWindow == None) + { + XUngrabPointer(dpy, CurrentTime); + XUngrabServer(dpy); + XFlush(dpy); + EventHandler[EnterNotify] = HandleEnterNotify; + EventHandler[LeaveNotify] = HandleLeaveNotify; + ButtonPressed = -1; + if (DownIconManager) + { + DownIconManager->down = FALSE; + if (Scr->Highlight) DrawIconManagerBorder(DownIconManager); + DownIconManager = NULL; + } + Cancel = FALSE; + } +} + + + +/** + * + * \param menu menu to pop up + * \param w invoking window, or None + */ +static void +do_menu (MenuRoot *menu, Window w) +{ + int x = Event.xbutton.x_root; + int y = Event.xbutton.y_root; + Bool center; + + if (!Scr->NoGrabServer) + XGrabServer(dpy); + if (w) { + int h = Scr->TBInfo.width - Scr->TBInfo.border; + Window child; + + (void) XTranslateCoordinates (dpy, w, Scr->Root, 0, h, &x, &y, &child); + center = False; + } else { + center = True; + } + if (PopUpMenu (menu, x, y, center)) { + UpdateMenu(); + } else { + Bell(XkbBI_MinorError,0,w); + } +} + + + +/** + * ButtonPress event handler + */ +void +HandleButtonPress() +{ + unsigned int modifier; + Cursor cur; + + /* too much code relies on this assumption */ + if (Event.xbutton.button > MAX_BUTTONS) + return; + + /* pop down the menu, if any */ + if (ActiveMenu != NULL) + PopDownMenu(); + + XSync(dpy, 0); /* XXX - remove? */ + + if (ButtonPressed != -1 && !InfoLines) /* want menus if we have info box */ + { + /* we got another butt press in addition to one still held + * down, we need to cancel the operation we were doing + */ + Cancel = TRUE; + CurrentDragX = origDragX; + CurrentDragY = origDragY; + if (!menuFromFrameOrWindowOrTitlebar) { + if (Scr->OpaqueMove && DragWindow != None) { + XMoveWindow (dpy, DragWindow, origDragX, origDragY); + } else { + MoveOutline(Scr->Root, 0, 0, 0, 0, 0, 0); + } + } + XUnmapWindow(dpy, Scr->SizeWindow); + if (!Scr->OpaqueMove) + UninstallRootColormap(); + ResizeWindow = None; + DragWindow = None; + cur = LeftButt; + if (Event.xbutton.button == Button2) + cur = MiddleButt; + else if (Event.xbutton.button >= Button3) + cur = RightButt; + + XGrabPointer(dpy, Scr->Root, True, + ButtonReleaseMask | ButtonPressMask, + GrabModeAsync, GrabModeAsync, + Scr->Root, cur, CurrentTime); + + return; + } + else + ButtonPressed = Event.xbutton.button; + + if (ResizeWindow != None || + DragWindow != None || + ActiveMenu != NULL) + return; + + /* check the title bar buttons */ + if (Tmp_win && Tmp_win->title_height && Tmp_win->titlebuttons) + { + register int i; + register TBWindow *tbw; + int nb = Scr->TBInfo.nleft + Scr->TBInfo.nright; + + for (i = 0, tbw = Tmp_win->titlebuttons; i < nb; i++, tbw++) { + if (Event.xany.window == tbw->window) { + if (tbw->info->func == F_MENU) { + Context = C_TITLE; + ButtonEvent = Event; + ButtonWindow = Tmp_win; + do_menu (tbw->info->menuroot, tbw->window); + } else { + ExecuteFunction (tbw->info->func, tbw->info->action, + Event.xany.window, Tmp_win, &Event, + C_TITLE, FALSE); + } + return; + } + } + } + + Context = C_NO_CONTEXT; + + if (Event.xany.window == Scr->InfoWindow) + Context = C_IDENTIFY; + + if (Event.xany.window == Scr->Root) + Context = C_ROOT; + if (Tmp_win) + { + if (Tmp_win->list && RootFunction != 0 && + (Event.xany.window == Tmp_win->list->w || + Event.xany.window == Tmp_win->list->icon)) + { + Tmp_win = Tmp_win->list->iconmgr->twm_win; + XTranslateCoordinates(dpy, Event.xany.window, Tmp_win->w, + Event.xbutton.x, Event.xbutton.y, + &JunkX, &JunkY, &JunkChild); + + Event.xbutton.x = JunkX; + Event.xbutton.y = JunkY - Tmp_win->title_height; + Event.xany.window = Tmp_win->w; + Context = C_WINDOW; + } + else if (Event.xany.window == Tmp_win->title_w) + { + Context = C_TITLE; + } + else if (Event.xany.window == Tmp_win->w) + { + printf("ERROR! ERROR! ERROR! YOU SHOULD NOT BE HERE!!!\n"); + Context = C_WINDOW; + } + else if (Event.xany.window == Tmp_win->icon_w) + { + Context = C_ICON; + } + else if (Event.xany.window == Tmp_win->frame) + { + /* since we now place a button grab on the frame instead + * of the window, (see GrabButtons() in add_window.c), we + * need to figure out where the pointer exactly is before + * assigning Context. If the pointer is on the application + * window we will change the event structure to look as if + * it came from the application window. + */ + if (Event.xbutton.subwindow == Tmp_win->w) { + Event.xbutton.window = Tmp_win->w; + Event.xbutton.y -= Tmp_win->title_height; +/***** + Event.xbutton.x -= Tmp_win->frame_bw; +*****/ + Context = C_WINDOW; + } + else Context = C_FRAME; + } + else if (Tmp_win->list && + (Event.xany.window == Tmp_win->list->w || + Event.xany.window == Tmp_win->list->icon)) + { + Tmp_win->list->down = TRUE; + if (Scr->Highlight) DrawIconManagerBorder(Tmp_win->list); + DownIconManager = Tmp_win->list; + Context = C_ICONMGR; + } + } + + /* this section of code checks to see if we were in the middle of + * a command executed from a menu + */ + if (RootFunction != 0) + { + if (Event.xany.window == Scr->Root) + { + /* if the window was the Root, we don't know for sure it + * it was the root. We must check to see if it happened to be + * inside of a client that was getting button press events. + */ + XTranslateCoordinates(dpy, Scr->Root, Scr->Root, + Event.xbutton.x, + Event.xbutton.y, + &JunkX, &JunkY, &Event.xany.window); + + if (Event.xany.window == 0 || + (XFindContext(dpy, Event.xany.window, TwmContext, + (caddr_t *)&Tmp_win) == XCNOENT)) + { + RootFunction = 0; + Bell(XkbBI_MinorError,0,Event.xany.window); + return; + } + + XTranslateCoordinates(dpy, Scr->Root, Event.xany.window, + Event.xbutton.x, + Event.xbutton.y, + &JunkX, &JunkY, &JunkChild); + + Event.xbutton.x = JunkX; + Event.xbutton.y = JunkY; + Context = C_WINDOW; + } + + /* make sure we are not trying to move an identify window */ + if (Event.xany.window != Scr->InfoWindow) + ExecuteFunction(RootFunction, Action, Event.xany.window, + Tmp_win, &Event, Context, FALSE); + + RootFunction = 0; + return; + } + + ButtonEvent = Event; + ButtonWindow = Tmp_win; + + /* if we get to here, we have to execute a function or pop up a + * menu + */ + modifier = (Event.xbutton.state & mods_used); + + if (Context == C_NO_CONTEXT) + return; + + RootFunction = 0; + if (Scr->Mouse[Event.xbutton.button][Context][modifier].func == F_MENU) + { + do_menu (Scr->Mouse[Event.xbutton.button][Context][modifier].menu, + (Window) None); + } + else if (Scr->Mouse[Event.xbutton.button][Context][modifier].func != 0) + { + Action = Scr->Mouse[Event.xbutton.button][Context][modifier].item ? + Scr->Mouse[Event.xbutton.button][Context][modifier].item->action : NULL; + ExecuteFunction(Scr->Mouse[Event.xbutton.button][Context][modifier].func, + Action, Event.xany.window, Tmp_win, &Event, Context, FALSE); + } + else if (Scr->DefaultFunction.func != 0) + { + if (Scr->DefaultFunction.func == F_MENU) + { + do_menu (Scr->DefaultFunction.menu, (Window) None); + } + else + { + Action = Scr->DefaultFunction.item ? + Scr->DefaultFunction.item->action : NULL; + ExecuteFunction(Scr->DefaultFunction.func, Action, + Event.xany.window, Tmp_win, &Event, Context, FALSE); + } + } +} + + + +/** \fn HENQueueScanner + * EnterNotify event q scanner. + * + * Looks at the queued events and determines if any matching + * LeaveNotify events or EnterEvents deriving from the + * termination of a grab are behind this event to allow + * skipping of unnecessary processing. + */ +typedef struct HENScanArgs { + Window w; /**< Window we are currently entering */ + Bool leaves; /**< Any LeaveNotifies found for this window */ + Bool inferior; /**< Was NotifyInferior the mode for LeaveNotify */ + Bool enters; /**< Any EnterNotify events with NotifyUngrab */ +} HENScanArgs; + +static Bool +HENQueueScanner(Display *dpy, XEvent *ev, char *args) +{ + if (ev->type == LeaveNotify) { + if (ev->xcrossing.window == ((HENScanArgs *) args)->w && + ev->xcrossing.mode == NotifyNormal) { + ((HENScanArgs *) args)->leaves = True; + /* + * Only the last event found matters for the Inferior field. + */ + ((HENScanArgs *) args)->inferior = + (ev->xcrossing.detail == NotifyInferior); + } + } else if (ev->type == EnterNotify) { + if (ev->xcrossing.mode == NotifyUngrab) + ((HENScanArgs *) args)->enters = True; + } + + return (False); +} + + + +/** + * EnterNotify event handler + */ +void +HandleEnterNotify() +{ + MenuRoot *mr; + XEnterWindowEvent *ewp = &Event.xcrossing; + HENScanArgs scanArgs; + XEvent dummy; + + /* + * Save the id of the window entered. This will be used to remove + * border highlight on entering the next application window. + */ + if (UnHighLight_win && ewp->window != UnHighLight_win->w) { + SetBorder (UnHighLight_win, False); /* application window */ + if (UnHighLight_win->list) /* in the icon box */ + NotActiveIconManager(UnHighLight_win->list); + } + if (ewp->window == Scr->Root) + UnHighLight_win = NULL; + else if (Tmp_win) + UnHighLight_win = Tmp_win; + + /* + * if we aren't in the middle of menu processing + */ + if (!ActiveMenu) { + /* + * We're not interested in pseudo Enter/Leave events generated + * from grab initiations. + */ + if (ewp->mode == NotifyGrab) + return; + + /* + * Scan for Leave and Enter Notify events to see if we can avoid some + * unnecessary processing. + */ + scanArgs.w = ewp->window; + scanArgs.leaves = scanArgs.enters = False; + (void) XCheckIfEvent(dpy, &dummy, HENQueueScanner, (char *) &scanArgs); + + /* + * if entering root window, restore twm default colormap so that + * titlebars are legible + */ + if (ewp->window == Scr->Root) { + if (!scanArgs.leaves && !scanArgs.enters) + InstallWindowColormaps(EnterNotify, &Scr->TwmRoot); + return; + } + + /* + * if we have an event for a specific one of our windows + */ + if (Tmp_win) { + /* + * If currently in PointerRoot mode (indicated by FocusRoot), then + * focus on this window + */ + if (Scr->FocusRoot && (!scanArgs.leaves || scanArgs.inferior)) { + if (Tmp_win->list) ActiveIconManager(Tmp_win->list); + if (Tmp_win->mapped) { + /* + * unhighlight old focus window + */ + if (Scr->Focus && + Scr->Focus != Tmp_win && Tmp_win->hilite_w) + XUnmapWindow(dpy, Scr->Focus->hilite_w); + + /* + * If entering the frame or the icon manager, then do + * "window activation things": + * + * 1. turn on highlight window (if any) + * 2. install frame colormap + * 3. set frame and highlight window (if any) border + * 4. focus on client window to forward typing + * 4a. same as 4 but for icon mgr w/with NoTitlebar on. + * 5. send WM_TAKE_FOCUS if requested + */ + if (ewp->window == Tmp_win->frame || + (Tmp_win->list && ewp->window == Tmp_win->list->w)) { + if (Tmp_win->hilite_w) /* 1 */ + XMapWindow (dpy, Tmp_win->hilite_w); + if (!scanArgs.leaves && !scanArgs.enters) + InstallWindowColormaps (EnterNotify, /* 2 */ + &Scr->TwmRoot); + SetBorder (Tmp_win, True); /* 3 */ + if (Tmp_win->title_w && Scr->TitleFocus && /* 4 */ + Tmp_win->wmhints && Tmp_win->wmhints->input) + SetFocus (Tmp_win, ewp->time); + if (Scr->NoTitlebar && Scr->TitleFocus && /*4a */ + Tmp_win->wmhints && Tmp_win->wmhints->input) + SetFocus (Tmp_win, ewp->time); + if (Tmp_win->protocols & DoesWmTakeFocus) /* 5 */ + SendTakeFocusMessage (Tmp_win, ewp->time); + Scr->Focus = Tmp_win; + } else if (ewp->window == Tmp_win->w) { + /* + * If we are entering the application window, install + * its colormap(s). + */ + if (!scanArgs.leaves || scanArgs.inferior) + InstallWindowColormaps(EnterNotify, Tmp_win); + } + } /* end if Tmp_win->mapped */ + if (Tmp_win->wmhints != NULL && + ewp->window == Tmp_win->wmhints->icon_window && + (!scanArgs.leaves || scanArgs.inferior)) + InstallWindowColormaps(EnterNotify, Tmp_win); + } /* end if FocusRoot */ + /* + * If this window is to be autoraised, mark it so + */ + if (Tmp_win->auto_raise) { + enter_win = Tmp_win; + if (enter_flag == FALSE) AutoRaiseWindow (Tmp_win); + } else if (enter_flag && raise_win == Tmp_win) + enter_win = Tmp_win; + /* + * set ring leader + */ + if (Tmp_win->ring.next && (!enter_flag || raise_win == enter_win)) + Scr->RingLeader = Tmp_win; + XSync (dpy, 0); + return; + } /* end if Tmp_win */ + } /* end if !ActiveMenu */ + + /* + * Find the menu that we are dealing with now; punt if unknown + */ + if (XFindContext (dpy, ewp->window, MenuContext, (caddr_t *)&mr) != XCSUCCESS) return; + + mr->entered = TRUE; + if (ActiveMenu && mr == ActiveMenu->prev && RootFunction == 0) { + if (Scr->Shadow) XUnmapWindow (dpy, ActiveMenu->shadow); + XUnmapWindow (dpy, ActiveMenu->w); + ActiveMenu->mapped = UNMAPPED; + UninstallRootColormap (); + if (ActiveItem) { + ActiveItem->state = 0; + PaintEntry (ActiveMenu, ActiveItem, False); + } + ActiveItem = NULL; + ActiveMenu = mr; + MenuDepth--; + } + return; +} + + + +/** \fn HLNQueueScanner + * LeaveNotify event q scanner. + * + * Looks at the queued events and determines if any + * EnterNotify events are behind this event to allow + * skipping of unnecessary processing. + */ + +typedef struct HLNScanArgs { + Window w; /**< The window getting the LeaveNotify */ + Bool enters; /**< Any EnterNotify event at all */ + Bool matches; /**< Any matching EnterNotify events */ +} HLNScanArgs; + +static Bool +HLNQueueScanner(Display *dpy, XEvent *ev, char *args) +{ + if (ev->type == EnterNotify && ev->xcrossing.mode != NotifyGrab) { + ((HLNScanArgs *) args)->enters = True; + if (ev->xcrossing.window == ((HLNScanArgs *) args)->w) + ((HLNScanArgs *) args)->matches = True; + } + + return (False); +} + + + +/** + * LeaveNotify event handler + */ +void +HandleLeaveNotify() +{ + HLNScanArgs scanArgs; + XEvent dummy; + + if (Tmp_win != NULL) + { + Bool inicon; + + /* + * We're not interested in pseudo Enter/Leave events generated + * from grab initiations and terminations. + */ + if (Event.xcrossing.mode != NotifyNormal) + return; + + inicon = (Tmp_win->list && + Tmp_win->list->w == Event.xcrossing.window); + + if (Scr->RingLeader && Scr->RingLeader == Tmp_win && + (Event.xcrossing.detail != NotifyInferior && + Event.xcrossing.window != Tmp_win->w)) { + if (!inicon) { + if (Tmp_win->mapped) { + Tmp_win->ring.cursor_valid = False; + } else { + Tmp_win->ring.cursor_valid = True; + Tmp_win->ring.curs_x = (Event.xcrossing.x_root - + Tmp_win->frame_x); + Tmp_win->ring.curs_y = (Event.xcrossing.y_root - + Tmp_win->frame_y); + } + } + Scr->RingLeader = (TwmWindow *) NULL; + } + if (Scr->FocusRoot) { + + if (Event.xcrossing.detail != NotifyInferior) { + + /* + * Scan for EnterNotify events to see if we can avoid some + * unnecessary processing. + */ + scanArgs.w = Event.xcrossing.window; + scanArgs.enters = scanArgs.matches = False; + (void) XCheckIfEvent(dpy, &dummy, HLNQueueScanner, + (char *) &scanArgs); + + if ((Event.xcrossing.window == Tmp_win->frame && + !scanArgs.matches) || inicon) { + if (Tmp_win->list) NotActiveIconManager(Tmp_win->list); + if (Tmp_win->hilite_w) + XUnmapWindow (dpy, Tmp_win->hilite_w); + SetBorder (Tmp_win, False); + if (Scr->TitleFocus || + Tmp_win->protocols & DoesWmTakeFocus) + SetFocus ((TwmWindow *) NULL, Event.xcrossing.time); + Scr->Focus = NULL; + } else if (Event.xcrossing.window == Tmp_win->w && + !scanArgs.enters) { + InstallWindowColormaps (LeaveNotify, &Scr->TwmRoot); + } + } + } + XSync (dpy, 0); + return; + } +} + + + +/** + * HandleConfigureRequest - ConfigureRequest event handler + */ +void +HandleConfigureRequest() +{ + XWindowChanges xwc; + unsigned long xwcm; + int x, y, width, height, bw; + int gravx, gravy; + XConfigureRequestEvent *cre = &Event.xconfigurerequest; + +#ifdef DEBUG_EVENTS + fprintf(stderr, "ConfigureRequest\n"); + if (cre->value_mask & CWX) + fprintf(stderr, " x = %d\n", cre->x); + if (cre->value_mask & CWY) + fprintf(stderr, " y = %d\n", cre->y); + if (cre->value_mask & CWWidth) + fprintf(stderr, " width = %d\n", cre->width); + if (cre->value_mask & CWHeight) + fprintf(stderr, " height = %d\n", cre->height); + if (cre->value_mask & CWSibling) + fprintf(stderr, " above = 0x%x\n", cre->above); + if (cre->value_mask & CWStackMode) + fprintf(stderr, " stack = %d\n", cre->detail); +#endif + + /* + * Event.xany.window is Event.xconfigurerequest.parent, so Tmp_win will + * be wrong + */ + Event.xany.window = cre->window; /* mash parent field */ + if (XFindContext (dpy, cre->window, TwmContext, (caddr_t *) &Tmp_win) == + XCNOENT) + Tmp_win = NULL; + + + /* + * According to the July 27, 1988 ICCCM draft, we should ignore size and + * position fields in the WM_NORMAL_HINTS property when we map a window. + * Instead, we'll read the current geometry. Therefore, we should respond + * to configuration requests for windows which have never been mapped. + */ + if (!Tmp_win || Tmp_win->icon_w == cre->window) { + xwcm = cre->value_mask & + (CWX | CWY | CWWidth | CWHeight | CWBorderWidth); + xwc.x = cre->x; + xwc.y = cre->y; + xwc.width = cre->width; + xwc.height = cre->height; + xwc.border_width = cre->border_width; + XConfigureWindow(dpy, Event.xany.window, xwcm, &xwc); + return; + } + + if ((cre->value_mask & CWStackMode) && Tmp_win->stackmode) { + TwmWindow *otherwin; + + xwc.sibling = (((cre->value_mask & CWSibling) && + (XFindContext (dpy, cre->above, TwmContext, + (caddr_t *) &otherwin) == XCSUCCESS)) + ? otherwin->frame : cre->above); + xwc.stack_mode = cre->detail; + XConfigureWindow (dpy, Tmp_win->frame, + cre->value_mask & (CWSibling | CWStackMode), &xwc); + } + + + /* Don't modify frame_XXX fields before calling SetupWindow! */ + x = Tmp_win->frame_x; + y = Tmp_win->frame_y; + width = Tmp_win->frame_width; + height = Tmp_win->frame_height; + bw = Tmp_win->frame_bw; + + /* + * Section 4.1.5 of the ICCCM states that the (x,y) coordinates in the + * configure request are for the upper-left outer corner of the window. + * This means that we need to adjust for the additional title height as + * well as for any border width changes that we decide to allow. The + * current window gravity is to be used in computing the adjustments, just + * as when initially locating the window. Note that if we do decide to + * allow border width changes, we will need to send the synthetic + * ConfigureNotify event. + */ + GetGravityOffsets (Tmp_win, &gravx, &gravy); + + if (cre->value_mask & CWBorderWidth) { + int bwdelta = cre->border_width - Tmp_win->old_bw; /* posit growth */ + if (bwdelta && Scr->ClientBorderWidth) { /* if change allowed */ + x += gravx * bwdelta; /* change default values only */ + y += gravy * bwdelta; /* ditto */ + bw = cre->border_width; + if (Tmp_win->title_height) height += bwdelta; + x += (gravx < 0) ? bwdelta : -bwdelta; + y += (gravy < 0) ? bwdelta : -bwdelta; + } + Tmp_win->old_bw = cre->border_width; /* for restoring */ + } + + if (cre->value_mask & CWX) { /* override even if border change */ + x = cre->x - bw; + } + if (cre->value_mask & CWY) { + y = cre->y - ((gravy < 0) ? 0 : Tmp_win->title_height) - bw; + } + + if (cre->value_mask & CWWidth) { + width = cre->width; + } + if (cre->value_mask & CWHeight) { + height = cre->height + Tmp_win->title_height; + } + + if (width != Tmp_win->frame_width || height != Tmp_win->frame_height) + Tmp_win->zoomed = ZOOM_NONE; + + /* + * SetupWindow (x,y) are the location of the upper-left outer corner and + * are passed directly to XMoveResizeWindow (frame). The (width,height) + * are the inner size of the frame. The inner width is the same as the + * requested client window width; the inner height is the same as the + * requested client window height plus any title bar slop. + */ + SetupWindow (Tmp_win, x, y, width, height, bw); +} + + + +/** + * shape notification event handler + */ +void +HandleShapeNotify () +{ + XShapeEvent *sev = (XShapeEvent *) &Event; + + if (Tmp_win == NULL) + return; + if (sev->kind != ShapeBounding) + return; + if (!Tmp_win->wShaped && sev->shaped) { + XShapeCombineMask (dpy, Tmp_win->frame, ShapeClip, 0, 0, None, + ShapeSet); + } + Tmp_win->wShaped = sev->shaped; + SetFrameShape (Tmp_win); +} + + + +/** + * unknown event handler + */ +void +HandleUnknown() +{ +#ifdef DEBUG_EVENTS + fprintf(stderr, "type = %d\n", Event.type); +#endif +} + + + +/** + * checks to see if the window is a transient. + * + * \return TRUE if window is a transient + * \return FALSE if window is not a transient + * + * \param w the window to check + */ +int +Transient(Window w, Window *propw) +{ + return (XGetTransientForHint(dpy, w, propw)); +} + + + +/** + * get ScreenInfo struct associated with a given window + * + * \return ScreenInfo struct + * \param w the window + */ +ScreenInfo * +FindScreenInfo(w) + Window w; +{ + XWindowAttributes attr; + int scrnum; + + attr.screen = NULL; + if (XGetWindowAttributes(dpy, w, &attr)) { + for (scrnum = 0; scrnum < NumScreens; scrnum++) { + if (ScreenList[scrnum] != NULL && + (ScreenOfDisplay(dpy, ScreenList[scrnum]->screen) == + attr.screen)) + return ScreenList[scrnum]; + } + } + + return NULL; +} + + + +static void flush_expose (w) + Window w; +{ + XEvent dummy; + + /* SUPPRESS 530 */ + while (XCheckTypedWindowEvent (dpy, w, Expose, &dummy)) ; +} + + + +/** + * install the colormaps for one twm window. + * + * \param type type of event that caused the installation + * \param tmp for a subset of event types, the address of the + * window structure, whose colormaps are to be installed. + */ +void +InstallWindowColormaps (int type, TwmWindow *tmp) +{ + int i, j, n, number_cwins, state; + ColormapWindow **cwins, *cwin, **maxcwin = NULL; + TwmColormap *cmap; + char *row, *scoreboard; + + switch (type) { + case EnterNotify: + case LeaveNotify: + case DestroyNotify: + default: + /* Save the colormap to be loaded for when force loading of + * root colormap(s) ends. + */ + Scr->cmapInfo.pushed_window = tmp; + /* Don't load any new colormap if root colormap(s) has been + * force loaded. + */ + if (Scr->cmapInfo.root_pushes) + return; + /* Don't reload the currend window colormap list. + */ + if (Scr->cmapInfo.cmaps == &tmp->cmaps) + return; + if (Scr->cmapInfo.cmaps) + for (i = Scr->cmapInfo.cmaps->number_cwins, + cwins = Scr->cmapInfo.cmaps->cwins; i-- > 0; cwins++) + (*cwins)->colormap->state &= ~CM_INSTALLABLE; + Scr->cmapInfo.cmaps = &tmp->cmaps; + break; + + case PropertyNotify: + case VisibilityNotify: + case ColormapNotify: + break; + } + + number_cwins = Scr->cmapInfo.cmaps->number_cwins; + cwins = Scr->cmapInfo.cmaps->cwins; + scoreboard = Scr->cmapInfo.cmaps->scoreboard; + + ColortableThrashing = FALSE; /* in case installation aborted */ + + state = CM_INSTALLED; + + for (i = n = 0; i < number_cwins; i++) { + cwin = cwins[i]; + cmap = cwin->colormap; + cmap->state |= CM_INSTALLABLE; + cmap->state &= ~CM_INSTALL; + cmap->w = cwin->w; + } + for (i = n = 0; i < number_cwins; i++) { + cwin = cwins[i]; + cmap = cwin->colormap; + if (cwin->visibility != VisibilityFullyObscured && + n < Scr->cmapInfo.maxCmaps) { + row = scoreboard + (i*(i-1)/2); + for (j = 0; j < i; j++) + if (row[j] && (cwins[j]->colormap->state & CM_INSTALL)) + break; + if (j != i) + continue; + n++; + maxcwin = &cwins[i]; + state &= (cmap->state & CM_INSTALLED); + cmap->state |= CM_INSTALL; + } + } + + Scr->cmapInfo.first_req = NextRequest(dpy); + + for ( ; n > 0 && maxcwin >= cwins; maxcwin--) { + cmap = (*maxcwin)->colormap; + if (cmap->state & CM_INSTALL) { + cmap->state &= ~CM_INSTALL; + if (!(state & CM_INSTALLED)) { + cmap->install_req = NextRequest(dpy); + XInstallColormap(dpy, cmap->c); + } + cmap->state |= CM_INSTALLED; + n--; + } + } +} + + + +/** \fn InstallRootColormap + * \fn UninstallRootColormap + * + * Force (un)loads root colormap(s) + * + * These matching routines provide a mechanism to insure that + * the root colormap(s) is installed during operations like + * rubber banding or menu display that require colors from + * that colormap. Calls may be nested arbitrarily deeply, + * as long as there is one UninstallRootColormap call per + * InstallRootColormap call. + * + * The final UninstallRootColormap will cause the colormap list + * which would otherwise have be loaded to be loaded, unless + * Enter or Leave Notify events are queued, indicating some + * other colormap list would potentially be loaded anyway. + */ +void +InstallRootColormap() +{ + TwmWindow *tmp; + if (Scr->cmapInfo.root_pushes == 0) { + /* + * The saving and restoring of cmapInfo.pushed_window here + * is a slimy way to remember the actual pushed list and + * not that of the root window. + */ + tmp = Scr->cmapInfo.pushed_window; + InstallWindowColormaps(0, &Scr->TwmRoot); + Scr->cmapInfo.pushed_window = tmp; + } + Scr->cmapInfo.root_pushes++; +} + + + +static Bool +UninstallRootColormapQScanner(Display *dpy, XEvent *ev, char *args) +{ + if (!*args) { + if (ev->type == EnterNotify) { + if (ev->xcrossing.mode != NotifyGrab) + *args = 1; + } else if (ev->type == LeaveNotify) { + if (ev->xcrossing.mode == NotifyNormal) + + *args = 1; + } + } + return (False); +} + + +void +UninstallRootColormap() +{ + char args; + XEvent dummy; + + if (Scr->cmapInfo.root_pushes) + Scr->cmapInfo.root_pushes--; + + if (!Scr->cmapInfo.root_pushes) { + /* + * If we have subsequent Enter or Leave Notify events, + * we can skip the reload of pushed colormaps. + */ + XSync (dpy, 0); + args = 0; + (void) XCheckIfEvent(dpy, &dummy, UninstallRootColormapQScanner, &args); + + if (!args) + InstallWindowColormaps(0, Scr->cmapInfo.pushed_window); + } +} + +#ifdef TRACE +void +dumpevent (XEvent *e) +{ + char *name = NULL; + + switch (e->type) { + case KeyPress: name = "KeyPress"; break; + case KeyRelease: name = "KeyRelease"; break; + case ButtonPress: name = "ButtonPress"; break; + case ButtonRelease: name = "ButtonRelease"; break; + case MotionNotify: name = "MotionNotify"; break; + case EnterNotify: name = "EnterNotify"; break; + case LeaveNotify: name = "LeaveNotify"; break; + case FocusIn: name = "FocusIn"; break; + case FocusOut: name = "FocusOut"; break; + case KeymapNotify: name = "KeymapNotify"; break; + case Expose: name = "Expose"; break; + case GraphicsExpose: name = "GraphicsExpose"; break; + case NoExpose: name = "NoExpose"; break; + case VisibilityNotify: name = "VisibilityNotify"; break; + case CreateNotify: name = "CreateNotify"; break; + case DestroyNotify: name = "DestroyNotify"; break; + case UnmapNotify: name = "UnmapNotify"; break; + case MapNotify: name = "MapNotify"; break; + case MapRequest: name = "MapRequest"; break; + case ReparentNotify: name = "ReparentNotify"; break; + case ConfigureNotify: name = "ConfigureNotify"; break; + case ConfigureRequest: name = "ConfigureRequest"; break; + case GravityNotify: name = "GravityNotify"; break; + case ResizeRequest: name = "ResizeRequest"; break; + case CirculateNotify: name = "CirculateNotify"; break; + case CirculateRequest: name = "CirculateRequest"; break; + case PropertyNotify: name = "PropertyNotify"; break; + case SelectionClear: name = "SelectionClear"; break; + case SelectionRequest: name = "SelectionRequest"; break; + case SelectionNotify: name = "SelectionNotify"; break; + case ColormapNotify: name = "ColormapNotify"; break; + case ClientMessage: name = "ClientMessage"; break; + case MappingNotify: name = "MappingNotify"; break; + } + + if (name) { + printf ("event: %s, %d remaining\n", name, QLength(dpy)); + } else { + printf ("unknown event %d, %d remaining\n", e->type, QLength(dpy)); + } +} +#endif /* TRACE */ + diff --git a/app/twm/src/events.h b/app/twm/src/events.h new file mode 100644 index 000000000..6bc941e82 --- /dev/null +++ b/app/twm/src/events.h @@ -0,0 +1,133 @@ +/*****************************************************************************/ +/* + +Copyright 1989, 1998 The Open Group + +Permission to use, copy, modify, distribute, and sell this software and its +documentation for any purpose is hereby granted without fee, provided that +the above copyright notice appear in all copies and that both that +copyright notice and this permission notice appear in supporting +documentation. + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the name of The Open Group shall not be +used in advertising or otherwise to promote the sale, use or other dealings +in this Software without prior written authorization from The Open Group. + +*/ +/** Copyright 1988 by Evans & Sutherland Computer Corporation, **/ +/** Salt Lake City, Utah **/ +/** Cambridge, Massachusetts **/ +/** **/ +/** All Rights Reserved **/ +/** **/ +/** Permission to use, copy, modify, and distribute this software and **/ +/** its documentation for any purpose and without fee is hereby **/ +/** granted, provided that the above copyright notice appear in all **/ +/** copies and that both that copyright notice and this permis- **/ +/** sion notice appear in supporting documentation, and that the **/ +/** name of Evans & Sutherland not be used in advertising **/ +/** in publicity pertaining to distribution of the software without **/ +/** specific, written prior permission. **/ +/** **/ +/** EVANS & SUTHERLAND DISCLAIMs ALL WARRANTIES WITH REGARD **/ +/** TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANT- **/ +/** ABILITY AND FITNESS, IN NO EVENT SHALL EVANS & SUTHERLAND **/ +/** BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAM- **/ +/** AGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA **/ +/** OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER **/ +/** TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE **/ +/** OR PERFORMANCE OF THIS SOFTWARE. **/ +/*****************************************************************************/ +/* $XFree86: xc/programs/twm/events.h,v 1.5 2001/08/27 21:11:39 dawes Exp $ */ + + +/*********************************************************************** + * + * $Xorg: events.h,v 1.4 2001/02/09 02:05:36 xorgcvs Exp $ + * + * twm event handler include file + * + * 17-Nov-87 Thomas E. LaStrange File created + * + ***********************************************************************/ + +#ifndef _EVENTS_ +#define _EVENTS_ + +#include "screen.h" +#include "twm.h" + +typedef void (*event_proc)(void); + +extern Time lastTimestamp; +#define LastTimestamp() lastTimestamp + +extern void AutoRaiseWindow ( TwmWindow *tmp ); +extern void SetRaiseWindow ( TwmWindow *tmp ); +extern void InitEvents ( void ); +extern Bool StashEventTime ( XEvent *ev ); +extern Window WindowOfEvent ( XEvent *e ); +extern Bool DispatchEvent2 ( void ); +extern Bool DispatchEvent ( void ); +extern void HandleEvents ( void ); +extern void HandleColormapNotify ( void ); +extern void HandleVisibilityNotify ( void ); +extern void HandleKeyPress ( void ); +extern void free_cwins ( TwmWindow *tmp ); +extern void HandlePropertyNotify ( void ); +extern void RedoIconName ( void ); +extern void HandleClientMessage ( void ); +extern void HandleExpose ( void ); +extern void HandleDestroyNotify ( void ); +extern void HandleCreateNotify ( void ); +extern void HandleMapRequest ( void ); +extern void SimulateMapRequest ( Window w ); +extern void HandleMapNotify ( void ); +extern void HandleUnmapNotify ( void ); +extern void HandleMotionNotify ( void ); +extern void HandleButtonRelease ( void ); +extern void HandleButtonPress ( void ); +extern void HandleEnterNotify ( void ); +extern void HandleLeaveNotify ( void ); +extern void HandleConfigureRequest ( void ); +extern void HandleShapeNotify ( void ); +extern void HandleUnknown ( void ); +extern int Transient ( Window w, Window *propw ); +extern ScreenInfo * FindScreenInfo ( Window w ); +extern void InstallWindowColormaps ( int type, TwmWindow *tmp ); +extern void InstallRootColormap ( void ); +extern void UninstallRootColormap ( void ); + +extern event_proc EventHandler[]; +extern Window DragWindow; +extern int origDragX; +extern int origDragY; +extern int DragX; +extern int DragY; +extern int DragWidth; +extern int DragHeight; +extern int CurrentDragX; +extern int CurrentDragY; + +extern int ButtonPressed; +extern int Cancel; + +extern int Context; + +extern XEvent Event; + +extern unsigned int mods_used; + +extern int MovedFromKeyPress; + +#endif /* _EVENTS_ */ diff --git a/app/twm/src/gc.c b/app/twm/src/gc.c new file mode 100644 index 000000000..65a94f514 --- /dev/null +++ b/app/twm/src/gc.c @@ -0,0 +1,115 @@ +/*****************************************************************************/ +/* + +Copyright 1989, 1998 The Open Group + +Permission to use, copy, modify, distribute, and sell this software and its +documentation for any purpose is hereby granted without fee, provided that +the above copyright notice appear in all copies and that both that +copyright notice and this permission notice appear in supporting +documentation. + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the name of The Open Group shall not be +used in advertising or otherwise to promote the sale, use or other dealings +in this Software without prior written authorization from The Open Group. + +*/ +/* Copyright 1988 by Evans & Sutherland Computer Corporation, */ +/* Salt Lake City, Utah */ +/* Cambridge, Massachusetts */ +/* */ +/* All Rights Reserved */ +/* */ +/* Permission to use, copy, modify, and distribute this software and */ +/* its documentation for any purpose and without fee is hereby */ +/* granted, provided that the above copyright notice appear in all */ +/* copies and that both that copyright notice and this permis- */ +/* sion notice appear in supporting documentation, and that the */ +/* name of Evans & Sutherland not be used in advertising */ +/* in publicity pertaining to distribution of the software without */ +/* specific, written prior permission. */ +/* */ +/* EVANS & SUTHERLAND DISCLAIMs ALL WARRANTIES WITH REGARD */ +/* TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANT- */ +/* ABILITY AND FITNESS, IN NO EVENT SHALL EVANS & SUTHERLAND */ +/* BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAM- */ +/* AGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA */ +/* OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER */ +/* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE */ +/* OR PERFORMANCE OF THIS SOFTWARE. */ +/*********************************************************************(*****/ +/* $XFree86: xc/programs/twm/gc.c,v 1.5 2001/01/17 23:45:06 dawes Exp $ */ + + +/********************************************************************** + * + * $Xorg: gc.c,v 1.4 2001/02/09 02:05:36 xorgcvs Exp $ + * + * Open the fonts and create the GCs + * + * 31-Mar-88 Tom LaStrange Initial Version. + * + **********************************************************************/ + +#include +#include "twm.h" +#include "util.h" +#include "screen.h" +#include "gc.h" + +/** \fn CreateGCs + * open fonts and create all the needed GC's. I only + * want to do this once, hence the first_time flag. + */ +void +CreateGCs() +{ + static ScreenInfo *prevScr = NULL; + XGCValues gcv; + unsigned long gcm; + + if (!Scr->FirstTime || prevScr == Scr) + return; + + prevScr = Scr; + + /* create GC's */ + + gcm = 0; + gcm |= GCFunction; gcv.function = GXxor; + gcm |= GCLineWidth; gcv.line_width = 0; + gcm |= GCForeground; gcv.foreground = Scr->XORvalue; + gcm |= GCSubwindowMode; gcv.subwindow_mode = IncludeInferiors; + + Scr->DrawGC = XCreateGC(dpy, Scr->Root, gcm, &gcv); + + gcm = 0; + gcm |= GCForeground; gcv.foreground = Scr->MenuC.fore; + gcm |= GCBackground; gcv.background = Scr->MenuC.back; + if (!use_fontset) + {gcm |= GCFont; gcv.font = Scr->MenuFont.font->fid;} + + Scr->MenuGC = XCreateGC(dpy, Scr->Root, gcm, &gcv); + + gcm = 0; + gcm |= GCPlaneMask; gcv.plane_mask = AllPlanes; + /* + * Prevent GraphicsExpose and NoExpose events. We'd only get NoExpose + * events anyway; they cause BadWindow errors from XGetWindowAttributes + * call in FindScreenInfo (events.c) (since drawable is a pixmap). + */ + gcm |= GCGraphicsExposures; gcv.graphics_exposures = False; + gcm |= GCLineWidth; gcv.line_width = 0; + + Scr->NormalGC = XCreateGC(dpy, Scr->Root, gcm, &gcv); +} diff --git a/app/twm/src/gc.h b/app/twm/src/gc.h new file mode 100644 index 000000000..c0b9566ac --- /dev/null +++ b/app/twm/src/gc.h @@ -0,0 +1,69 @@ +/*****************************************************************************/ +/* + +Copyright 1989, 1998 The Open Group + +Permission to use, copy, modify, distribute, and sell this software and its +documentation for any purpose is hereby granted without fee, provided that +the above copyright notice appear in all copies and that both that +copyright notice and this permission notice appear in supporting +documentation. + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the name of The Open Group shall not be +used in advertising or otherwise to promote the sale, use or other dealings +in this Software without prior written authorization from The Open Group. + +*/ +/** Copyright 1988 by Evans & Sutherland Computer Corporation, **/ +/** Salt Lake City, Utah **/ +/** Cambridge, Massachusetts **/ +/** **/ +/** All Rights Reserved **/ +/** **/ +/** Permission to use, copy, modify, and distribute this software and **/ +/** its documentation for any purpose and without fee is hereby **/ +/** granted, provided that the above copyright notice appear in all **/ +/** copies and that both that copyright notice and this permis- **/ +/** sion notice appear in supporting documentation, and that the **/ +/** name of Evans & Sutherland not be used in advertising **/ +/** in publicity pertaining to distribution of the software without **/ +/** specific, written prior permission. **/ +/** **/ +/** EVANS & SUTHERLAND DISCLAIMs ALL WARRANTIES WITH REGARD **/ +/** TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANT- **/ +/** ABILITY AND FITNESS, IN NO EVENT SHALL EVANS & SUTHERLAND **/ +/** BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAM- **/ +/** AGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA **/ +/** OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER **/ +/** TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE **/ +/** OR PERFORMANCE OF THIS SOFTWARE. **/ +/*****************************************************************************/ +/* $XFree86: xc/programs/twm/gc.h,v 1.4 2001/01/17 23:45:06 dawes Exp $ */ + + +/********************************************************************** + * + * $Xorg: gc.h,v 1.4 2001/02/09 02:05:36 xorgcvs Exp $ + * + * GC related externs + * + * 8-Apr-88 Tom LaStrange Initial Version. + * + **********************************************************************/ + +#ifndef _GC_ +#define _GC_ + +extern void CreateGCs( void ); + +#endif /* _GC_ */ diff --git a/app/twm/src/gram.c b/app/twm/src/gram.c new file mode 100644 index 000000000..83ff82602 --- /dev/null +++ b/app/twm/src/gram.c @@ -0,0 +1,3092 @@ +/* A Bison parser, made by GNU Bison 2.3. */ + +/* Skeleton implementation for Bison's Yacc-like parsers in C + + Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006 + Free Software Foundation, Inc. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. */ + +/* As a special exception, you may create a larger work that contains + part or all of the Bison parser skeleton and distribute that work + under terms of your choice, so long as that work isn't itself a + parser generator using the skeleton or a modified version thereof + as a parser skeleton. Alternatively, if you modify or redistribute + the parser skeleton itself, you may (at your option) remove this + special exception, which will cause the skeleton and the resulting + Bison output files to be licensed under the GNU General Public + License without this special exception. + + This special exception was added by the Free Software Foundation in + version 2.2 of Bison. */ + +/* C LALR(1) parser skeleton written by Richard Stallman, by + simplifying the original so-called "semantic" parser. */ + +/* All symbols defined below should begin with yy or YY, to avoid + infringing on user name space. This should be done even for local + variables, as they might otherwise be expanded by user macros. + There are some unavoidable exceptions within include files to + define necessary library symbols; they are noted "INFRINGES ON + USER NAME SPACE" below. */ + +/* Identify Bison output. */ +#define YYBISON 1 + +/* Bison version. */ +#define YYBISON_VERSION "2.3" + +/* Skeleton name. */ +#define YYSKELETON_NAME "yacc.c" + +/* Pure parsers. */ +#define YYPURE 0 + +/* Using locations. */ +#define YYLSP_NEEDED 0 + + + +/* Tokens. */ +#ifndef YYTOKENTYPE +# define YYTOKENTYPE + /* Put the tokens into the symbol table, so that GDB and other debuggers + know about them. */ + enum yytokentype { + LB = 258, + RB = 259, + LP = 260, + RP = 261, + MENUS = 262, + MENU = 263, + BUTTON = 264, + DEFAULT_FUNCTION = 265, + PLUS = 266, + MINUS = 267, + ALL = 268, + OR = 269, + CURSORS = 270, + PIXMAPS = 271, + ICONS = 272, + COLOR = 273, + SAVECOLOR = 274, + MONOCHROME = 275, + FUNCTION = 276, + ICONMGR_SHOW = 277, + ICONMGR = 278, + WINDOW_FUNCTION = 279, + ZOOM = 280, + ICONMGRS = 281, + ICONMGR_GEOMETRY = 282, + ICONMGR_NOSHOW = 283, + MAKE_TITLE = 284, + GRAYSCALE = 285, + ICONIFY_BY_UNMAPPING = 286, + DONT_ICONIFY_BY_UNMAPPING = 287, + NO_TITLE = 288, + AUTO_RAISE = 289, + NO_HILITE = 290, + ICON_REGION = 291, + META = 292, + SHIFT = 293, + LOCK = 294, + CONTROL = 295, + WINDOW = 296, + TITLE = 297, + ICON = 298, + ROOT = 299, + FRAME = 300, + COLON = 301, + EQUALS = 302, + SQUEEZE_TITLE = 303, + DONT_SQUEEZE_TITLE = 304, + START_ICONIFIED = 305, + NO_TITLE_HILITE = 306, + TITLE_HILITE = 307, + MOVE = 308, + RESIZE = 309, + WAIT = 310, + SELECT = 311, + KILL = 312, + LEFT_TITLEBUTTON = 313, + RIGHT_TITLEBUTTON = 314, + NUMBER = 315, + KEYWORD = 316, + NKEYWORD = 317, + CKEYWORD = 318, + CLKEYWORD = 319, + FKEYWORD = 320, + FSKEYWORD = 321, + SKEYWORD = 322, + DKEYWORD = 323, + JKEYWORD = 324, + WINDOW_RING = 325, + WARP_CURSOR = 326, + ERRORTOKEN = 327, + NO_STACKMODE = 328, + STRING = 329 + }; +#endif +/* Tokens. */ +#define LB 258 +#define RB 259 +#define LP 260 +#define RP 261 +#define MENUS 262 +#define MENU 263 +#define BUTTON 264 +#define DEFAULT_FUNCTION 265 +#define PLUS 266 +#define MINUS 267 +#define ALL 268 +#define OR 269 +#define CURSORS 270 +#define PIXMAPS 271 +#define ICONS 272 +#define COLOR 273 +#define SAVECOLOR 274 +#define MONOCHROME 275 +#define FUNCTION 276 +#define ICONMGR_SHOW 277 +#define ICONMGR 278 +#define WINDOW_FUNCTION 279 +#define ZOOM 280 +#define ICONMGRS 281 +#define ICONMGR_GEOMETRY 282 +#define ICONMGR_NOSHOW 283 +#define MAKE_TITLE 284 +#define GRAYSCALE 285 +#define ICONIFY_BY_UNMAPPING 286 +#define DONT_ICONIFY_BY_UNMAPPING 287 +#define NO_TITLE 288 +#define AUTO_RAISE 289 +#define NO_HILITE 290 +#define ICON_REGION 291 +#define META 292 +#define SHIFT 293 +#define LOCK 294 +#define CONTROL 295 +#define WINDOW 296 +#define TITLE 297 +#define ICON 298 +#define ROOT 299 +#define FRAME 300 +#define COLON 301 +#define EQUALS 302 +#define SQUEEZE_TITLE 303 +#define DONT_SQUEEZE_TITLE 304 +#define START_ICONIFIED 305 +#define NO_TITLE_HILITE 306 +#define TITLE_HILITE 307 +#define MOVE 308 +#define RESIZE 309 +#define WAIT 310 +#define SELECT 311 +#define KILL 312 +#define LEFT_TITLEBUTTON 313 +#define RIGHT_TITLEBUTTON 314 +#define NUMBER 315 +#define KEYWORD 316 +#define NKEYWORD 317 +#define CKEYWORD 318 +#define CLKEYWORD 319 +#define FKEYWORD 320 +#define FSKEYWORD 321 +#define SKEYWORD 322 +#define DKEYWORD 323 +#define JKEYWORD 324 +#define WINDOW_RING 325 +#define WARP_CURSOR 326 +#define ERRORTOKEN 327 +#define NO_STACKMODE 328 +#define STRING 329 + + + + +/* Copy the first part of user declarations. */ +#line 67 "gram.y" + +#include +#include +#include "twm.h" +#include "menus.h" +#include "list.h" +#include "util.h" +#include "screen.h" +#include "parse.h" +#include "add_window.h" +#include "icons.h" +#include +#include + +static char *Action = ""; +static char *Name = ""; +static MenuRoot *root, *pull = NULL; + +static MenuRoot *GetRoot ( char *name, char *fore, char *back ); +static void GotButton ( int butt, int func ); +static void GotKey ( char *key, int func ); +static void GotTitleButton ( char *bitmapname, int func, Bool rightside ); +static Bool CheckWarpScreenArg ( char *s ); +static Bool CheckWarpRingArg ( char *s ); +static Bool CheckColormapArg ( char *s ); + +static char *ptr; +static name_list **list; +static int cont = 0; +static int color; +int mods = 0; +unsigned int mods_used = (ShiftMask | ControlMask | Mod1Mask); + +extern int yylineno; + + +/* Enabling traces. */ +#ifndef YYDEBUG +# define YYDEBUG 0 +#endif + +/* Enabling verbose error messages. */ +#ifdef YYERROR_VERBOSE +# undef YYERROR_VERBOSE +# define YYERROR_VERBOSE 1 +#else +# define YYERROR_VERBOSE 0 +#endif + +/* Enabling the token table. */ +#ifndef YYTOKEN_TABLE +# define YYTOKEN_TABLE 0 +#endif + +#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED +typedef union YYSTYPE +#line 104 "gram.y" +{ + int num; + char *ptr; +} +/* Line 193 of yacc.c. */ +#line 285 "gram.c" + YYSTYPE; +# define yystype YYSTYPE /* obsolescent; will be withdrawn */ +# define YYSTYPE_IS_DECLARED 1 +# define YYSTYPE_IS_TRIVIAL 1 +#endif + + + +/* Copy the second part of user declarations. */ + + +/* Line 216 of yacc.c. */ +#line 298 "gram.c" + +#ifdef short +# undef short +#endif + +#ifdef YYTYPE_UINT8 +typedef YYTYPE_UINT8 yytype_uint8; +#else +typedef unsigned char yytype_uint8; +#endif + +#ifdef YYTYPE_INT8 +typedef YYTYPE_INT8 yytype_int8; +#elif (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +typedef signed char yytype_int8; +#else +typedef short int yytype_int8; +#endif + +#ifdef YYTYPE_UINT16 +typedef YYTYPE_UINT16 yytype_uint16; +#else +typedef unsigned short int yytype_uint16; +#endif + +#ifdef YYTYPE_INT16 +typedef YYTYPE_INT16 yytype_int16; +#else +typedef short int yytype_int16; +#endif + +#ifndef YYSIZE_T +# ifdef __SIZE_TYPE__ +# define YYSIZE_T __SIZE_TYPE__ +# elif defined size_t +# define YYSIZE_T size_t +# elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +# include /* INFRINGES ON USER NAME SPACE */ +# define YYSIZE_T size_t +# else +# define YYSIZE_T unsigned int +# endif +#endif + +#define YYSIZE_MAXIMUM ((YYSIZE_T) -1) + +#ifndef YY_ +# if YYENABLE_NLS +# if ENABLE_NLS +# include /* INFRINGES ON USER NAME SPACE */ +# define YY_(msgid) dgettext ("bison-runtime", msgid) +# endif +# endif +# ifndef YY_ +# define YY_(msgid) msgid +# endif +#endif + +/* Suppress unused-variable warnings by "using" E. */ +#if ! defined lint || defined __GNUC__ +# define YYUSE(e) ((void) (e)) +#else +# define YYUSE(e) /* empty */ +#endif + +/* Identity function, used to suppress warnings about constant conditions. */ +#ifndef lint +# define YYID(n) (n) +#else +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +static int +YYID (int i) +#else +static int +YYID (i) + int i; +#endif +{ + return i; +} +#endif + +#if ! defined yyoverflow || YYERROR_VERBOSE + +/* The parser invokes alloca or malloc; define the necessary symbols. */ + +# ifdef YYSTACK_USE_ALLOCA +# if YYSTACK_USE_ALLOCA +# ifdef __GNUC__ +# define YYSTACK_ALLOC __builtin_alloca +# elif defined __BUILTIN_VA_ARG_INCR +# include /* INFRINGES ON USER NAME SPACE */ +# elif defined _AIX +# define YYSTACK_ALLOC __alloca +# elif defined _MSC_VER +# include /* INFRINGES ON USER NAME SPACE */ +# define alloca _alloca +# else +# define YYSTACK_ALLOC alloca +# if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +# include /* INFRINGES ON USER NAME SPACE */ +# ifndef _STDLIB_H +# define _STDLIB_H 1 +# endif +# endif +# endif +# endif +# endif + +# ifdef YYSTACK_ALLOC + /* Pacify GCC's `empty if-body' warning. */ +# define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0)) +# ifndef YYSTACK_ALLOC_MAXIMUM + /* The OS might guarantee only one guard page at the bottom of the stack, + and a page size can be as small as 4096 bytes. So we cannot safely + invoke alloca (N) if N exceeds 4096. Use a slightly smaller number + to allow for a few compiler-allocated temporary stack slots. */ +# define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */ +# endif +# else +# define YYSTACK_ALLOC YYMALLOC +# define YYSTACK_FREE YYFREE +# ifndef YYSTACK_ALLOC_MAXIMUM +# define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM +# endif +# if (defined __cplusplus && ! defined _STDLIB_H \ + && ! ((defined YYMALLOC || defined malloc) \ + && (defined YYFREE || defined free))) +# include /* INFRINGES ON USER NAME SPACE */ +# ifndef _STDLIB_H +# define _STDLIB_H 1 +# endif +# endif +# ifndef YYMALLOC +# define YYMALLOC malloc +# if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */ +# endif +# endif +# ifndef YYFREE +# define YYFREE free +# if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +void free (void *); /* INFRINGES ON USER NAME SPACE */ +# endif +# endif +# endif +#endif /* ! defined yyoverflow || YYERROR_VERBOSE */ + + +#if (! defined yyoverflow \ + && (! defined __cplusplus \ + || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL))) + +/* A type that is properly aligned for any stack member. */ +union yyalloc +{ + yytype_int16 yyss; + YYSTYPE yyvs; + }; + +/* The size of the maximum gap between one aligned stack and the next. */ +# define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1) + +/* The size of an array large to enough to hold all stacks, each with + N elements. */ +# define YYSTACK_BYTES(N) \ + ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \ + + YYSTACK_GAP_MAXIMUM) + +/* Copy COUNT objects from FROM to TO. The source and destination do + not overlap. */ +# ifndef YYCOPY +# if defined __GNUC__ && 1 < __GNUC__ +# define YYCOPY(To, From, Count) \ + __builtin_memcpy (To, From, (Count) * sizeof (*(From))) +# else +# define YYCOPY(To, From, Count) \ + do \ + { \ + YYSIZE_T yyi; \ + for (yyi = 0; yyi < (Count); yyi++) \ + (To)[yyi] = (From)[yyi]; \ + } \ + while (YYID (0)) +# endif +# endif + +/* Relocate STACK from its old location to the new one. The + local variables YYSIZE and YYSTACKSIZE give the old and new number of + elements in the stack, and YYPTR gives the new location of the + stack. Advance YYPTR to a properly aligned location for the next + stack. */ +# define YYSTACK_RELOCATE(Stack) \ + do \ + { \ + YYSIZE_T yynewbytes; \ + YYCOPY (&yyptr->Stack, Stack, yysize); \ + Stack = &yyptr->Stack; \ + yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \ + yyptr += yynewbytes / sizeof (*yyptr); \ + } \ + while (YYID (0)) + +#endif + +/* YYFINAL -- State number of the termination state. */ +#define YYFINAL 3 +/* YYLAST -- Last index in YYTABLE. */ +#define YYLAST 339 + +/* YYNTOKENS -- Number of terminals. */ +#define YYNTOKENS 75 +/* YYNNTS -- Number of nonterminals. */ +#define YYNNTS 76 +/* YYNRULES -- Number of rules. */ +#define YYNRULES 193 +/* YYNRULES -- Number of states. */ +#define YYNSTATES 285 + +/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ +#define YYUNDEFTOK 2 +#define YYMAXUTOK 329 + +#define YYTRANSLATE(YYX) \ + ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) + +/* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */ +static const yytype_uint8 yytranslate[] = +{ + 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 1, 2, 3, 4, + 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, + 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, + 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, + 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, + 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, + 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, + 65, 66, 67, 68, 69, 70, 71, 72, 73, 74 +}; + +#if YYDEBUG +/* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in + YYRHS. */ +static const yytype_uint16 yyprhs[] = +{ + 0, 0, 3, 5, 6, 9, 11, 13, 15, 17, + 19, 26, 30, 33, 36, 38, 41, 44, 45, 49, + 51, 56, 61, 64, 67, 70, 73, 74, 78, 79, + 83, 85, 86, 90, 91, 95, 96, 100, 102, 103, + 107, 109, 110, 114, 116, 117, 121, 123, 124, 128, + 129, 133, 134, 138, 139, 149, 150, 155, 156, 161, + 162, 166, 167, 171, 172, 176, 179, 180, 184, 187, + 190, 191, 195, 197, 198, 202, 204, 207, 210, 217, + 224, 225, 228, 230, 232, 234, 236, 239, 241, 242, + 245, 247, 249, 251, 253, 255, 257, 259, 261, 263, + 264, 267, 269, 271, 273, 275, 277, 279, 281, 283, + 285, 287, 291, 292, 295, 298, 302, 303, 306, 310, + 313, 317, 320, 324, 327, 331, 334, 338, 341, 345, + 348, 352, 355, 359, 362, 366, 369, 373, 376, 380, + 383, 387, 388, 391, 394, 395, 400, 403, 407, 408, + 411, 413, 415, 419, 420, 423, 426, 428, 429, 435, + 437, 438, 442, 443, 449, 453, 454, 457, 461, 466, + 470, 471, 474, 476, 480, 481, 484, 487, 491, 492, + 495, 497, 501, 502, 505, 508, 516, 518, 521, 523, + 526, 529, 532, 534 +}; + +/* YYRHS -- A `-1'-separated list of the rules' RHS. */ +static const yytype_int16 yyrhs[] = +{ + 76, 0, -1, 77, -1, -1, 77, 78, -1, 1, + -1, 100, -1, 101, -1, 102, -1, 127, -1, 36, + 149, 68, 68, 150, 150, -1, 27, 149, 150, -1, + 27, 149, -1, 25, 150, -1, 25, -1, 16, 111, + -1, 15, 114, -1, -1, 31, 79, 134, -1, 31, + -1, 58, 149, 47, 146, -1, 59, 149, 47, 146, + -1, 148, 149, -1, 148, 146, -1, 149, 104, -1, + 148, 103, -1, -1, 32, 80, 134, -1, -1, 28, + 81, 134, -1, 28, -1, -1, 26, 82, 131, -1, + -1, 22, 83, 134, -1, -1, 51, 84, 134, -1, + 51, -1, -1, 35, 85, 134, -1, 35, -1, -1, + 73, 86, 134, -1, 73, -1, -1, 33, 87, 134, + -1, 33, -1, -1, 29, 88, 134, -1, -1, 50, + 89, 134, -1, -1, 34, 90, 134, -1, -1, 8, + 149, 5, 149, 46, 149, 6, 91, 143, -1, -1, + 8, 149, 92, 143, -1, -1, 21, 149, 93, 140, + -1, -1, 17, 94, 137, -1, -1, 18, 95, 117, + -1, -1, 30, 96, 117, -1, 19, 121, -1, -1, + 20, 97, 117, -1, 10, 146, -1, 24, 146, -1, + -1, 71, 98, 134, -1, 71, -1, -1, 70, 99, + 134, -1, 61, -1, 67, 149, -1, 62, 150, -1, + 47, 105, 46, 107, 46, 146, -1, 47, 105, 46, + 109, 46, 146, -1, -1, 105, 106, -1, 37, -1, + 38, -1, 39, -1, 40, -1, 37, 150, -1, 14, + -1, -1, 107, 108, -1, 41, -1, 42, -1, 43, + -1, 44, -1, 45, -1, 23, -1, 37, -1, 13, + -1, 14, -1, -1, 109, 110, -1, 41, -1, 42, + -1, 43, -1, 44, -1, 45, -1, 23, -1, 37, + -1, 13, -1, 14, -1, 149, -1, 3, 112, 4, + -1, -1, 112, 113, -1, 52, 149, -1, 3, 115, + 4, -1, -1, 115, 116, -1, 45, 149, 149, -1, + 45, 149, -1, 42, 149, 149, -1, 42, 149, -1, + 43, 149, 149, -1, 43, 149, -1, 23, 149, 149, + -1, 23, 149, -1, 9, 149, 149, -1, 9, 149, + -1, 53, 149, 149, -1, 53, 149, -1, 54, 149, + 149, -1, 54, 149, -1, 55, 149, 149, -1, 55, + 149, -1, 8, 149, 149, -1, 8, 149, -1, 56, + 149, 149, -1, 56, 149, -1, 57, 149, 149, -1, + 57, 149, -1, 3, 118, 4, -1, -1, 118, 119, + -1, 64, 149, -1, -1, 64, 149, 120, 124, -1, + 63, 149, -1, 3, 122, 4, -1, -1, 122, 123, + -1, 149, -1, 64, -1, 3, 125, 4, -1, -1, + 125, 126, -1, 149, 149, -1, 48, -1, -1, 48, + 128, 3, 130, 4, -1, 49, -1, -1, 49, 129, + 134, -1, -1, 130, 149, 69, 147, 150, -1, 3, + 132, 4, -1, -1, 132, 133, -1, 149, 149, 150, + -1, 149, 149, 149, 150, -1, 3, 135, 4, -1, + -1, 135, 136, -1, 149, -1, 3, 138, 4, -1, + -1, 138, 139, -1, 149, 149, -1, 3, 141, 4, + -1, -1, 141, 142, -1, 146, -1, 3, 144, 4, + -1, -1, 144, 145, -1, 149, 146, -1, 149, 5, + 149, 46, 149, 6, 146, -1, 65, -1, 66, 149, + -1, 150, -1, 11, 150, -1, 12, 150, -1, 9, + 150, -1, 74, -1, 60, -1 +}; + +/* YYRLINE[YYN] -- source line where rule number YYN was defined. */ +static const yytype_uint16 yyrline[] = +{ + 0, 133, 133, 136, 137, 140, 141, 142, 143, 144, + 145, 147, 153, 156, 162, 164, 165, 166, 166, 168, + 170, 173, 176, 180, 196, 197, 198, 198, 200, 200, + 202, 203, 203, 205, 205, 207, 207, 209, 211, 211, + 213, 215, 215, 217, 219, 219, 221, 223, 223, 225, + 225, 227, 227, 229, 229, 232, 232, 234, 234, 236, + 236, 238, 238, 240, 240, 242, 244, 244, 246, 262, + 270, 270, 272, 274, 274, 279, 289, 299, 311, 314, + 317, 318, 321, 322, 323, 324, 325, 335, 338, 339, + 342, 343, 344, 345, 346, 347, 348, 349, 350, 353, + 354, 357, 358, 359, 360, 361, 362, 363, 364, 365, + 366, 370, 373, 374, 377, 381, 384, 385, 388, 390, + 392, 394, 396, 398, 400, 402, 404, 406, 408, 410, + 412, 414, 416, 418, 420, 422, 424, 426, 428, 430, + 434, 438, 439, 442, 451, 451, 462, 473, 476, 477, + 480, 481, 484, 487, 488, 491, 496, 499, 499, 504, + 505, 505, 509, 510, 518, 521, 522, 525, 530, 538, + 541, 542, 545, 550, 553, 554, 557, 560, 563, 564, + 567, 573, 576, 577, 580, 585, 593, 594, 635, 636, + 637, 640, 652, 658 +}; +#endif + +#if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE +/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. + First, the terminals, then, starting at YYNTOKENS, nonterminals. */ +static const char *const yytname[] = +{ + "$end", "error", "$undefined", "LB", "RB", "LP", "RP", "MENUS", "MENU", + "BUTTON", "DEFAULT_FUNCTION", "PLUS", "MINUS", "ALL", "OR", "CURSORS", + "PIXMAPS", "ICONS", "COLOR", "SAVECOLOR", "MONOCHROME", "FUNCTION", + "ICONMGR_SHOW", "ICONMGR", "WINDOW_FUNCTION", "ZOOM", "ICONMGRS", + "ICONMGR_GEOMETRY", "ICONMGR_NOSHOW", "MAKE_TITLE", "GRAYSCALE", + "ICONIFY_BY_UNMAPPING", "DONT_ICONIFY_BY_UNMAPPING", "NO_TITLE", + "AUTO_RAISE", "NO_HILITE", "ICON_REGION", "META", "SHIFT", "LOCK", + "CONTROL", "WINDOW", "TITLE", "ICON", "ROOT", "FRAME", "COLON", "EQUALS", + "SQUEEZE_TITLE", "DONT_SQUEEZE_TITLE", "START_ICONIFIED", + "NO_TITLE_HILITE", "TITLE_HILITE", "MOVE", "RESIZE", "WAIT", "SELECT", + "KILL", "LEFT_TITLEBUTTON", "RIGHT_TITLEBUTTON", "NUMBER", "KEYWORD", + "NKEYWORD", "CKEYWORD", "CLKEYWORD", "FKEYWORD", "FSKEYWORD", "SKEYWORD", + "DKEYWORD", "JKEYWORD", "WINDOW_RING", "WARP_CURSOR", "ERRORTOKEN", + "NO_STACKMODE", "STRING", "$accept", "twmrc", "stmts", "stmt", "@1", + "@2", "@3", "@4", "@5", "@6", "@7", "@8", "@9", "@10", "@11", "@12", + "@13", "@14", "@15", "@16", "@17", "@18", "@19", "@20", "@21", "noarg", + "sarg", "narg", "full", "fullkey", "keys", "key", "contexts", "context", + "contextkeys", "contextkey", "pixmap_list", "pixmap_entries", + "pixmap_entry", "cursor_list", "cursor_entries", "cursor_entry", + "color_list", "color_entries", "color_entry", "@22", "save_color_list", + "s_color_entries", "s_color_entry", "win_color_list", + "win_color_entries", "win_color_entry", "squeeze", "@23", "@24", + "win_sqz_entries", "iconm_list", "iconm_entries", "iconm_entry", + "win_list", "win_entries", "win_entry", "icon_list", "icon_entries", + "icon_entry", "function", "function_entries", "function_entry", "menu", + "menu_entries", "menu_entry", "action", "signed_number", "button", + "string", "number", 0 +}; +#endif + +# ifdef YYPRINT +/* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to + token YYLEX-NUM. */ +static const yytype_uint16 yytoknum[] = +{ + 0, 256, 257, 258, 259, 260, 261, 262, 263, 264, + 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, + 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, + 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, + 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, + 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, + 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, + 325, 326, 327, 328, 329 +}; +# endif + +/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ +static const yytype_uint8 yyr1[] = +{ + 0, 75, 76, 77, 77, 78, 78, 78, 78, 78, + 78, 78, 78, 78, 78, 78, 78, 79, 78, 78, + 78, 78, 78, 78, 78, 78, 80, 78, 81, 78, + 78, 82, 78, 83, 78, 84, 78, 78, 85, 78, + 78, 86, 78, 78, 87, 78, 78, 88, 78, 89, + 78, 90, 78, 91, 78, 92, 78, 93, 78, 94, + 78, 95, 78, 96, 78, 78, 97, 78, 78, 78, + 98, 78, 78, 99, 78, 100, 101, 102, 103, 104, + 105, 105, 106, 106, 106, 106, 106, 106, 107, 107, + 108, 108, 108, 108, 108, 108, 108, 108, 108, 109, + 109, 110, 110, 110, 110, 110, 110, 110, 110, 110, + 110, 111, 112, 112, 113, 114, 115, 115, 116, 116, + 116, 116, 116, 116, 116, 116, 116, 116, 116, 116, + 116, 116, 116, 116, 116, 116, 116, 116, 116, 116, + 117, 118, 118, 119, 120, 119, 119, 121, 122, 122, + 123, 123, 124, 125, 125, 126, 127, 128, 127, 127, + 129, 127, 130, 130, 131, 132, 132, 133, 133, 134, + 135, 135, 136, 137, 138, 138, 139, 140, 141, 141, + 142, 143, 144, 144, 145, 145, 146, 146, 147, 147, + 147, 148, 149, 150 +}; + +/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ +static const yytype_uint8 yyr2[] = +{ + 0, 2, 1, 0, 2, 1, 1, 1, 1, 1, + 6, 3, 2, 2, 1, 2, 2, 0, 3, 1, + 4, 4, 2, 2, 2, 2, 0, 3, 0, 3, + 1, 0, 3, 0, 3, 0, 3, 1, 0, 3, + 1, 0, 3, 1, 0, 3, 1, 0, 3, 0, + 3, 0, 3, 0, 9, 0, 4, 0, 4, 0, + 3, 0, 3, 0, 3, 2, 0, 3, 2, 2, + 0, 3, 1, 0, 3, 1, 2, 2, 6, 6, + 0, 2, 1, 1, 1, 1, 2, 1, 0, 2, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, + 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 3, 0, 2, 2, 3, 0, 2, 3, 2, + 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, + 3, 2, 3, 2, 3, 2, 3, 2, 3, 2, + 3, 0, 2, 2, 0, 4, 2, 3, 0, 2, + 1, 1, 3, 0, 2, 2, 1, 0, 5, 1, + 0, 3, 0, 5, 3, 0, 2, 3, 4, 3, + 0, 2, 1, 3, 0, 2, 2, 3, 0, 2, + 1, 3, 0, 2, 2, 7, 1, 2, 1, 2, + 2, 2, 1, 1 +}; + +/* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state + STATE-NUM when YYTABLE doesn't specify something else to do. Zero + means the default is an error. */ +static const yytype_uint8 yydefact[] = +{ + 3, 0, 0, 1, 5, 0, 0, 0, 0, 0, + 59, 61, 0, 66, 0, 33, 0, 14, 31, 0, + 30, 47, 63, 19, 26, 46, 51, 40, 0, 156, + 159, 49, 37, 0, 0, 75, 0, 0, 73, 72, + 43, 192, 4, 6, 7, 8, 9, 0, 0, 55, + 193, 191, 186, 0, 68, 116, 16, 112, 15, 0, + 0, 148, 65, 0, 57, 0, 69, 13, 0, 12, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 77, 76, 0, 0, 0, + 80, 25, 23, 22, 80, 24, 0, 0, 187, 0, + 0, 174, 60, 141, 62, 0, 67, 0, 170, 34, + 165, 32, 11, 29, 48, 64, 18, 27, 45, 52, + 39, 0, 162, 161, 50, 36, 0, 0, 74, 71, + 42, 0, 0, 0, 182, 56, 115, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 117, 111, + 0, 113, 0, 0, 147, 151, 149, 150, 178, 58, + 0, 0, 0, 0, 20, 21, 87, 82, 83, 84, + 85, 88, 81, 99, 0, 0, 135, 127, 125, 121, + 123, 119, 129, 131, 133, 137, 139, 114, 173, 175, + 0, 140, 0, 0, 142, 0, 169, 171, 172, 164, + 166, 0, 0, 158, 0, 86, 0, 0, 0, 181, + 183, 0, 134, 126, 124, 120, 122, 118, 128, 130, + 132, 136, 138, 176, 146, 143, 177, 179, 180, 0, + 10, 0, 97, 98, 95, 96, 90, 91, 92, 93, + 94, 0, 89, 108, 109, 106, 107, 101, 102, 103, + 104, 105, 0, 100, 110, 53, 0, 184, 0, 0, + 167, 0, 0, 0, 188, 78, 79, 0, 0, 153, + 145, 168, 189, 190, 163, 54, 0, 0, 0, 152, + 154, 0, 0, 155, 185 +}; + +/* YYDEFGOTO[NTERM-NUM]. */ +static const yytype_int16 yydefgoto[] = +{ + -1, 1, 2, 42, 73, 74, 70, 68, 65, 82, + 77, 89, 75, 71, 81, 76, 267, 97, 107, 59, + 60, 72, 63, 88, 87, 43, 44, 45, 91, 95, + 131, 172, 206, 242, 207, 253, 58, 100, 151, 56, + 99, 148, 104, 153, 194, 258, 62, 105, 156, 270, + 277, 280, 46, 79, 80, 163, 111, 161, 200, 109, + 160, 197, 102, 152, 189, 159, 195, 227, 135, 175, + 210, 54, 263, 47, 48, 51 +}; + +/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing + STATE-NUM. */ +#define YYPACT_NINF -159 +static const yytype_int16 yypact[] = +{ + -159, 15, 265, -159, -159, -56, -30, -25, 28, 30, + -159, -159, 32, -159, -56, -159, -25, -30, -159, -56, + 40, -159, -159, 41, -159, 42, -159, 44, -56, 46, + 48, -159, 49, -56, -56, -159, -30, -56, -159, 58, + 60, -159, -159, -159, -159, -159, -159, -28, 20, 61, + -159, -159, -159, -56, -159, -159, -159, -159, -159, 65, + 66, -159, -159, 66, -159, 76, -159, -159, 78, -30, + 76, 76, 66, 76, 76, 76, 76, 76, -4, 83, + 76, 76, 76, 43, 45, -159, -159, 76, 76, 76, + -159, -159, -159, -159, -159, -159, -56, 85, -159, 107, + 8, -159, -159, -159, -159, -2, -159, 86, -159, -159, + -159, -159, -159, -159, -159, -159, -159, -159, -159, -159, + -159, 27, -159, -159, -159, -159, -25, -25, -159, -159, + -159, 59, 153, 55, -159, -159, -159, -56, -56, -56, + -56, -56, -56, -56, -56, -56, -56, -56, -159, -159, + -56, -159, 0, 7, -159, -159, -159, -159, -159, -159, + 1, 2, -30, 3, -159, -159, -159, -30, -159, -159, + -159, -159, -159, -159, -56, 4, -56, -56, -56, -56, + -56, -56, -56, -56, -56, -56, -56, -159, -159, -159, + -56, -159, -56, -56, -159, 17, -159, -159, -159, -159, + -159, -56, -30, -159, 33, -159, 80, 13, 98, -159, + -159, 19, -159, -159, -159, -159, -159, -159, -159, -159, + -159, -159, -159, -159, -159, 103, -159, -159, -159, -35, + -159, 5, -159, -159, -159, -159, -159, -159, -159, -159, + -159, -25, -159, -159, -159, -159, -159, -159, -159, -159, + -159, -159, -25, -159, -159, -159, -56, -159, 104, -30, + -159, -30, -30, -30, -159, -159, -159, 85, 62, -159, + -159, -159, -159, -159, -159, -159, -56, 6, 106, -159, + -159, -56, -25, -159, -159 +}; + +/* YYPGOTO[NTERM-NUM]. */ +static const yytype_int16 yypgoto[] = +{ + -159, -159, -159, -159, -159, -159, -159, -159, -159, -159, + -159, -159, -159, -159, -159, -159, -159, -159, -159, -159, + -159, -159, -159, -159, -159, -159, -159, -159, -159, -159, + 16, -159, -159, -159, -159, -159, -159, -159, -159, -159, + -159, -159, -50, -159, -159, -159, -159, -159, -159, -159, + -159, -159, -159, -159, -159, -159, -159, -159, -159, 130, + -159, -159, -159, -159, -159, -159, -159, -159, -158, -159, + -159, -13, -159, -159, -5, -16 +}; + +/* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If + positive, shift that token. If negative, reduce the rule which + number is the opposite. If zero, do what YYDEFACT says. + If YYTABLE_NINF, syntax error. */ +#define YYTABLE_NINF -161 +static const yytype_int16 yytable[] = +{ + 49, 67, 154, 66, 188, 196, 199, 203, 209, 64, + 279, 191, 149, 106, 69, 3, 261, 262, 41, 90, + 85, 226, 115, 78, 256, 50, 243, 244, 83, 84, + 50, 55, 86, 57, 92, 61, 245, 52, 53, 41, + 52, 53, 93, -28, -17, -44, 41, -38, 98, -157, + 246, -160, -35, 112, 247, 248, 249, 250, 251, 252, + 150, -70, 155, -41, 121, 50, 96, 94, 101, 103, + 192, 193, 41, 166, 41, 41, 41, 41, 41, 108, + 41, 110, 52, 53, 52, 53, 122, 41, 134, 158, + 126, 133, 127, 232, 233, 162, 167, 168, 169, 170, + 157, 174, 231, 234, 255, 171, -144, 269, 276, 275, + 132, 136, 282, 164, 165, 137, 138, 235, 0, 0, + 0, 236, 237, 238, 239, 240, 241, 0, 0, 0, + 139, 0, 176, 177, 178, 179, 180, 181, 182, 183, + 184, 185, 186, 0, 0, 187, 202, 190, 0, 140, + 141, 205, 142, 0, 0, 198, 201, 0, 204, 0, + 143, 144, 145, 146, 147, 0, 0, 166, 0, 208, + 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, + 221, 222, 228, 0, 0, 223, 230, 224, 225, 0, + 167, 168, 169, 170, 0, 0, 229, 0, 257, 173, + 113, 114, 254, 116, 117, 118, 119, 120, 0, 0, + 123, 124, 125, 260, 0, 264, 0, 128, 129, 130, + 0, 0, 0, 0, 259, 0, 0, 0, 265, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 266, + 0, 0, 0, 271, 0, 272, 273, 274, 0, 0, + 0, 268, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, -2, 4, 0, 0, 284, + 0, 278, 281, 5, 6, 7, 283, 0, 0, 0, + 8, 9, 10, 11, 12, 13, 14, 15, 0, 16, + 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, + 27, 28, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 29, 30, 31, 32, 0, 0, 0, + 0, 0, 0, 33, 34, 0, 35, 36, 0, 0, + 0, 0, 37, 0, 0, 38, 39, 0, 40, 41 +}; + +static const yytype_int16 yycheck[] = +{ + 5, 17, 4, 16, 4, 4, 4, 4, 4, 14, + 4, 4, 4, 63, 19, 0, 11, 12, 74, 47, + 36, 4, 72, 28, 5, 60, 13, 14, 33, 34, + 60, 3, 37, 3, 47, 3, 23, 65, 66, 74, + 65, 66, 47, 3, 3, 3, 74, 3, 53, 3, + 37, 3, 3, 69, 41, 42, 43, 44, 45, 46, + 52, 3, 64, 3, 68, 60, 5, 47, 3, 3, + 63, 64, 74, 14, 74, 74, 74, 74, 74, 3, + 74, 3, 65, 66, 65, 66, 3, 74, 3, 3, + 47, 96, 47, 13, 14, 68, 37, 38, 39, 40, + 105, 46, 69, 23, 6, 46, 3, 3, 46, 267, + 94, 4, 6, 126, 127, 8, 9, 37, -1, -1, + -1, 41, 42, 43, 44, 45, 46, -1, -1, -1, + 23, -1, 137, 138, 139, 140, 141, 142, 143, 144, + 145, 146, 147, -1, -1, 150, 162, 152, -1, 42, + 43, 167, 45, -1, -1, 160, 161, -1, 163, -1, + 53, 54, 55, 56, 57, -1, -1, 14, -1, 174, + 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, + 185, 186, 195, -1, -1, 190, 202, 192, 193, -1, + 37, 38, 39, 40, -1, -1, 201, -1, 211, 46, + 70, 71, 207, 73, 74, 75, 76, 77, -1, -1, + 80, 81, 82, 229, -1, 231, -1, 87, 88, 89, + -1, -1, -1, -1, 229, -1, -1, -1, 241, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 252, + -1, -1, -1, 259, -1, 261, 262, 263, -1, -1, + -1, 256, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 0, 1, -1, -1, 282, + -1, 276, 277, 8, 9, 10, 281, -1, -1, -1, + 15, 16, 17, 18, 19, 20, 21, 22, -1, 24, + 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, + 35, 36, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 48, 49, 50, 51, -1, -1, -1, + -1, -1, -1, 58, 59, -1, 61, 62, -1, -1, + -1, -1, 67, -1, -1, 70, 71, -1, 73, 74 +}; + +/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing + symbol of state STATE-NUM. */ +static const yytype_uint8 yystos[] = +{ + 0, 76, 77, 0, 1, 8, 9, 10, 15, 16, + 17, 18, 19, 20, 21, 22, 24, 25, 26, 27, + 28, 29, 30, 31, 32, 33, 34, 35, 36, 48, + 49, 50, 51, 58, 59, 61, 62, 67, 70, 71, + 73, 74, 78, 100, 101, 102, 127, 148, 149, 149, + 60, 150, 65, 66, 146, 3, 114, 3, 111, 94, + 95, 3, 121, 97, 149, 83, 146, 150, 82, 149, + 81, 88, 96, 79, 80, 87, 90, 85, 149, 128, + 129, 89, 84, 149, 149, 150, 149, 99, 98, 86, + 47, 103, 146, 149, 47, 104, 5, 92, 149, 115, + 112, 3, 137, 3, 117, 122, 117, 93, 3, 134, + 3, 131, 150, 134, 134, 117, 134, 134, 134, 134, + 134, 68, 3, 134, 134, 134, 47, 47, 134, 134, + 134, 105, 105, 149, 3, 143, 4, 8, 9, 23, + 42, 43, 45, 53, 54, 55, 56, 57, 116, 4, + 52, 113, 138, 118, 4, 64, 123, 149, 3, 140, + 135, 132, 68, 130, 146, 146, 14, 37, 38, 39, + 40, 46, 106, 46, 46, 144, 149, 149, 149, 149, + 149, 149, 149, 149, 149, 149, 149, 149, 4, 139, + 149, 4, 63, 64, 119, 141, 4, 136, 149, 4, + 133, 149, 150, 4, 149, 150, 107, 109, 149, 4, + 145, 149, 149, 149, 149, 149, 149, 149, 149, 149, + 149, 149, 149, 149, 149, 149, 4, 142, 146, 149, + 150, 69, 13, 14, 23, 37, 41, 42, 43, 44, + 45, 46, 108, 13, 14, 23, 37, 41, 42, 43, + 44, 45, 46, 110, 149, 6, 5, 146, 120, 149, + 150, 11, 12, 147, 150, 146, 146, 91, 149, 3, + 124, 150, 150, 150, 150, 143, 46, 125, 149, 4, + 126, 149, 6, 149, 146 +}; + +#define yyerrok (yyerrstatus = 0) +#define yyclearin (yychar = YYEMPTY) +#define YYEMPTY (-2) +#define YYEOF 0 + +#define YYACCEPT goto yyacceptlab +#define YYABORT goto yyabortlab +#define YYERROR goto yyerrorlab + + +/* Like YYERROR except do call yyerror. This remains here temporarily + to ease the transition to the new meaning of YYERROR, for GCC. + Once GCC version 2 has supplanted version 1, this can go. */ + +#define YYFAIL goto yyerrlab + +#define YYRECOVERING() (!!yyerrstatus) + +#define YYBACKUP(Token, Value) \ +do \ + if (yychar == YYEMPTY && yylen == 1) \ + { \ + yychar = (Token); \ + yylval = (Value); \ + yytoken = YYTRANSLATE (yychar); \ + YYPOPSTACK (1); \ + goto yybackup; \ + } \ + else \ + { \ + yyerror (YY_("syntax error: cannot back up")); \ + YYERROR; \ + } \ +while (YYID (0)) + + +#define YYTERROR 1 +#define YYERRCODE 256 + + +/* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N]. + If N is 0, then set CURRENT to the empty location which ends + the previous symbol: RHS[0] (always defined). */ + +#define YYRHSLOC(Rhs, K) ((Rhs)[K]) +#ifndef YYLLOC_DEFAULT +# define YYLLOC_DEFAULT(Current, Rhs, N) \ + do \ + if (YYID (N)) \ + { \ + (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \ + (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \ + (Current).last_line = YYRHSLOC (Rhs, N).last_line; \ + (Current).last_column = YYRHSLOC (Rhs, N).last_column; \ + } \ + else \ + { \ + (Current).first_line = (Current).last_line = \ + YYRHSLOC (Rhs, 0).last_line; \ + (Current).first_column = (Current).last_column = \ + YYRHSLOC (Rhs, 0).last_column; \ + } \ + while (YYID (0)) +#endif + + +/* YY_LOCATION_PRINT -- Print the location on the stream. + This macro was not mandated originally: define only if we know + we won't break user code: when these are the locations we know. */ + +#ifndef YY_LOCATION_PRINT +# if YYLTYPE_IS_TRIVIAL +# define YY_LOCATION_PRINT(File, Loc) \ + fprintf (File, "%d.%d-%d.%d", \ + (Loc).first_line, (Loc).first_column, \ + (Loc).last_line, (Loc).last_column) +# else +# define YY_LOCATION_PRINT(File, Loc) ((void) 0) +# endif +#endif + + +/* YYLEX -- calling `yylex' with the right arguments. */ + +#ifdef YYLEX_PARAM +# define YYLEX yylex (YYLEX_PARAM) +#else +# define YYLEX yylex () +#endif + +/* Enable debugging if requested. */ +#if YYDEBUG + +# ifndef YYFPRINTF +# include /* INFRINGES ON USER NAME SPACE */ +# define YYFPRINTF fprintf +# endif + +# define YYDPRINTF(Args) \ +do { \ + if (yydebug) \ + YYFPRINTF Args; \ +} while (YYID (0)) + +# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \ +do { \ + if (yydebug) \ + { \ + YYFPRINTF (stderr, "%s ", Title); \ + yy_symbol_print (stderr, \ + Type, Value); \ + YYFPRINTF (stderr, "\n"); \ + } \ +} while (YYID (0)) + + +/*--------------------------------. +| Print this symbol on YYOUTPUT. | +`--------------------------------*/ + +/*ARGSUSED*/ +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +static void +yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep) +#else +static void +yy_symbol_value_print (yyoutput, yytype, yyvaluep) + FILE *yyoutput; + int yytype; + YYSTYPE const * const yyvaluep; +#endif +{ + if (!yyvaluep) + return; +# ifdef YYPRINT + if (yytype < YYNTOKENS) + YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep); +# else + YYUSE (yyoutput); +# endif + switch (yytype) + { + default: + break; + } +} + + +/*--------------------------------. +| Print this symbol on YYOUTPUT. | +`--------------------------------*/ + +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +static void +yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep) +#else +static void +yy_symbol_print (yyoutput, yytype, yyvaluep) + FILE *yyoutput; + int yytype; + YYSTYPE const * const yyvaluep; +#endif +{ + if (yytype < YYNTOKENS) + YYFPRINTF (yyoutput, "token %s (", yytname[yytype]); + else + YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]); + + yy_symbol_value_print (yyoutput, yytype, yyvaluep); + YYFPRINTF (yyoutput, ")"); +} + +/*------------------------------------------------------------------. +| yy_stack_print -- Print the state stack from its BOTTOM up to its | +| TOP (included). | +`------------------------------------------------------------------*/ + +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +static void +yy_stack_print (yytype_int16 *bottom, yytype_int16 *top) +#else +static void +yy_stack_print (bottom, top) + yytype_int16 *bottom; + yytype_int16 *top; +#endif +{ + YYFPRINTF (stderr, "Stack now"); + for (; bottom <= top; ++bottom) + YYFPRINTF (stderr, " %d", *bottom); + YYFPRINTF (stderr, "\n"); +} + +# define YY_STACK_PRINT(Bottom, Top) \ +do { \ + if (yydebug) \ + yy_stack_print ((Bottom), (Top)); \ +} while (YYID (0)) + + +/*------------------------------------------------. +| Report that the YYRULE is going to be reduced. | +`------------------------------------------------*/ + +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +static void +yy_reduce_print (YYSTYPE *yyvsp, int yyrule) +#else +static void +yy_reduce_print (yyvsp, yyrule) + YYSTYPE *yyvsp; + int yyrule; +#endif +{ + int yynrhs = yyr2[yyrule]; + int yyi; + unsigned long int yylno = yyrline[yyrule]; + YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n", + yyrule - 1, yylno); + /* The symbols being reduced. */ + for (yyi = 0; yyi < yynrhs; yyi++) + { + fprintf (stderr, " $%d = ", yyi + 1); + yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi], + &(yyvsp[(yyi + 1) - (yynrhs)]) + ); + fprintf (stderr, "\n"); + } +} + +# define YY_REDUCE_PRINT(Rule) \ +do { \ + if (yydebug) \ + yy_reduce_print (yyvsp, Rule); \ +} while (YYID (0)) + +/* Nonzero means print parse trace. It is left uninitialized so that + multiple parsers can coexist. */ +int yydebug; +#else /* !YYDEBUG */ +# define YYDPRINTF(Args) +# define YY_SYMBOL_PRINT(Title, Type, Value, Location) +# define YY_STACK_PRINT(Bottom, Top) +# define YY_REDUCE_PRINT(Rule) +#endif /* !YYDEBUG */ + + +/* YYINITDEPTH -- initial size of the parser's stacks. */ +#ifndef YYINITDEPTH +# define YYINITDEPTH 200 +#endif + +/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only + if the built-in stack extension method is used). + + Do not make this value too large; the results are undefined if + YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH) + evaluated with infinite-precision integer arithmetic. */ + +#ifndef YYMAXDEPTH +# define YYMAXDEPTH 10000 +#endif + + + +#if YYERROR_VERBOSE + +# ifndef yystrlen +# if defined __GLIBC__ && defined _STRING_H +# define yystrlen strlen +# else +/* Return the length of YYSTR. */ +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +static YYSIZE_T +yystrlen (const char *yystr) +#else +static YYSIZE_T +yystrlen (yystr) + const char *yystr; +#endif +{ + YYSIZE_T yylen; + for (yylen = 0; yystr[yylen]; yylen++) + continue; + return yylen; +} +# endif +# endif + +# ifndef yystpcpy +# if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE +# define yystpcpy stpcpy +# else +/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in + YYDEST. */ +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +static char * +yystpcpy (char *yydest, const char *yysrc) +#else +static char * +yystpcpy (yydest, yysrc) + char *yydest; + const char *yysrc; +#endif +{ + char *yyd = yydest; + const char *yys = yysrc; + + while ((*yyd++ = *yys++) != '\0') + continue; + + return yyd - 1; +} +# endif +# endif + +# ifndef yytnamerr +/* Copy to YYRES the contents of YYSTR after stripping away unnecessary + quotes and backslashes, so that it's suitable for yyerror. The + heuristic is that double-quoting is unnecessary unless the string + contains an apostrophe, a comma, or backslash (other than + backslash-backslash). YYSTR is taken from yytname. If YYRES is + null, do not copy; instead, return the length of what the result + would have been. */ +static YYSIZE_T +yytnamerr (char *yyres, const char *yystr) +{ + if (*yystr == '"') + { + YYSIZE_T yyn = 0; + char const *yyp = yystr; + + for (;;) + switch (*++yyp) + { + case '\'': + case ',': + goto do_not_strip_quotes; + + case '\\': + if (*++yyp != '\\') + goto do_not_strip_quotes; + /* Fall through. */ + default: + if (yyres) + yyres[yyn] = *yyp; + yyn++; + break; + + case '"': + if (yyres) + yyres[yyn] = '\0'; + return yyn; + } + do_not_strip_quotes: ; + } + + if (! yyres) + return yystrlen (yystr); + + return yystpcpy (yyres, yystr) - yyres; +} +# endif + +/* Copy into YYRESULT an error message about the unexpected token + YYCHAR while in state YYSTATE. Return the number of bytes copied, + including the terminating null byte. If YYRESULT is null, do not + copy anything; just return the number of bytes that would be + copied. As a special case, return 0 if an ordinary "syntax error" + message will do. Return YYSIZE_MAXIMUM if overflow occurs during + size calculation. */ +static YYSIZE_T +yysyntax_error (char *yyresult, int yystate, int yychar) +{ + int yyn = yypact[yystate]; + + if (! (YYPACT_NINF < yyn && yyn <= YYLAST)) + return 0; + else + { + int yytype = YYTRANSLATE (yychar); + YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]); + YYSIZE_T yysize = yysize0; + YYSIZE_T yysize1; + int yysize_overflow = 0; + enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 }; + char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; + int yyx; + +# if 0 + /* This is so xgettext sees the translatable formats that are + constructed on the fly. */ + YY_("syntax error, unexpected %s"); + YY_("syntax error, unexpected %s, expecting %s"); + YY_("syntax error, unexpected %s, expecting %s or %s"); + YY_("syntax error, unexpected %s, expecting %s or %s or %s"); + YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"); +# endif + char *yyfmt; + char const *yyf; + static char const yyunexpected[] = "syntax error, unexpected %s"; + static char const yyexpecting[] = ", expecting %s"; + static char const yyor[] = " or %s"; + char yyformat[sizeof yyunexpected + + sizeof yyexpecting - 1 + + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2) + * (sizeof yyor - 1))]; + char const *yyprefix = yyexpecting; + + /* Start YYX at -YYN if negative to avoid negative indexes in + YYCHECK. */ + int yyxbegin = yyn < 0 ? -yyn : 0; + + /* Stay within bounds of both yycheck and yytname. */ + int yychecklim = YYLAST - yyn + 1; + int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS; + int yycount = 1; + + yyarg[0] = yytname[yytype]; + yyfmt = yystpcpy (yyformat, yyunexpected); + + for (yyx = yyxbegin; yyx < yyxend; ++yyx) + if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR) + { + if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM) + { + yycount = 1; + yysize = yysize0; + yyformat[sizeof yyunexpected - 1] = '\0'; + break; + } + yyarg[yycount++] = yytname[yyx]; + yysize1 = yysize + yytnamerr (0, yytname[yyx]); + yysize_overflow |= (yysize1 < yysize); + yysize = yysize1; + yyfmt = yystpcpy (yyfmt, yyprefix); + yyprefix = yyor; + } + + yyf = YY_(yyformat); + yysize1 = yysize + yystrlen (yyf); + yysize_overflow |= (yysize1 < yysize); + yysize = yysize1; + + if (yysize_overflow) + return YYSIZE_MAXIMUM; + + if (yyresult) + { + /* Avoid sprintf, as that infringes on the user's name space. + Don't have undefined behavior even if the translation + produced a string with the wrong number of "%s"s. */ + char *yyp = yyresult; + int yyi = 0; + while ((*yyp = *yyf) != '\0') + { + if (*yyp == '%' && yyf[1] == 's' && yyi < yycount) + { + yyp += yytnamerr (yyp, yyarg[yyi++]); + yyf += 2; + } + else + { + yyp++; + yyf++; + } + } + } + return yysize; + } +} +#endif /* YYERROR_VERBOSE */ + + +/*-----------------------------------------------. +| Release the memory associated to this symbol. | +`-----------------------------------------------*/ + +/*ARGSUSED*/ +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +static void +yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep) +#else +static void +yydestruct (yymsg, yytype, yyvaluep) + const char *yymsg; + int yytype; + YYSTYPE *yyvaluep; +#endif +{ + YYUSE (yyvaluep); + + if (!yymsg) + yymsg = "Deleting"; + YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp); + + switch (yytype) + { + + default: + break; + } +} + + +/* Prevent warnings from -Wmissing-prototypes. */ + +#ifdef YYPARSE_PARAM +#if defined __STDC__ || defined __cplusplus +int yyparse (void *YYPARSE_PARAM); +#else +int yyparse (); +#endif +#else /* ! YYPARSE_PARAM */ +#if defined __STDC__ || defined __cplusplus +int yyparse (void); +#else +int yyparse (); +#endif +#endif /* ! YYPARSE_PARAM */ + + + +/* The look-ahead symbol. */ +int yychar; + +/* The semantic value of the look-ahead symbol. */ +YYSTYPE yylval; + +/* Number of syntax errors so far. */ +int yynerrs; + + + +/*----------. +| yyparse. | +`----------*/ + +#ifdef YYPARSE_PARAM +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +int +yyparse (void *YYPARSE_PARAM) +#else +int +yyparse (YYPARSE_PARAM) + void *YYPARSE_PARAM; +#endif +#else /* ! YYPARSE_PARAM */ +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +int +yyparse (void) +#else +int +yyparse () + +#endif +#endif +{ + + int yystate; + int yyn; + int yyresult; + /* Number of tokens to shift before error messages enabled. */ + int yyerrstatus; + /* Look-ahead token as an internal (translated) token number. */ + int yytoken = 0; +#if YYERROR_VERBOSE + /* Buffer for error messages, and its allocated size. */ + char yymsgbuf[128]; + char *yymsg = yymsgbuf; + YYSIZE_T yymsg_alloc = sizeof yymsgbuf; +#endif + + /* Three stacks and their tools: + `yyss': related to states, + `yyvs': related to semantic values, + `yyls': related to locations. + + Refer to the stacks thru separate pointers, to allow yyoverflow + to reallocate them elsewhere. */ + + /* The state stack. */ + yytype_int16 yyssa[YYINITDEPTH]; + yytype_int16 *yyss = yyssa; + yytype_int16 *yyssp; + + /* The semantic value stack. */ + YYSTYPE yyvsa[YYINITDEPTH]; + YYSTYPE *yyvs = yyvsa; + YYSTYPE *yyvsp; + + + +#define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N)) + + YYSIZE_T yystacksize = YYINITDEPTH; + + /* The variables used to return semantic value and location from the + action routines. */ + YYSTYPE yyval; + + + /* The number of symbols on the RHS of the reduced rule. + Keep to zero when no symbol should be popped. */ + int yylen = 0; + + YYDPRINTF ((stderr, "Starting parse\n")); + + yystate = 0; + yyerrstatus = 0; + yynerrs = 0; + yychar = YYEMPTY; /* Cause a token to be read. */ + + /* Initialize stack pointers. + Waste one element of value and location stack + so that they stay on the same level as the state stack. + The wasted elements are never initialized. */ + + yyssp = yyss; + yyvsp = yyvs; + + goto yysetstate; + +/*------------------------------------------------------------. +| yynewstate -- Push a new state, which is found in yystate. | +`------------------------------------------------------------*/ + yynewstate: + /* In all cases, when you get here, the value and location stacks + have just been pushed. So pushing a state here evens the stacks. */ + yyssp++; + + yysetstate: + *yyssp = yystate; + + if (yyss + yystacksize - 1 <= yyssp) + { + /* Get the current used size of the three stacks, in elements. */ + YYSIZE_T yysize = yyssp - yyss + 1; + +#ifdef yyoverflow + { + /* Give user a chance to reallocate the stack. Use copies of + these so that the &'s don't force the real ones into + memory. */ + YYSTYPE *yyvs1 = yyvs; + yytype_int16 *yyss1 = yyss; + + + /* Each stack pointer address is followed by the size of the + data in use in that stack, in bytes. This used to be a + conditional around just the two extra args, but that might + be undefined if yyoverflow is a macro. */ + yyoverflow (YY_("memory exhausted"), + &yyss1, yysize * sizeof (*yyssp), + &yyvs1, yysize * sizeof (*yyvsp), + + &yystacksize); + + yyss = yyss1; + yyvs = yyvs1; + } +#else /* no yyoverflow */ +# ifndef YYSTACK_RELOCATE + goto yyexhaustedlab; +# else + /* Extend the stack our own way. */ + if (YYMAXDEPTH <= yystacksize) + goto yyexhaustedlab; + yystacksize *= 2; + if (YYMAXDEPTH < yystacksize) + yystacksize = YYMAXDEPTH; + + { + yytype_int16 *yyss1 = yyss; + union yyalloc *yyptr = + (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); + if (! yyptr) + goto yyexhaustedlab; + YYSTACK_RELOCATE (yyss); + YYSTACK_RELOCATE (yyvs); + +# undef YYSTACK_RELOCATE + if (yyss1 != yyssa) + YYSTACK_FREE (yyss1); + } +# endif +#endif /* no yyoverflow */ + + yyssp = yyss + yysize - 1; + yyvsp = yyvs + yysize - 1; + + + YYDPRINTF ((stderr, "Stack size increased to %lu\n", + (unsigned long int) yystacksize)); + + if (yyss + yystacksize - 1 <= yyssp) + YYABORT; + } + + YYDPRINTF ((stderr, "Entering state %d\n", yystate)); + + goto yybackup; + +/*-----------. +| yybackup. | +`-----------*/ +yybackup: + + /* Do appropriate processing given the current state. Read a + look-ahead token if we need one and don't already have one. */ + + /* First try to decide what to do without reference to look-ahead token. */ + yyn = yypact[yystate]; + if (yyn == YYPACT_NINF) + goto yydefault; + + /* Not known => get a look-ahead token if don't already have one. */ + + /* YYCHAR is either YYEMPTY or YYEOF or a valid look-ahead symbol. */ + if (yychar == YYEMPTY) + { + YYDPRINTF ((stderr, "Reading a token: ")); + yychar = YYLEX; + } + + if (yychar <= YYEOF) + { + yychar = yytoken = YYEOF; + YYDPRINTF ((stderr, "Now at end of input.\n")); + } + else + { + yytoken = YYTRANSLATE (yychar); + YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc); + } + + /* If the proper action on seeing token YYTOKEN is to reduce or to + detect an error, take that action. */ + yyn += yytoken; + if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken) + goto yydefault; + yyn = yytable[yyn]; + if (yyn <= 0) + { + if (yyn == 0 || yyn == YYTABLE_NINF) + goto yyerrlab; + yyn = -yyn; + goto yyreduce; + } + + if (yyn == YYFINAL) + YYACCEPT; + + /* Count tokens shifted since error; after three, turn off error + status. */ + if (yyerrstatus) + yyerrstatus--; + + /* Shift the look-ahead token. */ + YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc); + + /* Discard the shifted token unless it is eof. */ + if (yychar != YYEOF) + yychar = YYEMPTY; + + yystate = yyn; + *++yyvsp = yylval; + + goto yynewstate; + + +/*-----------------------------------------------------------. +| yydefault -- do the default action for the current state. | +`-----------------------------------------------------------*/ +yydefault: + yyn = yydefact[yystate]; + if (yyn == 0) + goto yyerrlab; + goto yyreduce; + + +/*-----------------------------. +| yyreduce -- Do a reduction. | +`-----------------------------*/ +yyreduce: + /* yyn is the number of a rule to reduce with. */ + yylen = yyr2[yyn]; + + /* If YYLEN is nonzero, implement the default value of the action: + `$$ = $1'. + + Otherwise, the following line sets YYVAL to garbage. + This behavior is undocumented and Bison + users should not rely upon it. Assigning to YYVAL + unconditionally makes the parser a bit smaller, and it avoids a + GCC warning that YYVAL may be used uninitialized. */ + yyval = yyvsp[1-yylen]; + + + YY_REDUCE_PRINT (yyn); + switch (yyn) + { + case 10: +#line 146 "gram.y" + { AddIconRegion((yyvsp[(2) - (6)].ptr), (yyvsp[(3) - (6)].num), (yyvsp[(4) - (6)].num), (yyvsp[(5) - (6)].num), (yyvsp[(6) - (6)].num)); } + break; + + case 11: +#line 147 "gram.y" + { if (Scr->FirstTime) + { + Scr->iconmgr.geometry=(yyvsp[(2) - (3)].ptr); + Scr->iconmgr.columns=(yyvsp[(3) - (3)].num); + } + } + break; + + case 12: +#line 153 "gram.y" + { if (Scr->FirstTime) + Scr->iconmgr.geometry = (yyvsp[(2) - (2)].ptr); + } + break; + + case 13: +#line 156 "gram.y" + { if (Scr->FirstTime) + { + Scr->DoZoom = TRUE; + Scr->ZoomCount = (yyvsp[(2) - (2)].num); + } + } + break; + + case 14: +#line 162 "gram.y" + { if (Scr->FirstTime) + Scr->DoZoom = TRUE; } + break; + + case 15: +#line 164 "gram.y" + {} + break; + + case 16: +#line 165 "gram.y" + {} + break; + + case 17: +#line 166 "gram.y" + { list = &Scr->IconifyByUn; } + break; + + case 19: +#line 168 "gram.y" + { if (Scr->FirstTime) + Scr->IconifyByUnmapping = TRUE; } + break; + + case 20: +#line 170 "gram.y" + { + GotTitleButton ((yyvsp[(2) - (4)].ptr), (yyvsp[(4) - (4)].num), False); + } + break; + + case 21: +#line 173 "gram.y" + { + GotTitleButton ((yyvsp[(2) - (4)].ptr), (yyvsp[(4) - (4)].num), True); + } + break; + + case 22: +#line 176 "gram.y" + { root = GetRoot((yyvsp[(2) - (2)].ptr), NULLSTR, NULLSTR); + Scr->Mouse[(yyvsp[(1) - (2)].num)][C_ROOT][0].func = F_MENU; + Scr->Mouse[(yyvsp[(1) - (2)].num)][C_ROOT][0].menu = root; + } + break; + + case 23: +#line 180 "gram.y" + { Scr->Mouse[(yyvsp[(1) - (2)].num)][C_ROOT][0].func = (yyvsp[(2) - (2)].num); + if ((yyvsp[(2) - (2)].num) == F_MENU) + { + pull->prev = NULL; + Scr->Mouse[(yyvsp[(1) - (2)].num)][C_ROOT][0].menu = pull; + } + else + { + root = GetRoot(TWM_ROOT,NULLSTR,NULLSTR); + Scr->Mouse[(yyvsp[(1) - (2)].num)][C_ROOT][0].item = + AddToMenu(root,"x",Action, + NULL,(yyvsp[(2) - (2)].num),NULLSTR,NULLSTR); + } + Action = ""; + pull = NULL; + } + break; + + case 24: +#line 196 "gram.y" + { GotKey((yyvsp[(1) - (2)].ptr), (yyvsp[(2) - (2)].num)); } + break; + + case 25: +#line 197 "gram.y" + { GotButton((yyvsp[(1) - (2)].num), (yyvsp[(2) - (2)].num)); } + break; + + case 26: +#line 198 "gram.y" + { list = &Scr->DontIconify; } + break; + + case 28: +#line 200 "gram.y" + { list = &Scr->IconMgrNoShow; } + break; + + case 30: +#line 202 "gram.y" + { Scr->IconManagerDontShow = TRUE; } + break; + + case 31: +#line 203 "gram.y" + { list = &Scr->IconMgrs; } + break; + + case 33: +#line 205 "gram.y" + { list = &Scr->IconMgrShow; } + break; + + case 35: +#line 207 "gram.y" + { list = &Scr->NoTitleHighlight; } + break; + + case 37: +#line 209 "gram.y" + { if (Scr->FirstTime) + Scr->TitleHighlight = FALSE; } + break; + + case 38: +#line 211 "gram.y" + { list = &Scr->NoHighlight; } + break; + + case 40: +#line 213 "gram.y" + { if (Scr->FirstTime) + Scr->Highlight = FALSE; } + break; + + case 41: +#line 215 "gram.y" + { list = &Scr->NoStackModeL; } + break; + + case 43: +#line 217 "gram.y" + { if (Scr->FirstTime) + Scr->StackMode = FALSE; } + break; + + case 44: +#line 219 "gram.y" + { list = &Scr->NoTitle; } + break; + + case 46: +#line 221 "gram.y" + { if (Scr->FirstTime) + Scr->NoTitlebar = TRUE; } + break; + + case 47: +#line 223 "gram.y" + { list = &Scr->MakeTitle; } + break; + + case 49: +#line 225 "gram.y" + { list = &Scr->StartIconified; } + break; + + case 51: +#line 227 "gram.y" + { list = &Scr->AutoRaise; } + break; + + case 53: +#line 229 "gram.y" + { + root = GetRoot((yyvsp[(2) - (7)].ptr), (yyvsp[(4) - (7)].ptr), (yyvsp[(6) - (7)].ptr)); } + break; + + case 54: +#line 231 "gram.y" + { root->real_menu = TRUE;} + break; + + case 55: +#line 232 "gram.y" + { root = GetRoot((yyvsp[(2) - (2)].ptr), NULLSTR, NULLSTR); } + break; + + case 56: +#line 233 "gram.y" + { root->real_menu = TRUE; } + break; + + case 57: +#line 234 "gram.y" + { root = GetRoot((yyvsp[(2) - (2)].ptr), NULLSTR, NULLSTR); } + break; + + case 59: +#line 236 "gram.y" + { list = &Scr->IconNames; } + break; + + case 61: +#line 238 "gram.y" + { color = COLOR; } + break; + + case 63: +#line 240 "gram.y" + { color = GRAYSCALE; } + break; + + case 66: +#line 244 "gram.y" + { color = MONOCHROME; } + break; + + case 68: +#line 246 "gram.y" + { Scr->DefaultFunction.func = (yyvsp[(2) - (2)].num); + if ((yyvsp[(2) - (2)].num) == F_MENU) + { + pull->prev = NULL; + Scr->DefaultFunction.menu = pull; + } + else + { + root = GetRoot(TWM_ROOT,NULLSTR,NULLSTR); + Scr->DefaultFunction.item = + AddToMenu(root,"x",Action, + NULL,(yyvsp[(2) - (2)].num), NULLSTR, NULLSTR); + } + Action = ""; + pull = NULL; + } + break; + + case 69: +#line 262 "gram.y" + { Scr->WindowFunction.func = (yyvsp[(2) - (2)].num); + root = GetRoot(TWM_ROOT,NULLSTR,NULLSTR); + Scr->WindowFunction.item = + AddToMenu(root,"x",Action, + NULL,(yyvsp[(2) - (2)].num), NULLSTR, NULLSTR); + Action = ""; + pull = NULL; + } + break; + + case 70: +#line 270 "gram.y" + { list = &Scr->WarpCursorL; } + break; + + case 72: +#line 272 "gram.y" + { if (Scr->FirstTime) + Scr->WarpCursor = TRUE; } + break; + + case 73: +#line 274 "gram.y" + { list = &Scr->WindowRingL; } + break; + + case 75: +#line 279 "gram.y" + { if (!do_single_keyword ((yyvsp[(1) - (1)].num))) { + twmrc_error_prefix(); + fprintf (stderr, + "unknown singleton keyword %d\n", + (yyvsp[(1) - (1)].num)); + ParseError = 1; + } + } + break; + + case 76: +#line 289 "gram.y" + { if (!do_string_keyword ((yyvsp[(1) - (2)].num), (yyvsp[(2) - (2)].ptr))) { + twmrc_error_prefix(); + fprintf (stderr, + "unknown string keyword %d (value \"%s\")\n", + (yyvsp[(1) - (2)].num), (yyvsp[(2) - (2)].ptr)); + ParseError = 1; + } + } + break; + + case 77: +#line 299 "gram.y" + { if (!do_number_keyword ((yyvsp[(1) - (2)].num), (yyvsp[(2) - (2)].num))) { + twmrc_error_prefix(); + fprintf (stderr, + "unknown numeric keyword %d (value %d)\n", + (yyvsp[(1) - (2)].num), (yyvsp[(2) - (2)].num)); + ParseError = 1; + } + } + break; + + case 78: +#line 311 "gram.y" + { (yyval.num) = (yyvsp[(6) - (6)].num); } + break; + + case 79: +#line 314 "gram.y" + { (yyval.num) = (yyvsp[(6) - (6)].num); } + break; + + case 82: +#line 321 "gram.y" + { mods |= Mod1Mask; } + break; + + case 83: +#line 322 "gram.y" + { mods |= ShiftMask; } + break; + + case 84: +#line 323 "gram.y" + { mods |= LockMask; } + break; + + case 85: +#line 324 "gram.y" + { mods |= ControlMask; } + break; + + case 86: +#line 325 "gram.y" + { if ((yyvsp[(2) - (2)].num) < 1 || (yyvsp[(2) - (2)].num) > 5) { + twmrc_error_prefix(); + fprintf (stderr, + "bad modifier number (%d), must be 1-5\n", + (yyvsp[(2) - (2)].num)); + ParseError = 1; + } else { + mods |= (Mod1Mask << ((yyvsp[(2) - (2)].num) - 1)); + } + } + break; + + case 87: +#line 335 "gram.y" + { } + break; + + case 90: +#line 342 "gram.y" + { cont |= C_WINDOW_BIT; } + break; + + case 91: +#line 343 "gram.y" + { cont |= C_TITLE_BIT; } + break; + + case 92: +#line 344 "gram.y" + { cont |= C_ICON_BIT; } + break; + + case 93: +#line 345 "gram.y" + { cont |= C_ROOT_BIT; } + break; + + case 94: +#line 346 "gram.y" + { cont |= C_FRAME_BIT; } + break; + + case 95: +#line 347 "gram.y" + { cont |= C_ICONMGR_BIT; } + break; + + case 96: +#line 348 "gram.y" + { cont |= C_ICONMGR_BIT; } + break; + + case 97: +#line 349 "gram.y" + { cont |= C_ALL_BITS; } + break; + + case 98: +#line 350 "gram.y" + { } + break; + + case 101: +#line 357 "gram.y" + { cont |= C_WINDOW_BIT; } + break; + + case 102: +#line 358 "gram.y" + { cont |= C_TITLE_BIT; } + break; + + case 103: +#line 359 "gram.y" + { cont |= C_ICON_BIT; } + break; + + case 104: +#line 360 "gram.y" + { cont |= C_ROOT_BIT; } + break; + + case 105: +#line 361 "gram.y" + { cont |= C_FRAME_BIT; } + break; + + case 106: +#line 362 "gram.y" + { cont |= C_ICONMGR_BIT; } + break; + + case 107: +#line 363 "gram.y" + { cont |= C_ICONMGR_BIT; } + break; + + case 108: +#line 364 "gram.y" + { cont |= C_ALL_BITS; } + break; + + case 109: +#line 365 "gram.y" + { } + break; + + case 110: +#line 366 "gram.y" + { Name = (yyvsp[(1) - (1)].ptr); cont |= C_NAME_BIT; } + break; + + case 114: +#line 377 "gram.y" + { SetHighlightPixmap ((yyvsp[(2) - (2)].ptr)); } + break; + + case 118: +#line 388 "gram.y" + { + NewBitmapCursor(&Scr->FrameCursor, (yyvsp[(2) - (3)].ptr), (yyvsp[(3) - (3)].ptr)); } + break; + + case 119: +#line 390 "gram.y" + { + NewFontCursor(&Scr->FrameCursor, (yyvsp[(2) - (2)].ptr)); } + break; + + case 120: +#line 392 "gram.y" + { + NewBitmapCursor(&Scr->TitleCursor, (yyvsp[(2) - (3)].ptr), (yyvsp[(3) - (3)].ptr)); } + break; + + case 121: +#line 394 "gram.y" + { + NewFontCursor(&Scr->TitleCursor, (yyvsp[(2) - (2)].ptr)); } + break; + + case 122: +#line 396 "gram.y" + { + NewBitmapCursor(&Scr->IconCursor, (yyvsp[(2) - (3)].ptr), (yyvsp[(3) - (3)].ptr)); } + break; + + case 123: +#line 398 "gram.y" + { + NewFontCursor(&Scr->IconCursor, (yyvsp[(2) - (2)].ptr)); } + break; + + case 124: +#line 400 "gram.y" + { + NewBitmapCursor(&Scr->IconMgrCursor, (yyvsp[(2) - (3)].ptr), (yyvsp[(3) - (3)].ptr)); } + break; + + case 125: +#line 402 "gram.y" + { + NewFontCursor(&Scr->IconMgrCursor, (yyvsp[(2) - (2)].ptr)); } + break; + + case 126: +#line 404 "gram.y" + { + NewBitmapCursor(&Scr->ButtonCursor, (yyvsp[(2) - (3)].ptr), (yyvsp[(3) - (3)].ptr)); } + break; + + case 127: +#line 406 "gram.y" + { + NewFontCursor(&Scr->ButtonCursor, (yyvsp[(2) - (2)].ptr)); } + break; + + case 128: +#line 408 "gram.y" + { + NewBitmapCursor(&Scr->MoveCursor, (yyvsp[(2) - (3)].ptr), (yyvsp[(3) - (3)].ptr)); } + break; + + case 129: +#line 410 "gram.y" + { + NewFontCursor(&Scr->MoveCursor, (yyvsp[(2) - (2)].ptr)); } + break; + + case 130: +#line 412 "gram.y" + { + NewBitmapCursor(&Scr->ResizeCursor, (yyvsp[(2) - (3)].ptr), (yyvsp[(3) - (3)].ptr)); } + break; + + case 131: +#line 414 "gram.y" + { + NewFontCursor(&Scr->ResizeCursor, (yyvsp[(2) - (2)].ptr)); } + break; + + case 132: +#line 416 "gram.y" + { + NewBitmapCursor(&Scr->WaitCursor, (yyvsp[(2) - (3)].ptr), (yyvsp[(3) - (3)].ptr)); } + break; + + case 133: +#line 418 "gram.y" + { + NewFontCursor(&Scr->WaitCursor, (yyvsp[(2) - (2)].ptr)); } + break; + + case 134: +#line 420 "gram.y" + { + NewBitmapCursor(&Scr->MenuCursor, (yyvsp[(2) - (3)].ptr), (yyvsp[(3) - (3)].ptr)); } + break; + + case 135: +#line 422 "gram.y" + { + NewFontCursor(&Scr->MenuCursor, (yyvsp[(2) - (2)].ptr)); } + break; + + case 136: +#line 424 "gram.y" + { + NewBitmapCursor(&Scr->SelectCursor, (yyvsp[(2) - (3)].ptr), (yyvsp[(3) - (3)].ptr)); } + break; + + case 137: +#line 426 "gram.y" + { + NewFontCursor(&Scr->SelectCursor, (yyvsp[(2) - (2)].ptr)); } + break; + + case 138: +#line 428 "gram.y" + { + NewBitmapCursor(&Scr->DestroyCursor, (yyvsp[(2) - (3)].ptr), (yyvsp[(3) - (3)].ptr)); } + break; + + case 139: +#line 430 "gram.y" + { + NewFontCursor(&Scr->DestroyCursor, (yyvsp[(2) - (2)].ptr)); } + break; + + case 143: +#line 442 "gram.y" + { if (!do_colorlist_keyword ((yyvsp[(1) - (2)].num), color, + (yyvsp[(2) - (2)].ptr))) { + twmrc_error_prefix(); + fprintf (stderr, + "unhandled list color keyword %d (string \"%s\")\n", + (yyvsp[(1) - (2)].num), (yyvsp[(2) - (2)].ptr)); + ParseError = 1; + } + } + break; + + case 144: +#line 451 "gram.y" + { list = do_colorlist_keyword((yyvsp[(1) - (2)].num),color, + (yyvsp[(2) - (2)].ptr)); + if (!list) { + twmrc_error_prefix(); + fprintf (stderr, + "unhandled color list keyword %d (string \"%s\")\n", + (yyvsp[(1) - (2)].num), (yyvsp[(2) - (2)].ptr)); + ParseError = 1; + } + } + break; + + case 145: +#line 461 "gram.y" + { /* No action */; } + break; + + case 146: +#line 462 "gram.y" + { if (!do_color_keyword ((yyvsp[(1) - (2)].num), color, + (yyvsp[(2) - (2)].ptr))) { + twmrc_error_prefix(); + fprintf (stderr, + "unhandled color keyword %d (string \"%s\")\n", + (yyvsp[(1) - (2)].num), (yyvsp[(2) - (2)].ptr)); + ParseError = 1; + } + } + break; + + case 150: +#line 480 "gram.y" + { do_string_savecolor(color, (yyvsp[(1) - (1)].ptr)); } + break; + + case 151: +#line 481 "gram.y" + { do_var_savecolor((yyvsp[(1) - (1)].num)); } + break; + + case 155: +#line 491 "gram.y" + { if (Scr->FirstTime && + color == Scr->Monochrome) + AddToList(list, (yyvsp[(1) - (2)].ptr), (yyvsp[(2) - (2)].ptr)); } + break; + + case 156: +#line 496 "gram.y" + { + if (HasShape) Scr->SqueezeTitle = TRUE; + } + break; + + case 157: +#line 499 "gram.y" + { list = &Scr->SqueezeTitleL; + if (HasShape && Scr->SqueezeTitle == -1) + Scr->SqueezeTitle = TRUE; + } + break; + + case 159: +#line 504 "gram.y" + { Scr->SqueezeTitle = FALSE; } + break; + + case 160: +#line 505 "gram.y" + { list = &Scr->DontSqueezeTitleL; } + break; + + case 163: +#line 510 "gram.y" + { + if (Scr->FirstTime) { + do_squeeze_entry (list, (yyvsp[(2) - (5)].ptr), (yyvsp[(3) - (5)].num), (yyvsp[(4) - (5)].num), (yyvsp[(5) - (5)].num)); + } + } + break; + + case 167: +#line 525 "gram.y" + { if (Scr->FirstTime) + AddToList(list, (yyvsp[(1) - (3)].ptr), (char *) + AllocateIconManager((yyvsp[(1) - (3)].ptr), NULLSTR, + (yyvsp[(2) - (3)].ptr),(yyvsp[(3) - (3)].num))); + } + break; + + case 168: +#line 531 "gram.y" + { if (Scr->FirstTime) + AddToList(list, (yyvsp[(1) - (4)].ptr), (char *) + AllocateIconManager((yyvsp[(1) - (4)].ptr),(yyvsp[(2) - (4)].ptr), + (yyvsp[(3) - (4)].ptr), (yyvsp[(4) - (4)].num))); + } + break; + + case 172: +#line 545 "gram.y" + { if (Scr->FirstTime) + AddToList(list, (yyvsp[(1) - (1)].ptr), 0); + } + break; + + case 176: +#line 557 "gram.y" + { if (Scr->FirstTime) AddToList(list, (yyvsp[(1) - (2)].ptr), (yyvsp[(2) - (2)].ptr)); } + break; + + case 180: +#line 567 "gram.y" + { AddToMenu(root, "", Action, NULL, (yyvsp[(1) - (1)].num), + NULLSTR, NULLSTR); + Action = ""; + } + break; + + case 184: +#line 580 "gram.y" + { AddToMenu(root, (yyvsp[(1) - (2)].ptr), Action, pull, (yyvsp[(2) - (2)].num), + NULLSTR, NULLSTR); + Action = ""; + pull = NULL; + } + break; + + case 185: +#line 585 "gram.y" + { + AddToMenu(root, (yyvsp[(1) - (7)].ptr), Action, pull, (yyvsp[(7) - (7)].num), + (yyvsp[(3) - (7)].ptr), (yyvsp[(5) - (7)].ptr)); + Action = ""; + pull = NULL; + } + break; + + case 186: +#line 593 "gram.y" + { (yyval.num) = (yyvsp[(1) - (1)].num); } + break; + + case 187: +#line 594 "gram.y" + { + (yyval.num) = (yyvsp[(1) - (2)].num); + Action = (yyvsp[(2) - (2)].ptr); + switch ((yyvsp[(1) - (2)].num)) { + case F_MENU: + pull = GetRoot ((yyvsp[(2) - (2)].ptr), NULLSTR,NULLSTR); + pull->prev = root; + break; + case F_WARPRING: + if (!CheckWarpRingArg (Action)) { + twmrc_error_prefix(); + fprintf (stderr, + "ignoring invalid f.warptoring argument \"%s\"\n", + Action); + (yyval.num) = F_NOP; + } + case F_WARPTOSCREEN: + if (!CheckWarpScreenArg (Action)) { + twmrc_error_prefix(); + fprintf (stderr, + "ignoring invalid f.warptoscreen argument \"%s\"\n", + Action); + (yyval.num) = F_NOP; + } + break; + case F_COLORMAP: + if (CheckColormapArg (Action)) { + (yyval.num) = F_COLORMAP; + } else { + twmrc_error_prefix(); + fprintf (stderr, + "ignoring invalid f.colormap argument \"%s\"\n", + Action); + (yyval.num) = F_NOP; + } + break; + } /* end switch */ + } + break; + + case 188: +#line 635 "gram.y" + { (yyval.num) = (yyvsp[(1) - (1)].num); } + break; + + case 189: +#line 636 "gram.y" + { (yyval.num) = (yyvsp[(2) - (2)].num); } + break; + + case 190: +#line 637 "gram.y" + { (yyval.num) = -((yyvsp[(2) - (2)].num)); } + break; + + case 191: +#line 640 "gram.y" + { (yyval.num) = (yyvsp[(2) - (2)].num); + if ((yyvsp[(2) - (2)].num) == 0) + yyerror("bad button 0"); + + if ((yyvsp[(2) - (2)].num) > MAX_BUTTONS) + { + (yyval.num) = 0; + yyerror("button number too large"); + } + } + break; + + case 192: +#line 652 "gram.y" + { ptr = (char *)malloc(strlen((yyvsp[(1) - (1)].ptr))+1); + strcpy(ptr, (yyvsp[(1) - (1)].ptr)); + RemoveDQuote(ptr); + (yyval.ptr) = ptr; + } + break; + + case 193: +#line 658 "gram.y" + { (yyval.num) = (yyvsp[(1) - (1)].num); } + break; + + +/* Line 1267 of yacc.c. */ +#line 2658 "gram.c" + default: break; + } + YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc); + + YYPOPSTACK (yylen); + yylen = 0; + YY_STACK_PRINT (yyss, yyssp); + + *++yyvsp = yyval; + + + /* Now `shift' the result of the reduction. Determine what state + that goes to, based on the state we popped back to and the rule + number reduced by. */ + + yyn = yyr1[yyn]; + + yystate = yypgoto[yyn - YYNTOKENS] + *yyssp; + if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp) + yystate = yytable[yystate]; + else + yystate = yydefgoto[yyn - YYNTOKENS]; + + goto yynewstate; + + +/*------------------------------------. +| yyerrlab -- here on detecting error | +`------------------------------------*/ +yyerrlab: + /* If not already recovering from an error, report this error. */ + if (!yyerrstatus) + { + ++yynerrs; +#if ! YYERROR_VERBOSE + yyerror (YY_("syntax error")); +#else + { + YYSIZE_T yysize = yysyntax_error (0, yystate, yychar); + if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM) + { + YYSIZE_T yyalloc = 2 * yysize; + if (! (yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM)) + yyalloc = YYSTACK_ALLOC_MAXIMUM; + if (yymsg != yymsgbuf) + YYSTACK_FREE (yymsg); + yymsg = (char *) YYSTACK_ALLOC (yyalloc); + if (yymsg) + yymsg_alloc = yyalloc; + else + { + yymsg = yymsgbuf; + yymsg_alloc = sizeof yymsgbuf; + } + } + + if (0 < yysize && yysize <= yymsg_alloc) + { + (void) yysyntax_error (yymsg, yystate, yychar); + yyerror (yymsg); + } + else + { + yyerror (YY_("syntax error")); + if (yysize != 0) + goto yyexhaustedlab; + } + } +#endif + } + + + + if (yyerrstatus == 3) + { + /* If just tried and failed to reuse look-ahead token after an + error, discard it. */ + + if (yychar <= YYEOF) + { + /* Return failure if at end of input. */ + if (yychar == YYEOF) + YYABORT; + } + else + { + yydestruct ("Error: discarding", + yytoken, &yylval); + yychar = YYEMPTY; + } + } + + /* Else will try to reuse look-ahead token after shifting the error + token. */ + goto yyerrlab1; + + +/*---------------------------------------------------. +| yyerrorlab -- error raised explicitly by YYERROR. | +`---------------------------------------------------*/ +yyerrorlab: + + /* Pacify compilers like GCC when the user code never invokes + YYERROR and the label yyerrorlab therefore never appears in user + code. */ + if (/*CONSTCOND*/ 0) + goto yyerrorlab; + + /* Do not reclaim the symbols of the rule which action triggered + this YYERROR. */ + YYPOPSTACK (yylen); + yylen = 0; + YY_STACK_PRINT (yyss, yyssp); + yystate = *yyssp; + goto yyerrlab1; + + +/*-------------------------------------------------------------. +| yyerrlab1 -- common code for both syntax error and YYERROR. | +`-------------------------------------------------------------*/ +yyerrlab1: + yyerrstatus = 3; /* Each real token shifted decrements this. */ + + for (;;) + { + yyn = yypact[yystate]; + if (yyn != YYPACT_NINF) + { + yyn += YYTERROR; + if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR) + { + yyn = yytable[yyn]; + if (0 < yyn) + break; + } + } + + /* Pop the current state because it cannot handle the error token. */ + if (yyssp == yyss) + YYABORT; + + + yydestruct ("Error: popping", + yystos[yystate], yyvsp); + YYPOPSTACK (1); + yystate = *yyssp; + YY_STACK_PRINT (yyss, yyssp); + } + + if (yyn == YYFINAL) + YYACCEPT; + + *++yyvsp = yylval; + + + /* Shift the error token. */ + YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp); + + yystate = yyn; + goto yynewstate; + + +/*-------------------------------------. +| yyacceptlab -- YYACCEPT comes here. | +`-------------------------------------*/ +yyacceptlab: + yyresult = 0; + goto yyreturn; + +/*-----------------------------------. +| yyabortlab -- YYABORT comes here. | +`-----------------------------------*/ +yyabortlab: + yyresult = 1; + goto yyreturn; + +#ifndef yyoverflow +/*-------------------------------------------------. +| yyexhaustedlab -- memory exhaustion comes here. | +`-------------------------------------------------*/ +yyexhaustedlab: + yyerror (YY_("memory exhausted")); + yyresult = 2; + /* Fall through. */ +#endif + +yyreturn: + if (yychar != YYEOF && yychar != YYEMPTY) + yydestruct ("Cleanup: discarding lookahead", + yytoken, &yylval); + /* Do not reclaim the symbols of the rule which action triggered + this YYABORT or YYACCEPT. */ + YYPOPSTACK (yylen); + YY_STACK_PRINT (yyss, yyssp); + while (yyssp != yyss) + { + yydestruct ("Cleanup: popping", + yystos[*yyssp], yyvsp); + YYPOPSTACK (1); + } +#ifndef yyoverflow + if (yyss != yyssa) + YYSTACK_FREE (yyss); +#endif +#if YYERROR_VERBOSE + if (yymsg != yymsgbuf) + YYSTACK_FREE (yymsg); +#endif + /* Make sure YYID is used. */ + return YYID (yyresult); +} + + +#line 661 "gram.y" + +void +yyerror(char *s) +{ + twmrc_error_prefix(); + fprintf (stderr, "error in input file: %s\n", s ? s : ""); + ParseError = 1; +} + +void +RemoveDQuote(char *str) +{ + register char *i, *o; + register int n; + register int count; + + for (i=str+1, o=str; *i && *i != '\"'; o++) + { + if (*i == '\\') + { + switch (*++i) + { + case 'n': + *o = '\n'; + i++; + break; + case 'b': + *o = '\b'; + i++; + break; + case 'r': + *o = '\r'; + i++; + break; + case 't': + *o = '\t'; + i++; + break; + case 'f': + *o = '\f'; + i++; + break; + case '0': + if (*++i == 'x') + goto hex; + else + --i; + case '1': case '2': case '3': + case '4': case '5': case '6': case '7': + n = 0; + count = 0; + while (*i >= '0' && *i <= '7' && count < 3) + { + n = (n<<3) + (*i++ - '0'); + count++; + } + *o = n; + break; + hex: + case 'x': + n = 0; + count = 0; + while (i++, count++ < 2) + { + if (*i >= '0' && *i <= '9') + n = (n<<4) + (*i - '0'); + else if (*i >= 'a' && *i <= 'f') + n = (n<<4) + (*i - 'a') + 10; + else if (*i >= 'A' && *i <= 'F') + n = (n<<4) + (*i - 'A') + 10; + else + break; + } + *o = n; + break; + case '\n': + i++; /* punt */ + o--; /* to account for o++ at end of loop */ + break; + case '\"': + case '\'': + case '\\': + default: + *o = *i++; + break; + } + } + else + *o = *i++; + } + *o = '\0'; +} + +static MenuRoot *GetRoot(char *name, char* fore, char *back) +{ + MenuRoot *tmp; + + tmp = FindMenuRoot(name); + if (tmp == NULL) + tmp = NewMenuRoot(name); + + if (fore) + { + int save; + + save = Scr->FirstTime; + Scr->FirstTime = TRUE; + GetColor(COLOR, &tmp->hi_fore, fore); + GetColor(COLOR, &tmp->hi_back, back); + Scr->FirstTime = save; + } + + return tmp; +} + +static void GotButton(int butt, int func) +{ + int i; + + for (i = 0; i < NUM_CONTEXTS; i++) + { + if ((cont & (1 << i)) == 0) + continue; + + Scr->Mouse[butt][i][mods].func = func; + if (func == F_MENU) + { + pull->prev = NULL; + Scr->Mouse[butt][i][mods].menu = pull; + } + else + { + root = GetRoot(TWM_ROOT, NULLSTR, NULLSTR); + Scr->Mouse[butt][i][mods].item = AddToMenu(root,"x",Action, + NULL, func, NULLSTR, NULLSTR); + } + } + Action = ""; + pull = NULL; + cont = 0; + mods_used |= mods; + mods = 0; +} + +static void GotKey(char *key, int func) +{ + int i; + + for (i = 0; i < NUM_CONTEXTS; i++) + { + if ((cont & (1 << i)) == 0) + continue; + if (!AddFuncKey(key, i, mods, func, Name, Action)) + break; + } + + Action = ""; + pull = NULL; + cont = 0; + mods_used |= mods; + mods = 0; +} + + +static void GotTitleButton (char *bitmapname, int func, Bool rightside) +{ + if (!CreateTitleButton (bitmapname, func, Action, pull, rightside, True)) { + twmrc_error_prefix(); + fprintf (stderr, + "unable to create %s titlebutton \"%s\"\n", + rightside ? "right" : "left", bitmapname); + } + Action = ""; + pull = NULL; +} + +static Bool CheckWarpScreenArg (char *s) +{ + XmuCopyISOLatin1Lowered (s, s); + + if (strcmp (s, WARPSCREEN_NEXT) == 0 || + strcmp (s, WARPSCREEN_PREV) == 0 || + strcmp (s, WARPSCREEN_BACK) == 0) + return True; + + for (; *s && isascii(*s) && isdigit(*s); s++) ; /* SUPPRESS 530 */ + return (*s ? False : True); +} + + +static Bool CheckWarpRingArg (char *s) +{ + XmuCopyISOLatin1Lowered (s, s); + + if (strcmp (s, WARPSCREEN_NEXT) == 0 || + strcmp (s, WARPSCREEN_PREV) == 0) + return True; + + return False; +} + + +static Bool CheckColormapArg (char *s) +{ + XmuCopyISOLatin1Lowered (s, s); + + if (strcmp (s, COLORMAP_NEXT) == 0 || + strcmp (s, COLORMAP_PREV) == 0 || + strcmp (s, COLORMAP_DEFAULT) == 0) + return True; + + return False; +} + + +void +twmrc_error_prefix () +{ + fprintf (stderr, "%s: line %d: ", ProgramName, yylineno); +} + diff --git a/app/twm/src/gram.h b/app/twm/src/gram.h new file mode 100644 index 000000000..80cab5d04 --- /dev/null +++ b/app/twm/src/gram.h @@ -0,0 +1,209 @@ +/* A Bison parser, made by GNU Bison 2.3. */ + +/* Skeleton interface for Bison's Yacc-like parsers in C + + Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006 + Free Software Foundation, Inc. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. */ + +/* As a special exception, you may create a larger work that contains + part or all of the Bison parser skeleton and distribute that work + under terms of your choice, so long as that work isn't itself a + parser generator using the skeleton or a modified version thereof + as a parser skeleton. Alternatively, if you modify or redistribute + the parser skeleton itself, you may (at your option) remove this + special exception, which will cause the skeleton and the resulting + Bison output files to be licensed under the GNU General Public + License without this special exception. + + This special exception was added by the Free Software Foundation in + version 2.2 of Bison. */ + +/* Tokens. */ +#ifndef YYTOKENTYPE +# define YYTOKENTYPE + /* Put the tokens into the symbol table, so that GDB and other debuggers + know about them. */ + enum yytokentype { + LB = 258, + RB = 259, + LP = 260, + RP = 261, + MENUS = 262, + MENU = 263, + BUTTON = 264, + DEFAULT_FUNCTION = 265, + PLUS = 266, + MINUS = 267, + ALL = 268, + OR = 269, + CURSORS = 270, + PIXMAPS = 271, + ICONS = 272, + COLOR = 273, + SAVECOLOR = 274, + MONOCHROME = 275, + FUNCTION = 276, + ICONMGR_SHOW = 277, + ICONMGR = 278, + WINDOW_FUNCTION = 279, + ZOOM = 280, + ICONMGRS = 281, + ICONMGR_GEOMETRY = 282, + ICONMGR_NOSHOW = 283, + MAKE_TITLE = 284, + GRAYSCALE = 285, + ICONIFY_BY_UNMAPPING = 286, + DONT_ICONIFY_BY_UNMAPPING = 287, + NO_TITLE = 288, + AUTO_RAISE = 289, + NO_HILITE = 290, + ICON_REGION = 291, + META = 292, + SHIFT = 293, + LOCK = 294, + CONTROL = 295, + WINDOW = 296, + TITLE = 297, + ICON = 298, + ROOT = 299, + FRAME = 300, + COLON = 301, + EQUALS = 302, + SQUEEZE_TITLE = 303, + DONT_SQUEEZE_TITLE = 304, + START_ICONIFIED = 305, + NO_TITLE_HILITE = 306, + TITLE_HILITE = 307, + MOVE = 308, + RESIZE = 309, + WAIT = 310, + SELECT = 311, + KILL = 312, + LEFT_TITLEBUTTON = 313, + RIGHT_TITLEBUTTON = 314, + NUMBER = 315, + KEYWORD = 316, + NKEYWORD = 317, + CKEYWORD = 318, + CLKEYWORD = 319, + FKEYWORD = 320, + FSKEYWORD = 321, + SKEYWORD = 322, + DKEYWORD = 323, + JKEYWORD = 324, + WINDOW_RING = 325, + WARP_CURSOR = 326, + ERRORTOKEN = 327, + NO_STACKMODE = 328, + STRING = 329 + }; +#endif +/* Tokens. */ +#define LB 258 +#define RB 259 +#define LP 260 +#define RP 261 +#define MENUS 262 +#define MENU 263 +#define BUTTON 264 +#define DEFAULT_FUNCTION 265 +#define PLUS 266 +#define MINUS 267 +#define ALL 268 +#define OR 269 +#define CURSORS 270 +#define PIXMAPS 271 +#define ICONS 272 +#define COLOR 273 +#define SAVECOLOR 274 +#define MONOCHROME 275 +#define FUNCTION 276 +#define ICONMGR_SHOW 277 +#define ICONMGR 278 +#define WINDOW_FUNCTION 279 +#define ZOOM 280 +#define ICONMGRS 281 +#define ICONMGR_GEOMETRY 282 +#define ICONMGR_NOSHOW 283 +#define MAKE_TITLE 284 +#define GRAYSCALE 285 +#define ICONIFY_BY_UNMAPPING 286 +#define DONT_ICONIFY_BY_UNMAPPING 287 +#define NO_TITLE 288 +#define AUTO_RAISE 289 +#define NO_HILITE 290 +#define ICON_REGION 291 +#define META 292 +#define SHIFT 293 +#define LOCK 294 +#define CONTROL 295 +#define WINDOW 296 +#define TITLE 297 +#define ICON 298 +#define ROOT 299 +#define FRAME 300 +#define COLON 301 +#define EQUALS 302 +#define SQUEEZE_TITLE 303 +#define DONT_SQUEEZE_TITLE 304 +#define START_ICONIFIED 305 +#define NO_TITLE_HILITE 306 +#define TITLE_HILITE 307 +#define MOVE 308 +#define RESIZE 309 +#define WAIT 310 +#define SELECT 311 +#define KILL 312 +#define LEFT_TITLEBUTTON 313 +#define RIGHT_TITLEBUTTON 314 +#define NUMBER 315 +#define KEYWORD 316 +#define NKEYWORD 317 +#define CKEYWORD 318 +#define CLKEYWORD 319 +#define FKEYWORD 320 +#define FSKEYWORD 321 +#define SKEYWORD 322 +#define DKEYWORD 323 +#define JKEYWORD 324 +#define WINDOW_RING 325 +#define WARP_CURSOR 326 +#define ERRORTOKEN 327 +#define NO_STACKMODE 328 +#define STRING 329 + + + + +#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED +typedef union YYSTYPE +#line 104 "gram.y" +{ + int num; + char *ptr; +} +/* Line 1529 of yacc.c. */ +#line 202 "gram.h" + YYSTYPE; +# define yystype YYSTYPE /* obsolescent; will be withdrawn */ +# define YYSTYPE_IS_DECLARED 1 +# define YYSTYPE_IS_TRIVIAL 1 +#endif + +extern YYSTYPE yylval; + diff --git a/app/twm/src/gram.y b/app/twm/src/gram.y new file mode 100644 index 000000000..d623ddb7c --- /dev/null +++ b/app/twm/src/gram.y @@ -0,0 +1,880 @@ +/*****************************************************************************/ +/* + +Copyright 1989, 1998 The Open Group + +Permission to use, copy, modify, distribute, and sell this software and its +documentation for any purpose is hereby granted without fee, provided that +the above copyright notice appear in all copies and that both that +copyright notice and this permission notice appear in supporting +documentation. + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the name of The Open Group shall not be +used in advertising or otherwise to promote the sale, use or other dealings +in this Software without prior written authorization from The Open Group. + +*/ +/** Copyright 1988 by Evans & Sutherland Computer Corporation, **/ +/** Salt Lake City, Utah **/ +/** Cambridge, Massachusetts **/ +/** **/ +/** All Rights Reserved **/ +/** **/ +/** Permission to use, copy, modify, and distribute this software and **/ +/** its documentation for any purpose and without fee is hereby **/ +/** granted, provided that the above copyright notice appear in all **/ +/** copies and that both that copyright notice and this permis- **/ +/** sion notice appear in supporting documentation, and that the **/ +/** name of Evans & Sutherland not be used in advertising **/ +/** in publicity pertaining to distribution of the software without **/ +/** specific, written prior permission. **/ +/** **/ +/** EVANS & SUTHERLAND DISCLAIMs ALL WARRANTIES WITH REGARD **/ +/** TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANT- **/ +/** ABILITY AND FITNESS, IN NO EVENT SHALL EVANS & SUTHERLAND **/ +/** BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAM- **/ +/** AGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA **/ +/** OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER **/ +/** TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE **/ +/** OR PERFORMANCE OF THIS SOFTWARE. **/ +/*****************************************************************************/ + + +/*********************************************************************** + * + * $Xorg: gram.y,v 1.4 2001/02/09 02:05:36 xorgcvs Exp $ + * + * .twmrc command grammer + * + * 07-Jan-86 Thomas E. LaStrange File created + * 11-Nov-90 Dave Sternlicht Adding SaveColors + * 10-Oct-90 David M. Sternlicht Storing saved colors on root + * + * $XFree86: xc/programs/twm/gram.y,v 3.8 2002/10/16 21:33:03 tsi Exp $ + * + ***********************************************************************/ + +%{ +#include +#include +#include "twm.h" +#include "menus.h" +#include "list.h" +#include "util.h" +#include "screen.h" +#include "parse.h" +#include "add_window.h" +#include "icons.h" +#include +#include + +static char *Action = ""; +static char *Name = ""; +static MenuRoot *root, *pull = NULL; + +static MenuRoot *GetRoot ( char *name, char *fore, char *back ); +static void GotButton ( int butt, int func ); +static void GotKey ( char *key, int func ); +static void GotTitleButton ( char *bitmapname, int func, Bool rightside ); +static Bool CheckWarpScreenArg ( char *s ); +static Bool CheckWarpRingArg ( char *s ); +static Bool CheckColormapArg ( char *s ); + +static char *ptr; +static name_list **list; +static int cont = 0; +static int color; +int mods = 0; +unsigned int mods_used = (ShiftMask | ControlMask | Mod1Mask); + +extern int yylineno; +%} + +%union +{ + int num; + char *ptr; +}; + +%token LB RB LP RP MENUS MENU BUTTON DEFAULT_FUNCTION PLUS MINUS +%token ALL OR CURSORS PIXMAPS ICONS COLOR SAVECOLOR MONOCHROME FUNCTION +%token ICONMGR_SHOW ICONMGR WINDOW_FUNCTION ZOOM ICONMGRS +%token ICONMGR_GEOMETRY ICONMGR_NOSHOW MAKE_TITLE GRAYSCALE +%token ICONIFY_BY_UNMAPPING DONT_ICONIFY_BY_UNMAPPING +%token NO_TITLE AUTO_RAISE NO_HILITE ICON_REGION +%token META SHIFT LOCK CONTROL WINDOW TITLE ICON ROOT FRAME +%token COLON EQUALS SQUEEZE_TITLE DONT_SQUEEZE_TITLE +%token START_ICONIFIED NO_TITLE_HILITE TITLE_HILITE +%token MOVE RESIZE WAIT SELECT KILL LEFT_TITLEBUTTON RIGHT_TITLEBUTTON +%token NUMBER KEYWORD NKEYWORD CKEYWORD CLKEYWORD FKEYWORD FSKEYWORD +%token SKEYWORD DKEYWORD JKEYWORD WINDOW_RING WARP_CURSOR ERRORTOKEN +%token NO_STACKMODE +%token STRING + +%type string +%type pixmap_list cursor_list color_list save_color_list stmt +%type win_color_list iconm_list win_list icon_list function menu +%type noarg sarg error narg squeeze color_entry +%type action button number signed_number full fullkey + +%start twmrc + +%% +twmrc : stmts + ; + +stmts : /* Empty */ + | stmts stmt + ; + +stmt : error + | noarg + | sarg + | narg + | squeeze + | ICON_REGION string DKEYWORD DKEYWORD number number + { AddIconRegion($2, $3, $4, $5, $6); } + | ICONMGR_GEOMETRY string number { if (Scr->FirstTime) + { + Scr->iconmgr.geometry=$2; + Scr->iconmgr.columns=$3; + } + } + | ICONMGR_GEOMETRY string { if (Scr->FirstTime) + Scr->iconmgr.geometry = $2; + } + | ZOOM number { if (Scr->FirstTime) + { + Scr->DoZoom = TRUE; + Scr->ZoomCount = $2; + } + } + | ZOOM { if (Scr->FirstTime) + Scr->DoZoom = TRUE; } + | PIXMAPS pixmap_list {} + | CURSORS cursor_list {} + | ICONIFY_BY_UNMAPPING { list = &Scr->IconifyByUn; } + win_list + | ICONIFY_BY_UNMAPPING { if (Scr->FirstTime) + Scr->IconifyByUnmapping = TRUE; } + | LEFT_TITLEBUTTON string EQUALS action { + GotTitleButton ($2, $4, False); + } + | RIGHT_TITLEBUTTON string EQUALS action { + GotTitleButton ($2, $4, True); + } + | button string { root = GetRoot($2, NULLSTR, NULLSTR); + Scr->Mouse[$1][C_ROOT][0].func = F_MENU; + Scr->Mouse[$1][C_ROOT][0].menu = root; + } + | button action { Scr->Mouse[$1][C_ROOT][0].func = $2; + if ($2 == F_MENU) + { + pull->prev = NULL; + Scr->Mouse[$1][C_ROOT][0].menu = pull; + } + else + { + root = GetRoot(TWM_ROOT,NULLSTR,NULLSTR); + Scr->Mouse[$1][C_ROOT][0].item = + AddToMenu(root,"x",Action, + NULL,$2,NULLSTR,NULLSTR); + } + Action = ""; + pull = NULL; + } + | string fullkey { GotKey($1, $2); } + | button full { GotButton($1, $2); } + | DONT_ICONIFY_BY_UNMAPPING { list = &Scr->DontIconify; } + win_list + | ICONMGR_NOSHOW { list = &Scr->IconMgrNoShow; } + win_list + | ICONMGR_NOSHOW { Scr->IconManagerDontShow = TRUE; } + | ICONMGRS { list = &Scr->IconMgrs; } + iconm_list + | ICONMGR_SHOW { list = &Scr->IconMgrShow; } + win_list + | NO_TITLE_HILITE { list = &Scr->NoTitleHighlight; } + win_list + | NO_TITLE_HILITE { if (Scr->FirstTime) + Scr->TitleHighlight = FALSE; } + | NO_HILITE { list = &Scr->NoHighlight; } + win_list + | NO_HILITE { if (Scr->FirstTime) + Scr->Highlight = FALSE; } + | NO_STACKMODE { list = &Scr->NoStackModeL; } + win_list + | NO_STACKMODE { if (Scr->FirstTime) + Scr->StackMode = FALSE; } + | NO_TITLE { list = &Scr->NoTitle; } + win_list + | NO_TITLE { if (Scr->FirstTime) + Scr->NoTitlebar = TRUE; } + | MAKE_TITLE { list = &Scr->MakeTitle; } + win_list + | START_ICONIFIED { list = &Scr->StartIconified; } + win_list + | AUTO_RAISE { list = &Scr->AutoRaise; } + win_list + | MENU string LP string COLON string RP { + root = GetRoot($2, $4, $6); } + menu { root->real_menu = TRUE;} + | MENU string { root = GetRoot($2, NULLSTR, NULLSTR); } + menu { root->real_menu = TRUE; } + | FUNCTION string { root = GetRoot($2, NULLSTR, NULLSTR); } + function + | ICONS { list = &Scr->IconNames; } + icon_list + | COLOR { color = COLOR; } + color_list + | GRAYSCALE { color = GRAYSCALE; } + color_list + | SAVECOLOR + save_color_list + | MONOCHROME { color = MONOCHROME; } + color_list + | DEFAULT_FUNCTION action { Scr->DefaultFunction.func = $2; + if ($2 == F_MENU) + { + pull->prev = NULL; + Scr->DefaultFunction.menu = pull; + } + else + { + root = GetRoot(TWM_ROOT,NULLSTR,NULLSTR); + Scr->DefaultFunction.item = + AddToMenu(root,"x",Action, + NULL,$2, NULLSTR, NULLSTR); + } + Action = ""; + pull = NULL; + } + | WINDOW_FUNCTION action { Scr->WindowFunction.func = $2; + root = GetRoot(TWM_ROOT,NULLSTR,NULLSTR); + Scr->WindowFunction.item = + AddToMenu(root,"x",Action, + NULL,$2, NULLSTR, NULLSTR); + Action = ""; + pull = NULL; + } + | WARP_CURSOR { list = &Scr->WarpCursorL; } + win_list + | WARP_CURSOR { if (Scr->FirstTime) + Scr->WarpCursor = TRUE; } + | WINDOW_RING { list = &Scr->WindowRingL; } + win_list + ; + + +noarg : KEYWORD { if (!do_single_keyword ($1)) { + twmrc_error_prefix(); + fprintf (stderr, + "unknown singleton keyword %d\n", + $1); + ParseError = 1; + } + } + ; + +sarg : SKEYWORD string { if (!do_string_keyword ($1, $2)) { + twmrc_error_prefix(); + fprintf (stderr, + "unknown string keyword %d (value \"%s\")\n", + $1, $2); + ParseError = 1; + } + } + ; + +narg : NKEYWORD number { if (!do_number_keyword ($1, $2)) { + twmrc_error_prefix(); + fprintf (stderr, + "unknown numeric keyword %d (value %d)\n", + $1, $2); + ParseError = 1; + } + } + ; + + + +full : EQUALS keys COLON contexts COLON action { $$ = $6; } + ; + +fullkey : EQUALS keys COLON contextkeys COLON action { $$ = $6; } + ; + +keys : /* Empty */ + | keys key + ; + +key : META { mods |= Mod1Mask; } + | SHIFT { mods |= ShiftMask; } + | LOCK { mods |= LockMask; } + | CONTROL { mods |= ControlMask; } + | META number { if ($2 < 1 || $2 > 5) { + twmrc_error_prefix(); + fprintf (stderr, + "bad modifier number (%d), must be 1-5\n", + $2); + ParseError = 1; + } else { + mods |= (Mod1Mask << ($2 - 1)); + } + } + | OR { } + ; + +contexts : /* Empty */ + | contexts context + ; + +context : WINDOW { cont |= C_WINDOW_BIT; } + | TITLE { cont |= C_TITLE_BIT; } + | ICON { cont |= C_ICON_BIT; } + | ROOT { cont |= C_ROOT_BIT; } + | FRAME { cont |= C_FRAME_BIT; } + | ICONMGR { cont |= C_ICONMGR_BIT; } + | META { cont |= C_ICONMGR_BIT; } + | ALL { cont |= C_ALL_BITS; } + | OR { } + ; + +contextkeys : /* Empty */ + | contextkeys contextkey + ; + +contextkey : WINDOW { cont |= C_WINDOW_BIT; } + | TITLE { cont |= C_TITLE_BIT; } + | ICON { cont |= C_ICON_BIT; } + | ROOT { cont |= C_ROOT_BIT; } + | FRAME { cont |= C_FRAME_BIT; } + | ICONMGR { cont |= C_ICONMGR_BIT; } + | META { cont |= C_ICONMGR_BIT; } + | ALL { cont |= C_ALL_BITS; } + | OR { } + | string { Name = $1; cont |= C_NAME_BIT; } + ; + + +pixmap_list : LB pixmap_entries RB + ; + +pixmap_entries : /* Empty */ + | pixmap_entries pixmap_entry + ; + +pixmap_entry : TITLE_HILITE string { SetHighlightPixmap ($2); } + ; + + +cursor_list : LB cursor_entries RB + ; + +cursor_entries : /* Empty */ + | cursor_entries cursor_entry + ; + +cursor_entry : FRAME string string { + NewBitmapCursor(&Scr->FrameCursor, $2, $3); } + | FRAME string { + NewFontCursor(&Scr->FrameCursor, $2); } + | TITLE string string { + NewBitmapCursor(&Scr->TitleCursor, $2, $3); } + | TITLE string { + NewFontCursor(&Scr->TitleCursor, $2); } + | ICON string string { + NewBitmapCursor(&Scr->IconCursor, $2, $3); } + | ICON string { + NewFontCursor(&Scr->IconCursor, $2); } + | ICONMGR string string { + NewBitmapCursor(&Scr->IconMgrCursor, $2, $3); } + | ICONMGR string { + NewFontCursor(&Scr->IconMgrCursor, $2); } + | BUTTON string string { + NewBitmapCursor(&Scr->ButtonCursor, $2, $3); } + | BUTTON string { + NewFontCursor(&Scr->ButtonCursor, $2); } + | MOVE string string { + NewBitmapCursor(&Scr->MoveCursor, $2, $3); } + | MOVE string { + NewFontCursor(&Scr->MoveCursor, $2); } + | RESIZE string string { + NewBitmapCursor(&Scr->ResizeCursor, $2, $3); } + | RESIZE string { + NewFontCursor(&Scr->ResizeCursor, $2); } + | WAIT string string { + NewBitmapCursor(&Scr->WaitCursor, $2, $3); } + | WAIT string { + NewFontCursor(&Scr->WaitCursor, $2); } + | MENU string string { + NewBitmapCursor(&Scr->MenuCursor, $2, $3); } + | MENU string { + NewFontCursor(&Scr->MenuCursor, $2); } + | SELECT string string { + NewBitmapCursor(&Scr->SelectCursor, $2, $3); } + | SELECT string { + NewFontCursor(&Scr->SelectCursor, $2); } + | KILL string string { + NewBitmapCursor(&Scr->DestroyCursor, $2, $3); } + | KILL string { + NewFontCursor(&Scr->DestroyCursor, $2); } + ; + +color_list : LB color_entries RB + ; + + +color_entries : /* Empty */ + | color_entries color_entry + ; + +color_entry : CLKEYWORD string { if (!do_colorlist_keyword ($1, color, + $2)) { + twmrc_error_prefix(); + fprintf (stderr, + "unhandled list color keyword %d (string \"%s\")\n", + $1, $2); + ParseError = 1; + } + } + | CLKEYWORD string { list = do_colorlist_keyword($1,color, + $2); + if (!list) { + twmrc_error_prefix(); + fprintf (stderr, + "unhandled color list keyword %d (string \"%s\")\n", + $1, $2); + ParseError = 1; + } + } + win_color_list { /* No action */; } + | CKEYWORD string { if (!do_color_keyword ($1, color, + $2)) { + twmrc_error_prefix(); + fprintf (stderr, + "unhandled color keyword %d (string \"%s\")\n", + $1, $2); + ParseError = 1; + } + } + ; + +save_color_list : LB s_color_entries RB + ; + +s_color_entries : /* Empty */ + | s_color_entries s_color_entry + ; + +s_color_entry : string { do_string_savecolor(color, $1); } + | CLKEYWORD { do_var_savecolor($1); } + ; + +win_color_list : LB win_color_entries RB + ; + +win_color_entries : /* Empty */ + | win_color_entries win_color_entry + ; + +win_color_entry : string string { if (Scr->FirstTime && + color == Scr->Monochrome) + AddToList(list, $1, $2); } + ; + +squeeze : SQUEEZE_TITLE { + if (HasShape) Scr->SqueezeTitle = TRUE; + } + | SQUEEZE_TITLE { list = &Scr->SqueezeTitleL; + if (HasShape && Scr->SqueezeTitle == -1) + Scr->SqueezeTitle = TRUE; + } + LB win_sqz_entries RB + | DONT_SQUEEZE_TITLE { Scr->SqueezeTitle = FALSE; } + | DONT_SQUEEZE_TITLE { list = &Scr->DontSqueezeTitleL; } + win_list + ; + +win_sqz_entries : /* Empty */ + | win_sqz_entries string JKEYWORD signed_number number { + if (Scr->FirstTime) { + do_squeeze_entry (list, $2, $3, $4, $5); + } + } + ; + + +iconm_list : LB iconm_entries RB + ; + +iconm_entries : /* Empty */ + | iconm_entries iconm_entry + ; + +iconm_entry : string string number { if (Scr->FirstTime) + AddToList(list, $1, (char *) + AllocateIconManager($1, NULLSTR, + $2,$3)); + } + | string string string number + { if (Scr->FirstTime) + AddToList(list, $1, (char *) + AllocateIconManager($1,$2, + $3, $4)); + } + ; + +win_list : LB win_entries RB + ; + +win_entries : /* Empty */ + | win_entries win_entry + ; + +win_entry : string { if (Scr->FirstTime) + AddToList(list, $1, 0); + } + ; + +icon_list : LB icon_entries RB + ; + +icon_entries : /* Empty */ + | icon_entries icon_entry + ; + +icon_entry : string string { if (Scr->FirstTime) AddToList(list, $1, $2); } + ; + +function : LB function_entries RB + ; + +function_entries: /* Empty */ + | function_entries function_entry + ; + +function_entry : action { AddToMenu(root, "", Action, NULL, $1, + NULLSTR, NULLSTR); + Action = ""; + } + ; + +menu : LB menu_entries RB + ; + +menu_entries : /* Empty */ + | menu_entries menu_entry + ; + +menu_entry : string action { AddToMenu(root, $1, Action, pull, $2, + NULLSTR, NULLSTR); + Action = ""; + pull = NULL; + } + | string LP string COLON string RP action { + AddToMenu(root, $1, Action, pull, $7, + $3, $5); + Action = ""; + pull = NULL; + } + ; + +action : FKEYWORD { $$ = $1; } + | FSKEYWORD string { + $$ = $1; + Action = $2; + switch ($1) { + case F_MENU: + pull = GetRoot ($2, NULLSTR,NULLSTR); + pull->prev = root; + break; + case F_WARPRING: + if (!CheckWarpRingArg (Action)) { + twmrc_error_prefix(); + fprintf (stderr, + "ignoring invalid f.warptoring argument \"%s\"\n", + Action); + $$ = F_NOP; + } + case F_WARPTOSCREEN: + if (!CheckWarpScreenArg (Action)) { + twmrc_error_prefix(); + fprintf (stderr, + "ignoring invalid f.warptoscreen argument \"%s\"\n", + Action); + $$ = F_NOP; + } + break; + case F_COLORMAP: + if (CheckColormapArg (Action)) { + $$ = F_COLORMAP; + } else { + twmrc_error_prefix(); + fprintf (stderr, + "ignoring invalid f.colormap argument \"%s\"\n", + Action); + $$ = F_NOP; + } + break; + } /* end switch */ + } + ; + + +signed_number : number { $$ = $1; } + | PLUS number { $$ = $2; } + | MINUS number { $$ = -($2); } + ; + +button : BUTTON number { $$ = $2; + if ($2 == 0) + yyerror("bad button 0"); + + if ($2 > MAX_BUTTONS) + { + $$ = 0; + yyerror("button number too large"); + } + } + ; + +string : STRING { ptr = (char *)malloc(strlen($1)+1); + strcpy(ptr, $1); + RemoveDQuote(ptr); + $$ = ptr; + } + ; +number : NUMBER { $$ = $1; } + ; + +%% +void +yyerror(char *s) +{ + twmrc_error_prefix(); + fprintf (stderr, "error in input file: %s\n", s ? s : ""); + ParseError = 1; +} + +void +RemoveDQuote(char *str) +{ + register char *i, *o; + register int n; + register int count; + + for (i=str+1, o=str; *i && *i != '\"'; o++) + { + if (*i == '\\') + { + switch (*++i) + { + case 'n': + *o = '\n'; + i++; + break; + case 'b': + *o = '\b'; + i++; + break; + case 'r': + *o = '\r'; + i++; + break; + case 't': + *o = '\t'; + i++; + break; + case 'f': + *o = '\f'; + i++; + break; + case '0': + if (*++i == 'x') + goto hex; + else + --i; + case '1': case '2': case '3': + case '4': case '5': case '6': case '7': + n = 0; + count = 0; + while (*i >= '0' && *i <= '7' && count < 3) + { + n = (n<<3) + (*i++ - '0'); + count++; + } + *o = n; + break; + hex: + case 'x': + n = 0; + count = 0; + while (i++, count++ < 2) + { + if (*i >= '0' && *i <= '9') + n = (n<<4) + (*i - '0'); + else if (*i >= 'a' && *i <= 'f') + n = (n<<4) + (*i - 'a') + 10; + else if (*i >= 'A' && *i <= 'F') + n = (n<<4) + (*i - 'A') + 10; + else + break; + } + *o = n; + break; + case '\n': + i++; /* punt */ + o--; /* to account for o++ at end of loop */ + break; + case '\"': + case '\'': + case '\\': + default: + *o = *i++; + break; + } + } + else + *o = *i++; + } + *o = '\0'; +} + +static MenuRoot *GetRoot(char *name, char* fore, char *back) +{ + MenuRoot *tmp; + + tmp = FindMenuRoot(name); + if (tmp == NULL) + tmp = NewMenuRoot(name); + + if (fore) + { + int save; + + save = Scr->FirstTime; + Scr->FirstTime = TRUE; + GetColor(COLOR, &tmp->hi_fore, fore); + GetColor(COLOR, &tmp->hi_back, back); + Scr->FirstTime = save; + } + + return tmp; +} + +static void GotButton(int butt, int func) +{ + int i; + + for (i = 0; i < NUM_CONTEXTS; i++) + { + if ((cont & (1 << i)) == 0) + continue; + + Scr->Mouse[butt][i][mods].func = func; + if (func == F_MENU) + { + pull->prev = NULL; + Scr->Mouse[butt][i][mods].menu = pull; + } + else + { + root = GetRoot(TWM_ROOT, NULLSTR, NULLSTR); + Scr->Mouse[butt][i][mods].item = AddToMenu(root,"x",Action, + NULL, func, NULLSTR, NULLSTR); + } + } + Action = ""; + pull = NULL; + cont = 0; + mods_used |= mods; + mods = 0; +} + +static void GotKey(char *key, int func) +{ + int i; + + for (i = 0; i < NUM_CONTEXTS; i++) + { + if ((cont & (1 << i)) == 0) + continue; + if (!AddFuncKey(key, i, mods, func, Name, Action)) + break; + } + + Action = ""; + pull = NULL; + cont = 0; + mods_used |= mods; + mods = 0; +} + + +static void GotTitleButton (char *bitmapname, int func, Bool rightside) +{ + if (!CreateTitleButton (bitmapname, func, Action, pull, rightside, True)) { + twmrc_error_prefix(); + fprintf (stderr, + "unable to create %s titlebutton \"%s\"\n", + rightside ? "right" : "left", bitmapname); + } + Action = ""; + pull = NULL; +} + +static Bool CheckWarpScreenArg (char *s) +{ + XmuCopyISOLatin1Lowered (s, s); + + if (strcmp (s, WARPSCREEN_NEXT) == 0 || + strcmp (s, WARPSCREEN_PREV) == 0 || + strcmp (s, WARPSCREEN_BACK) == 0) + return True; + + for (; *s && isascii(*s) && isdigit(*s); s++) ; /* SUPPRESS 530 */ + return (*s ? False : True); +} + + +static Bool CheckWarpRingArg (char *s) +{ + XmuCopyISOLatin1Lowered (s, s); + + if (strcmp (s, WARPSCREEN_NEXT) == 0 || + strcmp (s, WARPSCREEN_PREV) == 0) + return True; + + return False; +} + + +static Bool CheckColormapArg (char *s) +{ + XmuCopyISOLatin1Lowered (s, s); + + if (strcmp (s, COLORMAP_NEXT) == 0 || + strcmp (s, COLORMAP_PREV) == 0 || + strcmp (s, COLORMAP_DEFAULT) == 0) + return True; + + return False; +} + + +void +twmrc_error_prefix () +{ + fprintf (stderr, "%s: line %d: ", ProgramName, yylineno); +} diff --git a/app/twm/src/iconmgr.c b/app/twm/src/iconmgr.c new file mode 100644 index 000000000..b90b6654b --- /dev/null +++ b/app/twm/src/iconmgr.c @@ -0,0 +1,695 @@ +/* + * +Copyright 1989,1998 The Open Group + +Permission to use, copy, modify, distribute, and sell this software and its +documentation for any purpose is hereby granted without fee, provided that +the above copyright notice appear in all copies and that both that +copyright notice and this permission notice appear in supporting +documentation. + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the name of The Open Group shall not be +used in advertising or otherwise to promote the sale, use or other dealings +in this Software without prior written authorization from The Open Group. + * */ +/* $XFree86: xc/programs/twm/iconmgr.c,v 1.5 2001/01/17 23:45:06 dawes Exp $ */ + +/*********************************************************************** + * + * $Xorg: iconmgr.c,v 1.4 2001/02/09 02:05:36 xorgcvs Exp $ + * + * Icon Manager routines + * + * 09-Mar-89 Tom LaStrange File Created + * + ***********************************************************************/ +/* $XFree86: xc/programs/twm/iconmgr.c,v 1.5 2001/01/17 23:45:06 dawes Exp $ */ + +#include +#include "twm.h" +#include "util.h" +#include "parse.h" +#include "screen.h" +#include "resize.h" +#include "add_window.h" +#include "siconify.bm" +#include +#include +#ifdef macII +int strcmp(); /* missing from string.h in AUX 2.0 */ +#endif + +int iconmgr_textx = siconify_width+11; +WList *Active = NULL; +WList *DownIconManager = NULL; +int iconifybox_width = siconify_width; +int iconifybox_height = siconify_height; + +/** + * create all the icon manager windows for this screen. + */ +void CreateIconManagers() +{ + IconMgr *p; + int mask; + char str[100]; + char str1[100]; + Pixel background; + char *icon_name; + + if (Scr->NoIconManagers) + return; + + if (Scr->siconifyPm == None) + { + Scr->siconifyPm = XCreatePixmapFromBitmapData(dpy, Scr->Root, + (char *)siconify_bits, siconify_width, siconify_height, 1, 0, 1); + } + + for (p = &Scr->iconmgr; p != NULL; p = p->next) + { + mask = XParseGeometry(p->geometry, &JunkX, &JunkY, + (unsigned int *) &p->width, (unsigned int *)&p->height); + + if (mask & XNegative) + JunkX = Scr->MyDisplayWidth - p->width - + (2 * Scr->BorderWidth) + JunkX; + + if (mask & YNegative) + JunkY = Scr->MyDisplayHeight - p->height - + (2 * Scr->BorderWidth) + JunkY; + + background = Scr->IconManagerC.back; + GetColorFromList(Scr->IconManagerBL, p->name, (XClassHint *)NULL, + &background); + + p->w = XCreateSimpleWindow(dpy, Scr->Root, + JunkX, JunkY, p->width, p->height, 1, + Scr->Black, background); + + sprintf(str, "%s Icon Manager", p->name); + sprintf(str1, "%s Icons", p->name); + if (p->icon_name) + icon_name = p->icon_name; + else + icon_name = str1; + + XSetStandardProperties(dpy, p->w, str, icon_name, None, NULL, 0, NULL); + + p->twm_win = AddWindow(p->w, TRUE, p); + SetMapStateProp (p->twm_win, WithdrawnState); + } + for (p = &Scr->iconmgr; p != NULL; p = p->next) + { + GrabButtons(p->twm_win); + GrabKeys(p->twm_win); + } +} + +/** + * allocate a new icon manager + * + * \param name the name of this icon manager + * \param con_name the name of the associated icon + * \param geom a geometry string to eventually parse + * \param columns the number of columns this icon manager has + */ +IconMgr *AllocateIconManager(char *name, char *icon_name, char *geom, int columns) +{ + IconMgr *p; + +#ifdef DEBUG_ICONMGR + fprintf(stderr, "AllocateIconManager\n"); + fprintf(stderr, " name=\"%s\" icon_name=\"%s\", geom=\"%s\", col=%d\n", + name, icon_name, geom, columns); +#endif + + if (Scr->NoIconManagers) + return NULL; + + p = (IconMgr *)malloc(sizeof(IconMgr)); + p->name = name; + p->icon_name = icon_name; + p->geometry = geom; + p->columns = columns; + p->first = NULL; + p->last = NULL; + p->active = NULL; + p->scr = Scr; + p->count = 0; + p->x = 0; + p->y = 0; + p->width = 150; + p->height = 10; + + Scr->iconmgr.lasti->next = p; + p->prev = Scr->iconmgr.lasti; + Scr->iconmgr.lasti = p; + p->next = NULL; + + return(p); +} + +/** + * move the pointer around in an icon manager + * + * \param dir one of the following: + * - F_FORWICONMGR: forward in the window list + * - F_BACKICONMGR: backward in the window list + * - F_UPICONMGR: up one row + * - F_DOWNICONMG: down one row + * - F_LEFTICONMGR: left one column + * - F_RIGHTICONMGR: right one column + */ +void MoveIconManager(int dir) +{ + IconMgr *ip; + WList *tmp = NULL; + int cur_row, cur_col, new_row, new_col; + int row_inc, col_inc; + int got_it; + + if (!Active) return; + + cur_row = Active->row; + cur_col = Active->col; + ip = Active->iconmgr; + + row_inc = 0; + col_inc = 0; + got_it = FALSE; + + switch (dir) + { + case F_FORWICONMGR: + if ((tmp = Active->next) == NULL) + tmp = ip->first; + got_it = TRUE; + break; + + case F_BACKICONMGR: + if ((tmp = Active->prev) == NULL) + tmp = ip->last; + got_it = TRUE; + break; + + case F_UPICONMGR: + row_inc = -1; + break; + + case F_DOWNICONMGR: + row_inc = 1; + break; + + case F_LEFTICONMGR: + col_inc = -1; + break; + + case F_RIGHTICONMGR: + col_inc = 1; + break; + } + + /* If got_it is FALSE ast this point then we got a left, right, + * up, or down, command. We will enter this loop until we find + * a window to warp to. + */ + new_row = cur_row; + new_col = cur_col; + + while (!got_it) + { + new_row += row_inc; + new_col += col_inc; + if (new_row < 0) + new_row = ip->cur_rows - 1; + if (new_col < 0) + new_col = ip->cur_columns - 1; + if (new_row >= ip->cur_rows) + new_row = 0; + if (new_col >= ip->cur_columns) + new_col = 0; + + /* Now let's go through the list to see if there is an entry with this + * new position + */ + for (tmp = ip->first; tmp != NULL; tmp = tmp->next) + { + if (tmp->row == new_row && tmp->col == new_col) + { + got_it = TRUE; + break; + } + } + } + + if (!got_it) + { + fprintf (stderr, + "%s: unable to find window (%d, %d) in icon manager\n", + ProgramName, new_row, new_col); + return; + } + + if (tmp == NULL) + return; + + /* raise the frame so the icon manager is visible */ + if (ip->twm_win->mapped) { + XRaiseWindow(dpy, ip->twm_win->frame); + XWarpPointer(dpy, None, tmp->icon, 0,0,0,0, 5, 5); + } else { + if (tmp->twm->title_height) { + int tbx = Scr->TBInfo.titlex; + int x = tmp->twm->highlightx; + XWarpPointer (dpy, None, tmp->twm->title_w, 0, 0, 0, 0, + tbx + (x - tbx) / 2, + Scr->TitleHeight / 4); + } else { + XWarpPointer (dpy, None, tmp->twm->w, 0, 0, 0, 0, 5, 5); + } + } +} + +/** + * jump from one icon manager to another, possibly even on another screen + * \param dir one of the following: + * - F_NEXTICONMGR - go to the next icon manager + * - F_PREVICONMGR - go to the previous one + */ + +void JumpIconManager(int dir) +{ + IconMgr *ip, *tmp_ip = NULL; + int got_it = FALSE; + ScreenInfo *sp; + int screen; + + if (!Active) return; + + +#define ITER(i) (dir == F_NEXTICONMGR ? (i)->next : (i)->prev) +#define IPOFSP(sp) (dir == F_NEXTICONMGR ? &(sp->iconmgr) : sp->iconmgr.lasti) +#define TEST(ip) if ((ip)->count != 0 && (ip)->twm_win->mapped) \ + { got_it = TRUE; break; } + + ip = Active->iconmgr; + for (tmp_ip = ITER(ip); tmp_ip; tmp_ip = ITER(tmp_ip)) { + TEST (tmp_ip); + } + + if (!got_it) { + int origscreen = ip->scr->screen; + int inc = (dir == F_NEXTICONMGR ? 1 : -1); + + for (screen = origscreen + inc; ; screen += inc) { + if (screen >= NumScreens) + screen = 0; + else if (screen < 0) + screen = NumScreens - 1; + + sp = ScreenList[screen]; + if (sp) { + for (tmp_ip = IPOFSP (sp); tmp_ip; tmp_ip = ITER(tmp_ip)) { + TEST (tmp_ip); + } + } + if (got_it || screen == origscreen) break; + } + } + +#undef ITER +#undef IPOFSP +#undef TEST + + if (!got_it) { + Bell(XkbBI_MinorError,0,None); + return; + } + + /* raise the frame so it is visible */ + XRaiseWindow(dpy, tmp_ip->twm_win->frame); + if (tmp_ip->active) + XWarpPointer(dpy, None, tmp_ip->active->icon, 0,0,0,0, 5, 5); + else + XWarpPointer(dpy, None, tmp_ip->w, 0,0,0,0, 5, 5); +} + +/** + * add a window to an icon manager + * + * \param tmp_win the TwmWindow structure + */ +WList *AddIconManager(TwmWindow *tmp_win) +{ + WList *tmp; + int h; + unsigned long valuemask; /* mask for create windows */ + XSetWindowAttributes attributes; /* attributes for create windows */ + IconMgr *ip; + + tmp_win->list = NULL; + + if (tmp_win->iconmgr || tmp_win->transient || Scr->NoIconManagers) + return NULL; + + if (LookInList(Scr->IconMgrNoShow, tmp_win->full_name, &tmp_win->class)) + return NULL; + if (Scr->IconManagerDontShow && + !LookInList(Scr->IconMgrShow, tmp_win->full_name, &tmp_win->class)) + return NULL; + if ((ip = (IconMgr *)LookInList(Scr->IconMgrs, tmp_win->full_name, + &tmp_win->class)) == NULL) + ip = &Scr->iconmgr; + + tmp = (WList *) malloc(sizeof(WList)); + tmp->iconmgr = ip; + tmp->next = NULL; + tmp->active = FALSE; + tmp->down = FALSE; + + InsertInIconManager(ip, tmp, tmp_win); + + tmp->twm = tmp_win; + + tmp->fore = Scr->IconManagerC.fore; + tmp->back = Scr->IconManagerC.back; + tmp->highlight = Scr->IconManagerHighlight; + + GetColorFromList(Scr->IconManagerFL, tmp_win->full_name, &tmp_win->class, + &tmp->fore); + GetColorFromList(Scr->IconManagerBL, tmp_win->full_name, &tmp_win->class, + &tmp->back); + GetColorFromList(Scr->IconManagerHighlightL, tmp_win->full_name, + &tmp_win->class, &tmp->highlight); + + h = Scr->IconManagerFont.height + 10; + if (h < (siconify_height + 4)) + h = siconify_height + 4; + + ip->height = h * ip->count; + tmp->me = ip->count; + tmp->x = -1; + tmp->y = -1; + + valuemask = (CWBackPixel | CWBorderPixel | CWEventMask | CWCursor); + attributes.background_pixel = tmp->back; + attributes.border_pixel = tmp->back; + attributes.event_mask = (KeyPressMask | ButtonPressMask | + ButtonReleaseMask | ExposureMask | + EnterWindowMask | LeaveWindowMask); + attributes.cursor = Scr->IconMgrCursor; + tmp->w = XCreateWindow (dpy, ip->w, 0, 0, (unsigned int) 1, + (unsigned int) h, (unsigned int) 0, + CopyFromParent, (unsigned int) CopyFromParent, + (Visual *) CopyFromParent, valuemask, &attributes); + + + valuemask = (CWBackPixel | CWBorderPixel | CWEventMask | CWCursor); + attributes.background_pixel = tmp->back; + attributes.border_pixel = Scr->Black; + attributes.event_mask = (ButtonReleaseMask| ButtonPressMask | + ExposureMask); + attributes.cursor = Scr->ButtonCursor; + tmp->icon = XCreateWindow (dpy, tmp->w, 5, (int) (h - siconify_height)/2, + (unsigned int) siconify_width, + (unsigned int) siconify_height, + (unsigned int) 0, CopyFromParent, + (unsigned int) CopyFromParent, + (Visual *) CopyFromParent, + valuemask, &attributes); + + ip->count += 1; + PackIconManager(ip); + XMapWindow(dpy, tmp->w); + + XSaveContext(dpy, tmp->w, IconManagerContext, (caddr_t) tmp); + XSaveContext(dpy, tmp->w, TwmContext, (caddr_t) tmp_win); + XSaveContext(dpy, tmp->w, ScreenContext, (caddr_t) Scr); + XSaveContext(dpy, tmp->icon, TwmContext, (caddr_t) tmp_win); + XSaveContext(dpy, tmp->icon, ScreenContext, (caddr_t) Scr); + tmp_win->list = tmp; + + if (!ip->twm_win->icon) + { + XMapWindow(dpy, ip->w); + XMapWindow(dpy, ip->twm_win->frame); + } + + if (Active == NULL) Active = tmp; + + return (tmp); +} + +/** + * put an allocated entry into an icon manager + * + * \param ip the icon manager pointer + * \param tmp the entry to insert + */ +void InsertInIconManager(IconMgr *ip, WList *tmp, TwmWindow *tmp_win) +{ + WList *tmp1; + int added; + int (*compar)(const char *, const char *) + = (Scr->CaseSensitive ? strcmp : XmuCompareISOLatin1); + + added = FALSE; + if (ip->first == NULL) + { + ip->first = tmp; + tmp->prev = NULL; + ip->last = tmp; + added = TRUE; + } + else if (Scr->SortIconMgr) + { + for (tmp1 = ip->first; tmp1 != NULL; tmp1 = tmp1->next) + { + if ((*compar)(tmp_win->icon_name, tmp1->twm->icon_name) < 0) + { + tmp->next = tmp1; + tmp->prev = tmp1->prev; + tmp1->prev = tmp; + if (tmp->prev == NULL) + ip->first = tmp; + else + tmp->prev->next = tmp; + added = TRUE; + break; + } + } + } + + if (!added) + { + ip->last->next = tmp; + tmp->prev = ip->last; + ip->last = tmp; + } +} + +void RemoveFromIconManager(IconMgr *ip, WList *tmp) +{ + if (tmp->prev == NULL) + ip->first = tmp->next; + else + tmp->prev->next = tmp->next; + + if (tmp->next == NULL) + ip->last = tmp->prev; + else + tmp->next->prev = tmp->prev; +} + +/** + * remove a window from the icon manager + * \param tmp_win the TwmWindow structure + */ +void RemoveIconManager(TwmWindow *tmp_win) +{ + IconMgr *ip; + WList *tmp; + + if (tmp_win->list == NULL) + return; + + tmp = tmp_win->list; + tmp_win->list = NULL; + ip = tmp->iconmgr; + + RemoveFromIconManager(ip, tmp); + + XDeleteContext(dpy, tmp->icon, TwmContext); + XDeleteContext(dpy, tmp->icon, ScreenContext); + XDestroyWindow(dpy, tmp->icon); + XDeleteContext(dpy, tmp->w, IconManagerContext); + XDeleteContext(dpy, tmp->w, TwmContext); + XDeleteContext(dpy, tmp->w, ScreenContext); + XDestroyWindow(dpy, tmp->w); + ip->count -= 1; + free((char *) tmp); + + PackIconManager(ip); + + if (ip->count == 0) + { + XUnmapWindow(dpy, ip->twm_win->frame); + } + +} + +void ActiveIconManager(WList *active) +{ + active->active = TRUE; + Active = active; + Active->iconmgr->active = active; + DrawIconManagerBorder(active); +} + +void NotActiveIconManager(WList *active) +{ + active->active = FALSE; + DrawIconManagerBorder(active); +} + +void DrawIconManagerBorder(WList *tmp) +{ + { + XSetForeground(dpy, Scr->NormalGC, tmp->fore); + XDrawRectangle(dpy, tmp->w, Scr->NormalGC, 2, 2, + tmp->width-5, tmp->height-5); + + if (tmp->active && Scr->Highlight) + XSetForeground(dpy, Scr->NormalGC, tmp->highlight); + else + XSetForeground(dpy, Scr->NormalGC, tmp->back); + + XDrawRectangle(dpy, tmp->w, Scr->NormalGC, 0, 0, + tmp->width-1, tmp->height-1); + XDrawRectangle(dpy, tmp->w, Scr->NormalGC, 1, 1, + tmp->width-3, tmp->height-3); + } +} + +/** + * sort The Dude + * + * \param ip a pointer to the icon manager struture + */ +void SortIconManager(IconMgr *ip) +{ + WList *tmp1, *tmp2; + int done; + int (*compar)(const char *, const char *) + = (Scr->CaseSensitive ? strcmp : XmuCompareISOLatin1); + + if (ip == NULL) + ip = Active->iconmgr; + + done = FALSE; + do + { + for (tmp1 = ip->first; tmp1 != NULL; tmp1 = tmp1->next) + { + if ((tmp2 = tmp1->next) == NULL) + { + done = TRUE; + break; + } + if ((*compar)(tmp1->twm->icon_name, tmp2->twm->icon_name) > 0) + { + /* take it out and put it back in */ + RemoveFromIconManager(ip, tmp2); + InsertInIconManager(ip, tmp2, tmp2->twm); + break; + } + } + } + while (!done); + PackIconManager(ip); +} + +/** + * pack the icon manager windows following + * an addition or deletion + * + * \param ip a pointer to the icon manager struture + */ +void PackIconManager(IconMgr *ip) +{ + int newwidth, i, row, col, maxcol, colinc, rowinc, wheight, wwidth; + int new_x, new_y; + int savewidth; + WList *tmp; + + wheight = Scr->IconManagerFont.height + 10; + if (wheight < (siconify_height + 4)) + wheight = siconify_height + 4; + + wwidth = ip->width / ip->columns; + + rowinc = wheight; + colinc = wwidth; + + row = 0; + col = ip->columns; + maxcol = 0; + for (i = 0, tmp = ip->first; tmp != NULL; i++, tmp = tmp->next) + { + tmp->me = i; + if (++col >= ip->columns) + { + col = 0; + row += 1; + } + if (col > maxcol) + maxcol = col; + + new_x = col * colinc; + new_y = (row-1) * rowinc; + + /* if the position or size has not changed, don't touch it */ + if (tmp->x != new_x || tmp->y != new_y || + tmp->width != wwidth || tmp->height != wheight) + { + XMoveResizeWindow(dpy, tmp->w, new_x, new_y, wwidth, wheight); + + tmp->row = row-1; + tmp->col = col; + tmp->x = new_x; + tmp->y = new_y; + tmp->width = wwidth; + tmp->height = wheight; + } + } + maxcol += 1; + + ip->cur_rows = row; + ip->cur_columns = maxcol; + ip->height = row * rowinc; + if (ip->height == 0) + ip->height = rowinc; + newwidth = maxcol * colinc; + if (newwidth == 0) + newwidth = colinc; + + XResizeWindow(dpy, ip->w, newwidth, ip->height); + + savewidth = ip->width; + if (ip->twm_win) + SetupWindow (ip->twm_win, + ip->twm_win->frame_x, ip->twm_win->frame_y, + newwidth, ip->height + ip->twm_win->title_height, -1); + ip->width = savewidth; +} diff --git a/app/twm/src/iconmgr.h b/app/twm/src/iconmgr.h new file mode 100644 index 000000000..eba3dc5e0 --- /dev/null +++ b/app/twm/src/iconmgr.h @@ -0,0 +1,94 @@ +/* + * +Copyright 1989, 1998 The Open Group + +Permission to use, copy, modify, distribute, and sell this software and its +documentation for any purpose is hereby granted without fee, provided that +the above copyright notice appear in all copies and that both that +copyright notice and this permission notice appear in supporting +documentation. + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the name of The Open Group shall not be +used in advertising or otherwise to promote the sale, use or other dealings +in this Software without prior written authorization from The Open Group. + * */ +/* $XFree86: xc/programs/twm/iconmgr.h,v 1.5 2001/08/27 21:11:39 dawes Exp $ */ + +/*********************************************************************** + * + * $Xorg: iconmgr.h,v 1.4 2001/02/09 02:05:36 xorgcvs Exp $ + * + * Icon Manager includes + * + * 09-Mar-89 Tom LaStrange File Created + * + ***********************************************************************/ + +#ifndef _ICONMGR_ +#define _ICONMGR_ + +typedef struct WList +{ + struct WList *next; + struct WList *prev; + struct TwmWindow *twm; + struct IconMgr *iconmgr; + Window w; + Window icon; + int x, y, width, height; + int row, col; + int me; + Pixel fore, back, highlight; + unsigned top, bottom; + short active; + short down; +} WList; + +typedef struct IconMgr +{ + struct IconMgr *next; /* pointer to the next icon manager */ + struct IconMgr *prev; /* pointer to the previous icon mgr */ + struct IconMgr *lasti; /* pointer to the last icon mgr */ + struct WList *first; /* first window in the list */ + struct WList *last; /* last window in the list */ + struct WList *active; /* the active entry */ + TwmWindow *twm_win; /* back pointer to the new parent */ + struct ScreenInfo *scr; /* the screen this thing is on */ + Window w; /* this icon manager window */ + char *geometry; /* geometry string */ + char *name; + char *icon_name; + int x, y, width, height; + int columns, cur_rows, cur_columns; + int count; +} IconMgr; + +extern int iconmgr_textx; +extern WList *DownIconManager; +extern int iconifybox_width, iconifybox_height; + +extern void ActiveIconManager ( WList *active ); +extern WList *AddIconManager ( TwmWindow *tmp_win ); +extern IconMgr *AllocateIconManager ( char *name, char *icon_name, char *geom, int columns ); +extern void CreateIconManagers ( void ); +extern void DrawIconManagerBorder ( WList *tmp ); +extern void InsertInIconManager ( IconMgr *ip, WList *tmp, TwmWindow *tmp_win ); +extern void JumpIconManager ( int dir ); +extern void MoveIconManager ( int dir ); +extern void NotActiveIconManager ( WList *active ); +extern void PackIconManager ( IconMgr *ip ); +extern void RemoveFromIconManager ( IconMgr *ip, WList *tmp ); +extern void RemoveIconManager ( TwmWindow *tmp_win ); +extern void SortIconManager ( IconMgr *ip ); + +#endif /* _ICONMGR_ */ diff --git a/app/twm/src/icons.c b/app/twm/src/icons.c new file mode 100644 index 000000000..be0410d03 --- /dev/null +++ b/app/twm/src/icons.c @@ -0,0 +1,585 @@ +/* + * +Copyright 1989, 1998 The Open Group + +Permission to use, copy, modify, distribute, and sell this software and its +documentation for any purpose is hereby granted without fee, provided that +the above copyright notice appear in all copies and that both that +copyright notice and this permission notice appear in supporting +documentation. + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the name of The Open Group shall not be +used in advertising or otherwise to promote the sale, use or other dealings +in this Software without prior written authorization from The Open Group. + * */ +/* $XFree86: xc/programs/twm/icons.c,v 1.6 2001/12/14 20:01:08 dawes Exp $ */ + +/********************************************************************** + * + * $Xorg: icons.c,v 1.4 2001/02/09 02:05:36 xorgcvs Exp $ + * + * Icon releated routines + * + * 10-Apr-89 Tom LaStrange Initial Version. + * + **********************************************************************/ + +#include +#include "twm.h" +#include "screen.h" +#include "icons.h" +#include "gram.h" +#include "parse.h" +#include "util.h" + +#define iconWidth(w) (Scr->IconBorderWidth * 2 + w->icon_w_width) +#define iconHeight(w) (Scr->IconBorderWidth * 2 + w->icon_w_height) + +static void splitEntry ( IconEntry *ie, int grav1, int grav2, int w, int h ); +static IconEntry * FindIconEntry ( TwmWindow *tmp_win, IconRegion **irp ); +static IconEntry * prevIconEntry ( IconEntry *ie, IconRegion *ir ); +static void mergeEntries ( IconEntry *old, IconEntry *ie ); + +static void +splitEntry (IconEntry *ie, int grav1, int grav2, int w, int h) +{ + IconEntry *new; + + switch (grav1) { + case D_NORTH: + case D_SOUTH: + if (w != ie->w) + splitEntry (ie, grav2, grav1, w, ie->h); + if (h != ie->h) { + new = (IconEntry *)malloc (sizeof (IconEntry)); + new->twm_win = 0; + new->used = 0; + new->next = ie->next; + ie->next = new; + new->x = ie->x; + new->h = (ie->h - h); + new->w = ie->w; + ie->h = h; + if (grav1 == D_SOUTH) { + new->y = ie->y; + ie->y = new->y + new->h; + } else + new->y = ie->y + ie->h; + } + break; + case D_EAST: + case D_WEST: + if (h != ie->h) + splitEntry (ie, grav2, grav1, ie->w, h); + if (w != ie->w) { + new = (IconEntry *)malloc (sizeof (IconEntry)); + new->twm_win = 0; + new->used = 0; + new->next = ie->next; + ie->next = new; + new->y = ie->y; + new->w = (ie->w - w); + new->h = ie->h; + ie->w = w; + if (grav1 == D_EAST) { + new->x = ie->x; + ie->x = new->x + new->w; + } else + new->x = ie->x + ie->w; + } + break; + } +} + +int +roundUp (int v, int multiple) +{ + return ((v + multiple - 1) / multiple) * multiple; +} + +void +PlaceIcon(TwmWindow *tmp_win, int def_x, int def_y, int *final_x, int *final_y) +{ + IconRegion *ir; + IconEntry *ie; + int w = 0, h = 0; + + ie = 0; + for (ir = Scr->FirstRegion; ir; ir = ir->next) { + w = roundUp (iconWidth (tmp_win), ir->stepx); + h = roundUp (iconHeight (tmp_win), ir->stepy); + for (ie = ir->entries; ie; ie=ie->next) { + if (ie->used) + continue; + if (ie->w >= w && ie->h >= h) + break; + } + if (ie) + break; + } + if (ie) { + splitEntry (ie, ir->grav1, ir->grav2, w, h); + ie->used = 1; + ie->twm_win = tmp_win; + *final_x = ie->x + (ie->w - iconWidth (tmp_win)) / 2; + *final_y = ie->y + (ie->h - iconHeight (tmp_win)) / 2; + } else { + *final_x = def_x; + *final_y = def_y; + } + return; +} + +static IconEntry * +FindIconEntry (TwmWindow *tmp_win, IconRegion **irp) +{ + IconRegion *ir; + IconEntry *ie; + + for (ir = Scr->FirstRegion; ir; ir = ir->next) { + for (ie = ir->entries; ie; ie=ie->next) + if (ie->twm_win == tmp_win) { + if (irp) + *irp = ir; + return ie; + } + } + return 0; +} + +void +IconUp (TwmWindow *tmp_win) +{ + int x, y; + int defx, defy; + struct IconRegion *ir; + + /* + * If the client specified a particular location, let's use it (this might + * want to be an option at some point). Otherwise, try to fit within the + * icon region. + */ + if (tmp_win->wmhints && (tmp_win->wmhints->flags & IconPositionHint)) + return; + + if (tmp_win->icon_moved) { + if (!XGetGeometry (dpy, tmp_win->icon_w, &JunkRoot, &defx, &defy, + &JunkWidth, &JunkHeight, &JunkBW, &JunkDepth)) + return; + + x = defx + ((int) JunkWidth) / 2; + y = defy + ((int) JunkHeight) / 2; + + for (ir = Scr->FirstRegion; ir; ir = ir->next) { + if (x >= ir->x && x < (ir->x + ir->w) && + y >= ir->y && y < (ir->y + ir->h)) + break; + } + if (!ir) return; /* outside icon regions, leave alone */ + } + + defx = -100; + defy = -100; + PlaceIcon(tmp_win, defx, defy, &x, &y); + if (x != defx || y != defy) { + XMoveWindow (dpy, tmp_win->icon_w, x, y); + tmp_win->icon_moved = FALSE; /* since we've restored it */ + } +} + +static IconEntry * +prevIconEntry (IconEntry *ie, IconRegion *ir) +{ + IconEntry *ip; + + if (ie == ir->entries) + return 0; + for (ip = ir->entries; ip->next != ie; ip=ip->next) + ; + return ip; +} + +/** + * old is being freed; and is adjacent to ie. Merge + * regions together + */ +static void +mergeEntries (IconEntry *old, IconEntry *ie) +{ + if (old->y == ie->y) { + ie->w = old->w + ie->w; + if (old->x < ie->x) + ie->x = old->x; + } else { + ie->h = old->h + ie->h; + if (old->y < ie->y) + ie->y = old->y; + } +} + +void +IconDown (TwmWindow *tmp_win) +{ + IconEntry *ie, *ip, *in; + IconRegion *ir; + + ie = FindIconEntry (tmp_win, &ir); + if (ie) { + ie->twm_win = 0; + ie->used = 0; + ip = prevIconEntry (ie, ir); + in = ie->next; + for (;;) { + if (ip && ip->used == 0 && + ((ip->x == ie->x && ip->w == ie->w) || + (ip->y == ie->y && ip->h == ie->h))) + { + ip->next = ie->next; + mergeEntries (ie, ip); + free ((char *) ie); + ie = ip; + ip = prevIconEntry (ip, ir); + } else if (in && in->used == 0 && + ((in->x == ie->x && in->w == ie->w) || + (in->y == ie->y && in->h == ie->h))) + { + ie->next = in->next; + mergeEntries (in, ie); + free ((char *) in); + in = ie->next; + } else + break; + } + } +} + +void +AddIconRegion(char *geom, int grav1, int grav2, int stepx, int stepy) +{ + IconRegion *ir; + int mask; + + ir = (IconRegion *)malloc(sizeof(IconRegion)); + ir->next = NULL; + if (Scr->LastRegion) + Scr->LastRegion->next = ir; + Scr->LastRegion = ir; + if (!Scr->FirstRegion) + Scr->FirstRegion = ir; + + ir->entries = NULL; + ir->grav1 = grav1; + ir->grav2 = grav2; + if (stepx <= 0) + stepx = 1; + if (stepy <= 0) + stepy = 1; + ir->stepx = stepx; + ir->stepy = stepy; + ir->x = ir->y = ir->w = ir->h = 0; + + mask = XParseGeometry(geom, &ir->x, &ir->y, (unsigned int *)&ir->w, (unsigned int *)&ir->h); + + if (mask & XNegative) + ir->x += Scr->MyDisplayWidth - ir->w; + + if (mask & YNegative) + ir->y += Scr->MyDisplayHeight - ir->h; + ir->entries = (IconEntry *)malloc(sizeof(IconEntry)); + ir->entries->next = 0; + ir->entries->x = ir->x; + ir->entries->y = ir->y; + ir->entries->w = ir->w; + ir->entries->h = ir->h; + ir->entries->twm_win = 0; + ir->entries->used = 0; +} + +#ifdef comment +void +FreeIconEntries (IconRegion *ir) +{ + IconEntry *ie, *tmp; + + for (ie = ir->entries; ie; ie=tmp) + { + tmp = ie->next; + free ((char *) ie); + } +} + +void +FreeIconRegions() +{ + IconRegion *ir, *tmp; + + for (ir = Scr->FirstRegion; ir != NULL;) + { + tmp = ir; + FreeIconEntries (ir); + ir = ir->next; + free((char *) tmp); + } + Scr->FirstRegion = NULL; + Scr->LastRegion = NULL; +} +#endif + +void +CreateIconWindow(TwmWindow *tmp_win, int def_x, int def_y) +{ + unsigned long event_mask; + unsigned long valuemask; /* mask for create windows */ + XSetWindowAttributes attributes; /* attributes for create windows */ + Pixmap pm = None; /* tmp pixmap variable */ + int final_x, final_y; + int x; + + + FB(tmp_win->iconc.fore, tmp_win->iconc.back); + + tmp_win->forced = FALSE; + tmp_win->icon_not_ours = FALSE; + + /* now go through the steps to get an icon window, if ForceIcon is + * set, then no matter what else is defined, the bitmap from the + * .twmrc file is used + */ + if (Scr->ForceIcon) + { + char *icon_name; + Pixmap bm; + + icon_name = LookInNameList(Scr->IconNames, tmp_win->full_name); + if (icon_name == NULL) + icon_name = LookInList(Scr->IconNames, tmp_win->full_name, + &tmp_win->class); + + bm = None; + if (icon_name != NULL) + { + if ((bm = (Pixmap)LookInNameList(Scr->Icons, icon_name)) == None) + { + if ((bm = GetBitmap (icon_name)) != None) + AddToList(&Scr->Icons, icon_name, (char *)bm); + } + } + + if (bm != None) + { + XGetGeometry(dpy, bm, &JunkRoot, &JunkX, &JunkY, + (unsigned int *) &tmp_win->icon_width, (unsigned int *)&tmp_win->icon_height, + &JunkBW, &JunkDepth); + + pm = XCreatePixmap(dpy, Scr->Root, tmp_win->icon_width, + tmp_win->icon_height, Scr->d_depth); + + /* the copy plane works on color ! */ + XCopyPlane(dpy, bm, pm, Scr->NormalGC, + 0,0, tmp_win->icon_width, tmp_win->icon_height, 0, 0, 1 ); + + tmp_win->forced = TRUE; + } + } + + /* if the pixmap is still NULL, we didn't get one from the above code, + * that could mean that ForceIcon was not set, or that the window + * was not in the Icons list, now check the WM hints for an icon + */ + if (pm == None && tmp_win->wmhints && + tmp_win->wmhints->flags & IconPixmapHint) + { + + XGetGeometry(dpy, tmp_win->wmhints->icon_pixmap, + &JunkRoot, &JunkX, &JunkY, + (unsigned int *)&tmp_win->icon_width, (unsigned int *)&tmp_win->icon_height, &JunkBW, &JunkDepth); + + pm = XCreatePixmap(dpy, Scr->Root, + tmp_win->icon_width, tmp_win->icon_height, + Scr->d_depth); + + XCopyPlane(dpy, tmp_win->wmhints->icon_pixmap, pm, Scr->NormalGC, + 0,0, tmp_win->icon_width, tmp_win->icon_height, 0, 0, 1 ); + } + + /* if we still haven't got an icon, let's look in the Icon list + * if ForceIcon is not set + */ + if (pm == None && !Scr->ForceIcon) + { + char *icon_name; + Pixmap bm; + + icon_name = LookInNameList(Scr->IconNames, tmp_win->full_name); + if (icon_name == NULL) + icon_name = LookInList(Scr->IconNames, tmp_win->full_name, + &tmp_win->class); + + bm = None; + if (icon_name != NULL) + { + if ((bm = (Pixmap)LookInNameList(Scr->Icons, icon_name)) == None) + { + if ((bm = GetBitmap (icon_name)) != None) + AddToList(&Scr->Icons, icon_name, (char *)bm); + } + } + + if (bm != None) + { + XGetGeometry(dpy, bm, &JunkRoot, &JunkX, &JunkY, + (unsigned int *)&tmp_win->icon_width, (unsigned int *)&tmp_win->icon_height, + &JunkBW, &JunkDepth); + + pm = XCreatePixmap(dpy, Scr->Root, tmp_win->icon_width, + tmp_win->icon_height, Scr->d_depth); + + /* the copy plane works on color ! */ + XCopyPlane(dpy, bm, pm, Scr->NormalGC, + 0,0, tmp_win->icon_width, tmp_win->icon_height, 0, 0, 1 ); + } + } + + /* if we still don't have an icon, assign the UnknownIcon */ + + if (pm == None && Scr->UnknownPm != None) + { + tmp_win->icon_width = Scr->UnknownWidth; + tmp_win->icon_height = Scr->UnknownHeight; + + pm = XCreatePixmap(dpy, Scr->Root, tmp_win->icon_width, + tmp_win->icon_height, Scr->d_depth); + + /* the copy plane works on color ! */ + XCopyPlane(dpy, Scr->UnknownPm, pm, Scr->NormalGC, + 0,0, tmp_win->icon_width, tmp_win->icon_height, 0, 0, 1 ); + } + + if (pm == None) + { + tmp_win->icon_height = 0; + tmp_win->icon_width = 0; + valuemask = 0; + } + else + { + valuemask = CWBackPixmap; + attributes.background_pixmap = pm; + } + + tmp_win->icon_w_width = MyFont_TextWidth(&Scr->IconFont, + tmp_win->icon_name, strlen(tmp_win->icon_name)); + + tmp_win->icon_w_width += 6; + if (tmp_win->icon_w_width < tmp_win->icon_width) + { + tmp_win->icon_x = (tmp_win->icon_width - tmp_win->icon_w_width)/2; + tmp_win->icon_x += 3; + tmp_win->icon_w_width = tmp_win->icon_width; + } + else + { + tmp_win->icon_x = 3; + } + tmp_win->icon_y = tmp_win->icon_height + Scr->IconFont.height; + tmp_win->icon_w_height = tmp_win->icon_height + Scr->IconFont.height + 4; + + event_mask = 0; + if (tmp_win->wmhints && tmp_win->wmhints->flags & IconWindowHint) + { + tmp_win->icon_w = tmp_win->wmhints->icon_window; + if (tmp_win->forced || + XGetGeometry(dpy, tmp_win->icon_w, &JunkRoot, &JunkX, &JunkY, + (unsigned int *)&tmp_win->icon_w_width, (unsigned int *)&tmp_win->icon_w_height, + &JunkBW, &JunkDepth) == 0) + { + tmp_win->icon_w = None; + tmp_win->wmhints->flags &= ~IconWindowHint; + } + else + { + tmp_win->icon_not_ours = TRUE; + event_mask = EnterWindowMask | LeaveWindowMask; + } + } + else + { + tmp_win->icon_w = None; + } + + if (tmp_win->icon_w == None) + { + tmp_win->icon_w = XCreateSimpleWindow(dpy, Scr->Root, + 0,0, + tmp_win->icon_w_width, tmp_win->icon_w_height, + Scr->IconBorderWidth, tmp_win->icon_border, tmp_win->iconc.back); + event_mask = ExposureMask; + } + + XSelectInput (dpy, tmp_win->icon_w, + KeyPressMask | ButtonPressMask | ButtonReleaseMask | + event_mask); + + tmp_win->icon_bm_w = None; + if (pm != None && + (! (tmp_win->wmhints && tmp_win->wmhints->flags & IconWindowHint))) + { + int y; + + y = 0; + if (tmp_win->icon_w_width == tmp_win->icon_width) + x = 0; + else + x = (tmp_win->icon_w_width - tmp_win->icon_width)/2; + + tmp_win->icon_bm_w = XCreateWindow (dpy, tmp_win->icon_w, x, y, + (unsigned int)tmp_win->icon_width, + (unsigned int)tmp_win->icon_height, + (unsigned int) 0, Scr->d_depth, + (unsigned int) CopyFromParent, + Scr->d_visual, valuemask, + &attributes); + } + + /* I need to figure out where to put the icon window now, because + * getting here means that I am going to make the icon visible + */ + if (tmp_win->wmhints && + tmp_win->wmhints->flags & IconPositionHint) + { + final_x = tmp_win->wmhints->icon_x; + final_y = tmp_win->wmhints->icon_y; + } + else + { + PlaceIcon(tmp_win, def_x, def_y, &final_x, &final_y); + } + + if (final_x > Scr->MyDisplayWidth) + final_x = Scr->MyDisplayWidth - tmp_win->icon_w_width - + (2 * Scr->IconBorderWidth); + + if (final_y > Scr->MyDisplayHeight) + final_y = Scr->MyDisplayHeight - tmp_win->icon_height - + Scr->IconFont.height - 4 - (2 * Scr->IconBorderWidth); + + XMoveWindow(dpy, tmp_win->icon_w, final_x, final_y); + tmp_win->iconified = TRUE; + + XMapSubwindows(dpy, tmp_win->icon_w); + XSaveContext(dpy, tmp_win->icon_w, TwmContext, (caddr_t)tmp_win); + XSaveContext(dpy, tmp_win->icon_w, ScreenContext, (caddr_t)Scr); + XDefineCursor(dpy, tmp_win->icon_w, Scr->IconCursor); + if (pm) XFreePixmap (dpy, pm); + return; +} diff --git a/app/twm/src/icons.h b/app/twm/src/icons.h new file mode 100644 index 000000000..a59e42c9b --- /dev/null +++ b/app/twm/src/icons.h @@ -0,0 +1,66 @@ +/* + * +Copyright 1989, 1998 The Open Group + +Permission to use, copy, modify, distribute, and sell this software and its +documentation for any purpose is hereby granted without fee, provided that +the above copyright notice appear in all copies and that both that +copyright notice and this permission notice appear in supporting +documentation. + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the name of The Open Group shall not be +used in advertising or otherwise to promote the sale, use or other dealings +in this Software without prior written authorization from The Open Group. + * */ +/* $XFree86: xc/programs/twm/icons.h,v 1.4 2001/01/17 23:45:06 dawes Exp $ */ + +/********************************************************************** + * + * $Xorg: icons.h,v 1.4 2001/02/09 02:05:36 xorgcvs Exp $ + * + * Icon releated definitions + * + * 10-Apr-89 Tom LaStrange Initial Version. + * + **********************************************************************/ + +#ifndef ICONS_H +#define ICONS_H + +typedef struct IconRegion +{ + struct IconRegion *next; + int x, y, w, h; + int grav1, grav2; + int stepx, stepy; /* allocation granularity */ + struct IconEntry *entries; +} IconRegion; + +typedef struct IconEntry +{ + struct IconEntry *next; + int x, y, w, h; + TwmWindow *twm_win; + short used; +}IconEntry; + +extern int roundUp ( int v, int multiple ); +extern void PlaceIcon ( TwmWindow *tmp_win, int def_x, int def_y, + int *final_x, int *final_y ); +extern void IconUp ( TwmWindow *tmp_win ); +extern void IconDown ( TwmWindow *tmp_win ); +extern void AddIconRegion ( char *geom, int grav1, int grav2, + int stepx, int stepy ); +extern void CreateIconWindow ( TwmWindow *tmp_win, int def_x, int def_y ); + +#endif /* ICONS_H */ diff --git a/app/twm/src/lex.c b/app/twm/src/lex.c new file mode 100644 index 000000000..e2ae17184 --- /dev/null +++ b/app/twm/src/lex.c @@ -0,0 +1,1724 @@ +/* A lexical scanner generated by flex*/ + +/* Scanner skeleton version: + * $Header: /home/cvs/xenocara/app/twm/src/Attic/lex.c,v 1.1.1.1 2006/11/26 14:11:20 matthieu Exp $ + */ + +#define FLEX_SCANNER +#define YY_FLEX_MAJOR_VERSION 2 +#define YY_FLEX_MINOR_VERSION 5 + +#include +#include + + +/* cfront 1.2 defines "c_plusplus" instead of "__cplusplus" */ +#ifdef c_plusplus +#ifndef __cplusplus +#define __cplusplus +#endif +#endif + + +#ifdef __cplusplus + +#include + +/* Use prototypes in function declarations. */ +#define YY_USE_PROTOS + +/* The "const" storage-class-modifier is valid. */ +#define YY_USE_CONST + +#else /* ! __cplusplus */ + +#if __STDC__ + +#define YY_USE_PROTOS +#define YY_USE_CONST + +#endif /* __STDC__ */ +#endif /* ! __cplusplus */ + +#ifdef __TURBOC__ + #pragma warn -rch + #pragma warn -use +#include +#include +#define YY_USE_CONST +#define YY_USE_PROTOS +#endif + +#ifdef YY_USE_CONST +#define yyconst const +#else +#define yyconst +#endif + + +#ifdef YY_USE_PROTOS +#define YY_PROTO(proto) proto +#else +#define YY_PROTO(proto) () +#endif + +/* Returned upon end-of-file. */ +#define YY_NULL 0 + +/* Promotes a possibly negative, possibly signed char to an unsigned + * integer for use as an array index. If the signed char is negative, + * we want to instead treat it as an 8-bit unsigned char, hence the + * double cast. + */ +#define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c) + +/* Enter a start condition. This macro really ought to take a parameter, + * but we do it the disgusting crufty way forced on us by the ()-less + * definition of BEGIN. + */ +#define BEGIN yy_start = 1 + 2 * + +/* Translate the current start state into a value that can be later handed + * to BEGIN to return to the state. The YYSTATE alias is for lex + * compatibility. + */ +#define YY_START ((yy_start - 1) / 2) +#define YYSTATE YY_START + +/* Action number for EOF rule of a given start state. */ +#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1) + +/* Special action meaning "start processing a new file". */ +#define YY_NEW_FILE yyrestart( yyin ) + +#define YY_END_OF_BUFFER_CHAR 0 + +/* Size of default input buffer. */ +#define YY_BUF_SIZE 16384 + +typedef struct yy_buffer_state *YY_BUFFER_STATE; + +extern int yyleng; +extern FILE *yyin, *yyout; + +#define EOB_ACT_CONTINUE_SCAN 0 +#define EOB_ACT_END_OF_FILE 1 +#define EOB_ACT_LAST_MATCH 2 + +/* The funky do-while in the following #define is used to turn the definition + * int a single C statement (which needs a semi-colon terminator). This + * avoids problems with code like: + * + * if ( condition_holds ) + * yyless( 5 ); + * else + * do_something_else(); + * + * Prior to using the do-while the compiler would get upset at the + * "else" because it interpreted the "if" statement as being all + * done when it reached the ';' after the yyless() call. + */ + +/* Return all but the first 'n' matched characters back to the input stream. */ + +#define yyless(n) \ + do \ + { \ + /* Undo effects of setting up yytext. */ \ + *yy_cp = yy_hold_char; \ + YY_RESTORE_YY_MORE_OFFSET \ + yy_c_buf_p = yy_cp = yy_bp + n - YY_MORE_ADJ; \ + YY_DO_BEFORE_ACTION; /* set up yytext again */ \ + } \ + while ( 0 ) + +#define unput(c) yyunput( c, yytext_ptr ) + +/* Some routines like yy_flex_realloc() are emitted as static but are + not called by all lexers. This generates warnings in some compilers, + notably GCC. Arrange to suppress these. */ +#ifdef __GNUC__ +#define YY_MAY_BE_UNUSED __attribute__((unused)) +#else +#define YY_MAY_BE_UNUSED +#endif + +/* The following is because we cannot portably get our hands on size_t + * (without autoconf's help, which isn't available because we want + * flex-generated scanners to compile on their own). + */ +typedef unsigned int yy_size_t; + + +struct yy_buffer_state + { + FILE *yy_input_file; + + char *yy_ch_buf; /* input buffer */ + char *yy_buf_pos; /* current position in input buffer */ + + /* Size of input buffer in bytes, not including room for EOB + * characters. + */ + yy_size_t yy_buf_size; + + /* Number of characters read into yy_ch_buf, not including EOB + * characters. + */ + int yy_n_chars; + + /* Whether we "own" the buffer - i.e., we know we created it, + * and can realloc() it to grow it, and should free() it to + * delete it. + */ + int yy_is_our_buffer; + + /* Whether this is an "interactive" input source; if so, and + * if we're using stdio for input, then we want to use getc() + * instead of fread(), to make sure we stop fetching input after + * each newline. + */ + int yy_is_interactive; + + /* Whether we're considered to be at the beginning of a line. + * If so, '^' rules will be active on the next match, otherwise + * not. + */ + int yy_at_bol; + + /* Whether to try to fill the input buffer when we reach the + * end of it. + */ + int yy_fill_buffer; + + int yy_buffer_status; +#define YY_BUFFER_NEW 0 +#define YY_BUFFER_NORMAL 1 + /* When an EOF's been seen but there's still some text to process + * then we mark the buffer as YY_EOF_PENDING, to indicate that we + * shouldn't try reading from the input source any more. We might + * still have a bunch of tokens to match, though, because of + * possible backing-up. + * + * When we actually see the EOF, we change the status to "new" + * (via yyrestart()), so that the user can continue scanning by + * just pointing yyin at a new input file. + */ +#define YY_BUFFER_EOF_PENDING 2 + }; + +static YY_BUFFER_STATE yy_current_buffer = 0; + +/* We provide macros for accessing buffer states in case in the + * future we want to put the buffer states in a more general + * "scanner state". + */ +#define YY_CURRENT_BUFFER yy_current_buffer + + +/* yy_hold_char holds the character lost when yytext is formed. */ +static char yy_hold_char; + +static int yy_n_chars; /* number of characters read into yy_ch_buf */ + + +int yyleng; + +/* Points to current character in buffer. */ +static char *yy_c_buf_p = (char *) 0; +static int yy_init = 1; /* whether we need to initialize */ +static int yy_start = 0; /* start state number */ + +/* Flag which is used to allow yywrap()'s to do buffer switches + * instead of setting up a fresh yyin. A bit of a hack ... + */ +static int yy_did_buffer_switch_on_eof; + +void yyrestart YY_PROTO(( FILE *input_file )); + +void yy_switch_to_buffer YY_PROTO(( YY_BUFFER_STATE new_buffer )); +void yy_load_buffer_state YY_PROTO(( void )); +YY_BUFFER_STATE yy_create_buffer YY_PROTO(( FILE *file, int size )); +void yy_delete_buffer YY_PROTO(( YY_BUFFER_STATE b )); +void yy_init_buffer YY_PROTO(( YY_BUFFER_STATE b, FILE *file )); +void yy_flush_buffer YY_PROTO(( YY_BUFFER_STATE b )); +#define YY_FLUSH_BUFFER yy_flush_buffer( yy_current_buffer ) + +YY_BUFFER_STATE yy_scan_buffer YY_PROTO(( char *base, yy_size_t size )); +YY_BUFFER_STATE yy_scan_string YY_PROTO(( yyconst char *yy_str )); +YY_BUFFER_STATE yy_scan_bytes YY_PROTO(( yyconst char *bytes, int len )); + +static void *yy_flex_alloc YY_PROTO(( yy_size_t )); +static void *yy_flex_realloc YY_PROTO(( void *, yy_size_t )) YY_MAY_BE_UNUSED; +static void yy_flex_free YY_PROTO(( void * )); + +#define yy_new_buffer yy_create_buffer + +#define yy_set_interactive(is_interactive) \ + { \ + if ( ! yy_current_buffer ) \ + yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \ + yy_current_buffer->yy_is_interactive = is_interactive; \ + } + +#define yy_set_bol(at_bol) \ + { \ + if ( ! yy_current_buffer ) \ + yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \ + yy_current_buffer->yy_at_bol = at_bol; \ + } + +#define YY_AT_BOL() (yy_current_buffer->yy_at_bol) + +typedef unsigned char YY_CHAR; +FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0; +typedef int yy_state_type; +extern char *yytext; +#define yytext_ptr yytext + +static yy_state_type yy_get_previous_state YY_PROTO(( void )); +static yy_state_type yy_try_NUL_trans YY_PROTO(( yy_state_type current_state )); +static int yy_get_next_buffer YY_PROTO(( void )); +static void yy_fatal_error YY_PROTO(( yyconst char msg[] )); + +/* Done after the current pattern has been matched and before the + * corresponding action - sets up yytext. + */ +#define YY_DO_BEFORE_ACTION \ + yytext_ptr = yy_bp; \ + yyleng = (int) (yy_cp - yy_bp); \ + yy_hold_char = *yy_cp; \ + *yy_cp = '\0'; \ + yy_c_buf_p = yy_cp; + +#define YY_NUM_RULES 18 +#define YY_END_OF_BUFFER 19 +static yyconst short int yy_accept[33] = + { 0, + 0, 0, 19, 17, 16, 16, 11, 17, 17, 3, + 4, 7, 8, 10, 14, 6, 5, 12, 1, 9, + 2, 0, 13, 0, 0, 15, 10, 14, 0, 13, + 0, 0 + } ; + +static yyconst int yy_ec[256] = + { 0, + 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, + 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 2, 4, 5, 6, 1, 1, 1, 1, 7, + 8, 1, 9, 1, 10, 11, 1, 12, 12, 12, + 12, 12, 12, 12, 12, 12, 12, 13, 1, 1, + 14, 1, 1, 1, 11, 11, 11, 11, 11, 11, + 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, + 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, + 1, 15, 1, 16, 1, 1, 11, 11, 11, 11, + + 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, + 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, + 11, 11, 17, 18, 19, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1 + } ; + +static yyconst int yy_meta[20] = + { 0, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1 + } ; + +static yyconst short int yy_base[36] = + { 0, + 0, 0, 39, 58, 58, 58, 58, 15, 35, 58, + 58, 58, 58, 26, 24, 58, 58, 58, 58, 58, + 58, 16, 58, 29, 26, 58, 17, 15, 18, 20, + 42, 58, 25, 23, 21 + } ; + +static yyconst short int yy_def[36] = + { 0, + 32, 1, 32, 32, 32, 32, 32, 33, 34, 32, + 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, + 32, 33, 32, 35, 34, 32, 32, 32, 33, 33, + 35, 0, 32, 32, 32 + } ; + +static yyconst short int yy_nxt[78] = + { 0, + 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, + 14, 15, 16, 17, 4, 18, 19, 20, 21, 23, + 23, 29, 23, 25, 23, 22, 28, 27, 26, 24, + 24, 22, 24, 30, 24, 28, 27, 26, 32, 32, + 32, 32, 32, 31, 22, 32, 30, 32, 32, 32, + 32, 32, 32, 32, 32, 32, 31, 3, 32, 32, + 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, + 32, 32, 32, 32, 32, 32, 32 + } ; + +static yyconst short int yy_chk[78] = + { 0, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 8, + 22, 35, 29, 34, 30, 33, 28, 27, 25, 8, + 22, 24, 29, 24, 30, 15, 14, 9, 3, 0, + 0, 0, 0, 24, 31, 0, 31, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 31, 32, 32, 32, + 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, + 32, 32, 32, 32, 32, 32, 32 + } ; + +static yy_state_type yy_last_accepting_state; +static char *yy_last_accepting_cpos; + +/* The intent behind this definition is that it'll catch + * any uses of REJECT which flex missed. + */ +#define REJECT reject_used_but_not_detected +#define yymore() yymore_used_but_not_detected +#define YY_MORE_ADJ 0 +#define YY_RESTORE_YY_MORE_OFFSET +char *yytext; +#line 1 "lex.l" +#define INITIAL 0 +#line 2 "lex.l" +/*****************************************************************************/ +/* + +Copyright 1989,1998 The Open Group + +Permission to use, copy, modify, distribute, and sell this software and its +documentation for any purpose is hereby granted without fee, provided that +the above copyright notice appear in all copies and that both that +copyright notice and this permission notice appear in supporting +documentation. + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the name of The Open Group shall not be +used in advertising or otherwise to promote the sale, use or other dealings +in this Software without prior written authorization from The Open Group. + +*/ +/** Copyright 1988 by Evans & Sutherland Computer Corporation, **/ +/** Salt Lake City, Utah **/ +/** Cambridge, Massachusetts **/ +/** **/ +/** All Rights Reserved **/ +/** **/ +/** Permission to use, copy, modify, and distribute this software and **/ +/** its documentation for any purpose and without fee is hereby **/ +/** granted, provided that the above copyright notice appear in all **/ +/** copies and that both that copyright notice and this permis- **/ +/** sion notice appear in supporting documentation, and that the **/ +/** name of Evans & Sutherland not be used in advertising **/ +/** in publicity pertaining to distribution of the software without **/ +/** specific, written prior permission. **/ +/** **/ +/** EVANS & SUTHERLAND DISCLAIMs ALL WARRANTIES WITH REGARD **/ +/** TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANT- **/ +/** ABILITY AND FITNESS, IN NO EVENT SHALL EVANS & SUTHERLAND **/ +/** BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAM- **/ +/** AGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA **/ +/** OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER **/ +/** TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE **/ +/** OR PERFORMANCE OF THIS SOFTWARE. **/ +/*****************************************************************************/ + +/*********************************************************************** + * + * $Xorg: lex.l,v 1.4 2001/02/09 02:05:36 xorgcvs Exp $ + * + * .twmrc lex file + * + * 12-Nov-87 Thomas E. LaStrange File created + * + ***********************************************************************/ +/* $XFree86: xc/programs/twm/lex.l,v 3.13 2001/08/27 21:11:39 dawes Exp $ */ + +/* #include */ /* lex already includes stdio.h */ +#include "twm.h" +#include "gram.h" +#include "list.h" +#include "parse.h" + +#ifdef FLEX_SCANNER +int yylineno; + +#undef YY_INPUT +#define YY_INPUT(buf,result,size) ((result) = doinput((buf),(size))) +int doinput (char *buf, int size) +{ + int c; + + if (size == 0) + return (0); + + if ((c = (*twmInputFunc)()) <= 0) + return (0); + + buf[0] = c; + return (1); +} +#define YY_NO_UNPUT +#endif + +#line 486 "lex.c" + +/* Macros after this point can all be overridden by user definitions in + * section 1. + */ + +#ifndef YY_SKIP_YYWRAP +#ifdef __cplusplus +extern "C" int yywrap YY_PROTO(( void )); +#else +extern int yywrap YY_PROTO(( void )); +#endif +#endif + +#ifndef YY_NO_UNPUT +static void yyunput YY_PROTO(( int c, char *buf_ptr )); +#endif + +#ifndef yytext_ptr +static void yy_flex_strncpy YY_PROTO(( char *, yyconst char *, int )); +#endif + +#ifdef YY_NEED_STRLEN +static int yy_flex_strlen YY_PROTO(( yyconst char * )); +#endif + +#ifndef YY_NO_INPUT +#ifdef __cplusplus +static int yyinput YY_PROTO(( void )); +#else +static int input YY_PROTO(( void )); +#endif +#endif + +#if YY_STACK_USED +static int yy_start_stack_ptr = 0; +static int yy_start_stack_depth = 0; +static int *yy_start_stack = 0; +#ifndef YY_NO_PUSH_STATE +static void yy_push_state YY_PROTO(( int new_state )); +#endif +#ifndef YY_NO_POP_STATE +static void yy_pop_state YY_PROTO(( void )); +#endif +#ifndef YY_NO_TOP_STATE +static int yy_top_state YY_PROTO(( void )); +#endif + +#else +#define YY_NO_PUSH_STATE 1 +#define YY_NO_POP_STATE 1 +#define YY_NO_TOP_STATE 1 +#endif + +#ifdef YY_MALLOC_DECL +YY_MALLOC_DECL +#else +#if __STDC__ +#ifndef __cplusplus +#include +#endif +#else +/* Just try to get by without declaring the routines. This will fail + * miserably on non-ANSI systems for which sizeof(size_t) != sizeof(int) + * or sizeof(void*) != sizeof(int). + */ +#endif +#endif + +/* Amount of stuff to slurp up with each read. */ +#ifndef YY_READ_BUF_SIZE +#define YY_READ_BUF_SIZE 8192 +#endif + +/* Copy whatever the last rule matched to the standard output. */ + +#ifndef ECHO +/* This used to be an fputs(), but since the string might contain NUL's, + * we now use fwrite(). + */ +#define ECHO (void) fwrite( yytext, yyleng, 1, yyout ) +#endif + +/* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, + * is returned in "result". + */ +#ifndef YY_INPUT +#define YY_INPUT(buf,result,max_size) \ + if ( yy_current_buffer->yy_is_interactive ) \ + { \ + int c = '*', n; \ + for ( n = 0; n < max_size && \ + (c = getc( yyin )) != EOF && c != '\n'; ++n ) \ + buf[n] = (char) c; \ + if ( c == '\n' ) \ + buf[n++] = (char) c; \ + if ( c == EOF && ferror( yyin ) ) \ + YY_FATAL_ERROR( "input in flex scanner failed" ); \ + result = n; \ + } \ + else if ( ((result = fread( buf, 1, max_size, yyin )) == 0) \ + && ferror( yyin ) ) \ + YY_FATAL_ERROR( "input in flex scanner failed" ); +#endif + +/* No semi-colon after return; correct usage is to write "yyterminate();" - + * we don't want an extra ';' after the "return" because that will cause + * some compilers to complain about unreachable statements. + */ +#ifndef yyterminate +#define yyterminate() return YY_NULL +#endif + +/* Number of entries by which start-condition stack grows. */ +#ifndef YY_START_STACK_INCR +#define YY_START_STACK_INCR 25 +#endif + +/* Report a fatal error. */ +#ifndef YY_FATAL_ERROR +#define YY_FATAL_ERROR(msg) yy_fatal_error( msg ) +#endif + +/* Default declaration of generated scanner - a define so the user can + * easily add parameters. + */ +#ifndef YY_DECL +#define YY_DECL int yylex YY_PROTO(( void )) +#endif + +/* Code executed at the beginning of each rule, after yytext and yyleng + * have been set up. + */ +#ifndef YY_USER_ACTION +#define YY_USER_ACTION +#endif + +/* Code executed at the end of each rule. */ +#ifndef YY_BREAK +#define YY_BREAK break; +#endif + +#define YY_RULE_SETUP \ + YY_USER_ACTION + +YY_DECL + { + register yy_state_type yy_current_state; + register char *yy_cp = NULL, *yy_bp = NULL; + register int yy_act; + +#line 95 "lex.l" + +#line 639 "lex.c" + + if ( yy_init ) + { + yy_init = 0; + +#ifdef YY_USER_INIT + YY_USER_INIT; +#endif + + if ( ! yy_start ) + yy_start = 1; /* first start state */ + + if ( ! yyin ) + yyin = stdin; + + if ( ! yyout ) + yyout = stdout; + + if ( ! yy_current_buffer ) + yy_current_buffer = + yy_create_buffer( yyin, YY_BUF_SIZE ); + + yy_load_buffer_state(); + } + + while ( 1 ) /* loops until end-of-file is reached */ + { + yy_cp = yy_c_buf_p; + + /* Support of yytext. */ + *yy_cp = yy_hold_char; + + /* yy_bp points to the position in yy_ch_buf of the start of + * the current run. + */ + yy_bp = yy_cp; + + yy_current_state = yy_start; +yy_match: + do + { + register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)]; + if ( yy_accept[yy_current_state] ) + { + yy_last_accepting_state = yy_current_state; + yy_last_accepting_cpos = yy_cp; + } + while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) + { + yy_current_state = (int) yy_def[yy_current_state]; + if ( yy_current_state >= 33 ) + yy_c = yy_meta[(unsigned int) yy_c]; + } + yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; + ++yy_cp; + } + while ( yy_base[yy_current_state] != 58 ); + +yy_find_action: + yy_act = yy_accept[yy_current_state]; + if ( yy_act == 0 ) + { /* have to back up */ + yy_cp = yy_last_accepting_cpos; + yy_current_state = yy_last_accepting_state; + yy_act = yy_accept[yy_current_state]; + } + + YY_DO_BEFORE_ACTION; + + +do_action: /* This label is used only to access EOF actions. */ + + + switch ( yy_act ) + { /* beginning of action switch */ + case 0: /* must back up */ + /* undo the effects of YY_DO_BEFORE_ACTION */ + *yy_cp = yy_hold_char; + yy_cp = yy_last_accepting_cpos; + yy_current_state = yy_last_accepting_state; + goto yy_find_action; + +case 1: +YY_RULE_SETUP +#line 96 "lex.l" +{ return (LB); } + YY_BREAK +case 2: +YY_RULE_SETUP +#line 97 "lex.l" +{ return (RB); } + YY_BREAK +case 3: +YY_RULE_SETUP +#line 98 "lex.l" +{ return (LP); } + YY_BREAK +case 4: +YY_RULE_SETUP +#line 99 "lex.l" +{ return (RP); } + YY_BREAK +case 5: +YY_RULE_SETUP +#line 100 "lex.l" +{ return (EQUALS); } + YY_BREAK +case 6: +YY_RULE_SETUP +#line 101 "lex.l" +{ return (COLON); } + YY_BREAK +case 7: +YY_RULE_SETUP +#line 102 "lex.l" +{ return PLUS; } + YY_BREAK +case 8: +YY_RULE_SETUP +#line 103 "lex.l" +{ return MINUS; } + YY_BREAK +case 9: +YY_RULE_SETUP +#line 104 "lex.l" +{ return OR; } + YY_BREAK +case 10: +YY_RULE_SETUP +#line 106 "lex.l" +{ int token = parse_keyword ((char *)yytext, + &yylval.num); + if (token == ERRORTOKEN) { + twmrc_error_prefix(); + fprintf (stderr, + "ignoring unknown keyword: %s\n", + yytext); + ParseError = 1; + } else + return token; + } + YY_BREAK +case 11: +YY_RULE_SETUP +#line 118 "lex.l" +{ yylval.num = F_EXEC; return FSKEYWORD; } + YY_BREAK +case 12: +YY_RULE_SETUP +#line 119 "lex.l" +{ yylval.num = F_CUT; return FSKEYWORD; } + YY_BREAK +case 13: +YY_RULE_SETUP +#line 121 "lex.l" +{ yylval.ptr = (char *)yytext; return STRING; } + YY_BREAK +case 14: +YY_RULE_SETUP +#line 122 "lex.l" +{ (void)sscanf((char *)yytext, "%d", &yylval.num); + return (NUMBER); + } + YY_BREAK +case 15: +YY_RULE_SETUP +#line 125 "lex.l" +{;} + YY_BREAK +case 16: +YY_RULE_SETUP +#line 126 "lex.l" +{;} + YY_BREAK +case 17: +YY_RULE_SETUP +#line 127 "lex.l" +{ + twmrc_error_prefix(); + fprintf (stderr, + "ignoring character \"%s\"\n", + yytext); + ParseError = 1; + } + YY_BREAK +case 18: +YY_RULE_SETUP +#line 134 "lex.l" +ECHO; + YY_BREAK +#line 830 "lex.c" +case YY_STATE_EOF(INITIAL): + yyterminate(); + + case YY_END_OF_BUFFER: + { + /* Amount of text matched not including the EOB char. */ + int yy_amount_of_matched_text = (int) (yy_cp - yytext_ptr) - 1; + + /* Undo the effects of YY_DO_BEFORE_ACTION. */ + *yy_cp = yy_hold_char; + YY_RESTORE_YY_MORE_OFFSET + + if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_NEW ) + { + /* We're scanning a new file or input source. It's + * possible that this happened because the user + * just pointed yyin at a new source and called + * yylex(). If so, then we have to assure + * consistency between yy_current_buffer and our + * globals. Here is the right place to do so, because + * this is the first action (other than possibly a + * back-up) that will match for the new input source. + */ + yy_n_chars = yy_current_buffer->yy_n_chars; + yy_current_buffer->yy_input_file = yyin; + yy_current_buffer->yy_buffer_status = YY_BUFFER_NORMAL; + } + + /* Note that here we test for yy_c_buf_p "<=" to the position + * of the first EOB in the buffer, since yy_c_buf_p will + * already have been incremented past the NUL character + * (since all states make transitions on EOB to the + * end-of-buffer state). Contrast this with the test + * in input(). + */ + if ( yy_c_buf_p <= &yy_current_buffer->yy_ch_buf[yy_n_chars] ) + { /* This was really a NUL. */ + yy_state_type yy_next_state; + + yy_c_buf_p = yytext_ptr + yy_amount_of_matched_text; + + yy_current_state = yy_get_previous_state(); + + /* Okay, we're now positioned to make the NUL + * transition. We couldn't have + * yy_get_previous_state() go ahead and do it + * for us because it doesn't know how to deal + * with the possibility of jamming (and we don't + * want to build jamming into it because then it + * will run more slowly). + */ + + yy_next_state = yy_try_NUL_trans( yy_current_state ); + + yy_bp = yytext_ptr + YY_MORE_ADJ; + + if ( yy_next_state ) + { + /* Consume the NUL. */ + yy_cp = ++yy_c_buf_p; + yy_current_state = yy_next_state; + goto yy_match; + } + + else + { + yy_cp = yy_c_buf_p; + goto yy_find_action; + } + } + + else switch ( yy_get_next_buffer() ) + { + case EOB_ACT_END_OF_FILE: + { + yy_did_buffer_switch_on_eof = 0; + + if ( yywrap() ) + { + /* Note: because we've taken care in + * yy_get_next_buffer() to have set up + * yytext, we can now set up + * yy_c_buf_p so that if some total + * hoser (like flex itself) wants to + * call the scanner after we return the + * YY_NULL, it'll still work - another + * YY_NULL will get returned. + */ + yy_c_buf_p = yytext_ptr + YY_MORE_ADJ; + + yy_act = YY_STATE_EOF(YY_START); + goto do_action; + } + + else + { + if ( ! yy_did_buffer_switch_on_eof ) + YY_NEW_FILE; + } + break; + } + + case EOB_ACT_CONTINUE_SCAN: + yy_c_buf_p = + yytext_ptr + yy_amount_of_matched_text; + + yy_current_state = yy_get_previous_state(); + + yy_cp = yy_c_buf_p; + yy_bp = yytext_ptr + YY_MORE_ADJ; + goto yy_match; + + case EOB_ACT_LAST_MATCH: + yy_c_buf_p = + &yy_current_buffer->yy_ch_buf[yy_n_chars]; + + yy_current_state = yy_get_previous_state(); + + yy_cp = yy_c_buf_p; + yy_bp = yytext_ptr + YY_MORE_ADJ; + goto yy_find_action; + } + break; + } + + default: + YY_FATAL_ERROR( + "fatal flex scanner internal error--no action found" ); + } /* end of action switch */ + } /* end of scanning one token */ + } /* end of yylex */ + + +/* yy_get_next_buffer - try to read in a new buffer + * + * Returns a code representing an action: + * EOB_ACT_LAST_MATCH - + * EOB_ACT_CONTINUE_SCAN - continue scanning from current position + * EOB_ACT_END_OF_FILE - end of file + */ + +static int yy_get_next_buffer() + { + register char *dest = yy_current_buffer->yy_ch_buf; + register char *source = yytext_ptr; + register int number_to_move, i; + int ret_val; + + if ( yy_c_buf_p > &yy_current_buffer->yy_ch_buf[yy_n_chars + 1] ) + YY_FATAL_ERROR( + "fatal flex scanner internal error--end of buffer missed" ); + + if ( yy_current_buffer->yy_fill_buffer == 0 ) + { /* Don't try to fill the buffer, so this is an EOF. */ + if ( yy_c_buf_p - yytext_ptr - YY_MORE_ADJ == 1 ) + { + /* We matched a single character, the EOB, so + * treat this as a final EOF. + */ + return EOB_ACT_END_OF_FILE; + } + + else + { + /* We matched some text prior to the EOB, first + * process it. + */ + return EOB_ACT_LAST_MATCH; + } + } + + /* Try to read more data. */ + + /* First move last chars to start of buffer. */ + number_to_move = (int) (yy_c_buf_p - yytext_ptr) - 1; + + for ( i = 0; i < number_to_move; ++i ) + *(dest++) = *(source++); + + if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_EOF_PENDING ) + /* don't do the read, it's not guaranteed to return an EOF, + * just force an EOF + */ + yy_current_buffer->yy_n_chars = yy_n_chars = 0; + + else + { + int num_to_read = + yy_current_buffer->yy_buf_size - number_to_move - 1; + + while ( num_to_read <= 0 ) + { /* Not enough room in the buffer - grow it. */ +#ifdef YY_USES_REJECT + YY_FATAL_ERROR( +"input buffer overflow, can't enlarge buffer because scanner uses REJECT" ); +#else + + /* just a shorter name for the current buffer */ + YY_BUFFER_STATE b = yy_current_buffer; + + int yy_c_buf_p_offset = + (int) (yy_c_buf_p - b->yy_ch_buf); + + if ( b->yy_is_our_buffer ) + { + int new_size = b->yy_buf_size * 2; + + if ( new_size <= 0 ) + b->yy_buf_size += b->yy_buf_size / 8; + else + b->yy_buf_size *= 2; + + b->yy_ch_buf = (char *) + /* Include room in for 2 EOB chars. */ + yy_flex_realloc( (void *) b->yy_ch_buf, + b->yy_buf_size + 2 ); + } + else + /* Can't grow it, we don't own it. */ + b->yy_ch_buf = 0; + + if ( ! b->yy_ch_buf ) + YY_FATAL_ERROR( + "fatal error - scanner input buffer overflow" ); + + yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset]; + + num_to_read = yy_current_buffer->yy_buf_size - + number_to_move - 1; +#endif + } + + if ( num_to_read > YY_READ_BUF_SIZE ) + num_to_read = YY_READ_BUF_SIZE; + + /* Read in more data. */ + YY_INPUT( (&yy_current_buffer->yy_ch_buf[number_to_move]), + yy_n_chars, num_to_read ); + + yy_current_buffer->yy_n_chars = yy_n_chars; + } + + if ( yy_n_chars == 0 ) + { + if ( number_to_move == YY_MORE_ADJ ) + { + ret_val = EOB_ACT_END_OF_FILE; + yyrestart( yyin ); + } + + else + { + ret_val = EOB_ACT_LAST_MATCH; + yy_current_buffer->yy_buffer_status = + YY_BUFFER_EOF_PENDING; + } + } + + else + ret_val = EOB_ACT_CONTINUE_SCAN; + + yy_n_chars += number_to_move; + yy_current_buffer->yy_ch_buf[yy_n_chars] = YY_END_OF_BUFFER_CHAR; + yy_current_buffer->yy_ch_buf[yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR; + + yytext_ptr = &yy_current_buffer->yy_ch_buf[0]; + + return ret_val; + } + + +/* yy_get_previous_state - get the state just before the EOB char was reached */ + +static yy_state_type yy_get_previous_state() + { + register yy_state_type yy_current_state; + register char *yy_cp; + + yy_current_state = yy_start; + + for ( yy_cp = yytext_ptr + YY_MORE_ADJ; yy_cp < yy_c_buf_p; ++yy_cp ) + { + register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); + if ( yy_accept[yy_current_state] ) + { + yy_last_accepting_state = yy_current_state; + yy_last_accepting_cpos = yy_cp; + } + while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) + { + yy_current_state = (int) yy_def[yy_current_state]; + if ( yy_current_state >= 33 ) + yy_c = yy_meta[(unsigned int) yy_c]; + } + yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; + } + + return yy_current_state; + } + + +/* yy_try_NUL_trans - try to make a transition on the NUL character + * + * synopsis + * next_state = yy_try_NUL_trans( current_state ); + */ + +#ifdef YY_USE_PROTOS +static yy_state_type yy_try_NUL_trans( yy_state_type yy_current_state ) +#else +static yy_state_type yy_try_NUL_trans( yy_current_state ) +yy_state_type yy_current_state; +#endif + { + register int yy_is_jam; + register char *yy_cp = yy_c_buf_p; + + register YY_CHAR yy_c = 1; + if ( yy_accept[yy_current_state] ) + { + yy_last_accepting_state = yy_current_state; + yy_last_accepting_cpos = yy_cp; + } + while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) + { + yy_current_state = (int) yy_def[yy_current_state]; + if ( yy_current_state >= 33 ) + yy_c = yy_meta[(unsigned int) yy_c]; + } + yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; + yy_is_jam = (yy_current_state == 32); + + return yy_is_jam ? 0 : yy_current_state; + } + + +#ifndef YY_NO_UNPUT +#ifdef YY_USE_PROTOS +static void yyunput( int c, register char *yy_bp ) +#else +static void yyunput( c, yy_bp ) +int c; +register char *yy_bp; +#endif + { + register char *yy_cp = yy_c_buf_p; + + /* undo effects of setting up yytext */ + *yy_cp = yy_hold_char; + + if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 ) + { /* need to shift things up to make room */ + /* +2 for EOB chars. */ + register int number_to_move = yy_n_chars + 2; + register char *dest = &yy_current_buffer->yy_ch_buf[ + yy_current_buffer->yy_buf_size + 2]; + register char *source = + &yy_current_buffer->yy_ch_buf[number_to_move]; + + while ( source > yy_current_buffer->yy_ch_buf ) + *--dest = *--source; + + yy_cp += (int) (dest - source); + yy_bp += (int) (dest - source); + yy_current_buffer->yy_n_chars = + yy_n_chars = yy_current_buffer->yy_buf_size; + + if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 ) + YY_FATAL_ERROR( "flex scanner push-back overflow" ); + } + + *--yy_cp = (char) c; + + + yytext_ptr = yy_bp; + yy_hold_char = *yy_cp; + yy_c_buf_p = yy_cp; + } +#endif /* ifndef YY_NO_UNPUT */ + + +#ifndef YY_NO_INPUT +#ifdef __cplusplus +static int yyinput() +#else +static int input() +#endif + { + int c; + + *yy_c_buf_p = yy_hold_char; + + if ( *yy_c_buf_p == YY_END_OF_BUFFER_CHAR ) + { + /* yy_c_buf_p now points to the character we want to return. + * If this occurs *before* the EOB characters, then it's a + * valid NUL; if not, then we've hit the end of the buffer. + */ + if ( yy_c_buf_p < &yy_current_buffer->yy_ch_buf[yy_n_chars] ) + /* This was really a NUL. */ + *yy_c_buf_p = '\0'; + + else + { /* need more input */ + int offset = yy_c_buf_p - yytext_ptr; + ++yy_c_buf_p; + + switch ( yy_get_next_buffer() ) + { + case EOB_ACT_LAST_MATCH: + /* This happens because yy_g_n_b() + * sees that we've accumulated a + * token and flags that we need to + * try matching the token before + * proceeding. But for input(), + * there's no matching to consider. + * So convert the EOB_ACT_LAST_MATCH + * to EOB_ACT_END_OF_FILE. + */ + + /* Reset buffer status. */ + yyrestart( yyin ); + + /* fall through */ + + case EOB_ACT_END_OF_FILE: + { + if ( yywrap() ) + return EOF; + + if ( ! yy_did_buffer_switch_on_eof ) + YY_NEW_FILE; +#ifdef __cplusplus + return yyinput(); +#else + return input(); +#endif + } + + case EOB_ACT_CONTINUE_SCAN: + yy_c_buf_p = yytext_ptr + offset; + break; + } + } + } + + c = *(unsigned char *) yy_c_buf_p; /* cast for 8-bit char's */ + *yy_c_buf_p = '\0'; /* preserve yytext */ + yy_hold_char = *++yy_c_buf_p; + + + return c; + } +#endif /* YY_NO_INPUT */ + +#ifdef YY_USE_PROTOS +void yyrestart( FILE *input_file ) +#else +void yyrestart( input_file ) +FILE *input_file; +#endif + { + if ( ! yy_current_buffer ) + yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); + + yy_init_buffer( yy_current_buffer, input_file ); + yy_load_buffer_state(); + } + + +#ifdef YY_USE_PROTOS +void yy_switch_to_buffer( YY_BUFFER_STATE new_buffer ) +#else +void yy_switch_to_buffer( new_buffer ) +YY_BUFFER_STATE new_buffer; +#endif + { + if ( yy_current_buffer == new_buffer ) + return; + + if ( yy_current_buffer ) + { + /* Flush out information for old buffer. */ + *yy_c_buf_p = yy_hold_char; + yy_current_buffer->yy_buf_pos = yy_c_buf_p; + yy_current_buffer->yy_n_chars = yy_n_chars; + } + + yy_current_buffer = new_buffer; + yy_load_buffer_state(); + + /* We don't actually know whether we did this switch during + * EOF (yywrap()) processing, but the only time this flag + * is looked at is after yywrap() is called, so it's safe + * to go ahead and always set it. + */ + yy_did_buffer_switch_on_eof = 1; + } + + +#ifdef YY_USE_PROTOS +void yy_load_buffer_state( void ) +#else +void yy_load_buffer_state() +#endif + { + yy_n_chars = yy_current_buffer->yy_n_chars; + yytext_ptr = yy_c_buf_p = yy_current_buffer->yy_buf_pos; + yyin = yy_current_buffer->yy_input_file; + yy_hold_char = *yy_c_buf_p; + } + + +#ifdef YY_USE_PROTOS +YY_BUFFER_STATE yy_create_buffer( FILE *file, int size ) +#else +YY_BUFFER_STATE yy_create_buffer( file, size ) +FILE *file; +int size; +#endif + { + YY_BUFFER_STATE b; + + b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) ); + if ( ! b ) + YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); + + b->yy_buf_size = size; + + /* yy_ch_buf has to be 2 characters longer than the size given because + * we need to put in 2 end-of-buffer characters. + */ + b->yy_ch_buf = (char *) yy_flex_alloc( b->yy_buf_size + 2 ); + if ( ! b->yy_ch_buf ) + YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); + + b->yy_is_our_buffer = 1; + + yy_init_buffer( b, file ); + + return b; + } + + +#ifdef YY_USE_PROTOS +void yy_delete_buffer( YY_BUFFER_STATE b ) +#else +void yy_delete_buffer( b ) +YY_BUFFER_STATE b; +#endif + { + if ( ! b ) + return; + + if ( b == yy_current_buffer ) + yy_current_buffer = (YY_BUFFER_STATE) 0; + + if ( b->yy_is_our_buffer ) + yy_flex_free( (void *) b->yy_ch_buf ); + + yy_flex_free( (void *) b ); + } + + + +#ifdef YY_USE_PROTOS +void yy_init_buffer( YY_BUFFER_STATE b, FILE *file ) +#else +void yy_init_buffer( b, file ) +YY_BUFFER_STATE b; +FILE *file; +#endif + + + { + yy_flush_buffer( b ); + + b->yy_input_file = file; + b->yy_fill_buffer = 1; + +#if YY_ALWAYS_INTERACTIVE + b->yy_is_interactive = 1; +#else +#if YY_NEVER_INTERACTIVE + b->yy_is_interactive = 0; +#else + b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0; +#endif +#endif + } + + +#ifdef YY_USE_PROTOS +void yy_flush_buffer( YY_BUFFER_STATE b ) +#else +void yy_flush_buffer( b ) +YY_BUFFER_STATE b; +#endif + + { + if ( ! b ) + return; + + b->yy_n_chars = 0; + + /* We always need two end-of-buffer characters. The first causes + * a transition to the end-of-buffer state. The second causes + * a jam in that state. + */ + b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR; + b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR; + + b->yy_buf_pos = &b->yy_ch_buf[0]; + + b->yy_at_bol = 1; + b->yy_buffer_status = YY_BUFFER_NEW; + + if ( b == yy_current_buffer ) + yy_load_buffer_state(); + } + + +#ifndef YY_NO_SCAN_BUFFER +#ifdef YY_USE_PROTOS +YY_BUFFER_STATE yy_scan_buffer( char *base, yy_size_t size ) +#else +YY_BUFFER_STATE yy_scan_buffer( base, size ) +char *base; +yy_size_t size; +#endif + { + YY_BUFFER_STATE b; + + if ( size < 2 || + base[size-2] != YY_END_OF_BUFFER_CHAR || + base[size-1] != YY_END_OF_BUFFER_CHAR ) + /* They forgot to leave room for the EOB's. */ + return 0; + + b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) ); + if ( ! b ) + YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" ); + + b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */ + b->yy_buf_pos = b->yy_ch_buf = base; + b->yy_is_our_buffer = 0; + b->yy_input_file = 0; + b->yy_n_chars = b->yy_buf_size; + b->yy_is_interactive = 0; + b->yy_at_bol = 1; + b->yy_fill_buffer = 0; + b->yy_buffer_status = YY_BUFFER_NEW; + + yy_switch_to_buffer( b ); + + return b; + } +#endif + + +#ifndef YY_NO_SCAN_STRING +#ifdef YY_USE_PROTOS +YY_BUFFER_STATE yy_scan_string( yyconst char *yy_str ) +#else +YY_BUFFER_STATE yy_scan_string( yy_str ) +yyconst char *yy_str; +#endif + { + int len; + for ( len = 0; yy_str[len]; ++len ) + ; + + return yy_scan_bytes( yy_str, len ); + } +#endif + + +#ifndef YY_NO_SCAN_BYTES +#ifdef YY_USE_PROTOS +YY_BUFFER_STATE yy_scan_bytes( yyconst char *bytes, int len ) +#else +YY_BUFFER_STATE yy_scan_bytes( bytes, len ) +yyconst char *bytes; +int len; +#endif + { + YY_BUFFER_STATE b; + char *buf; + yy_size_t n; + int i; + + /* Get memory for full buffer, including space for trailing EOB's. */ + n = len + 2; + buf = (char *) yy_flex_alloc( n ); + if ( ! buf ) + YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" ); + + for ( i = 0; i < len; ++i ) + buf[i] = bytes[i]; + + buf[len] = buf[len+1] = YY_END_OF_BUFFER_CHAR; + + b = yy_scan_buffer( buf, n ); + if ( ! b ) + YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" ); + + /* It's okay to grow etc. this buffer, and we should throw it + * away when we're done. + */ + b->yy_is_our_buffer = 1; + + return b; + } +#endif + + +#ifndef YY_NO_PUSH_STATE +#ifdef YY_USE_PROTOS +static void yy_push_state( int new_state ) +#else +static void yy_push_state( new_state ) +int new_state; +#endif + { + if ( yy_start_stack_ptr >= yy_start_stack_depth ) + { + yy_size_t new_size; + + yy_start_stack_depth += YY_START_STACK_INCR; + new_size = yy_start_stack_depth * sizeof( int ); + + if ( ! yy_start_stack ) + yy_start_stack = (int *) yy_flex_alloc( new_size ); + + else + yy_start_stack = (int *) yy_flex_realloc( + (void *) yy_start_stack, new_size ); + + if ( ! yy_start_stack ) + YY_FATAL_ERROR( + "out of memory expanding start-condition stack" ); + } + + yy_start_stack[yy_start_stack_ptr++] = YY_START; + + BEGIN(new_state); + } +#endif + + +#ifndef YY_NO_POP_STATE +static void yy_pop_state() + { + if ( --yy_start_stack_ptr < 0 ) + YY_FATAL_ERROR( "start-condition stack underflow" ); + + BEGIN(yy_start_stack[yy_start_stack_ptr]); + } +#endif + + +#ifndef YY_NO_TOP_STATE +static int yy_top_state() + { + return yy_start_stack[yy_start_stack_ptr - 1]; + } +#endif + +#ifndef YY_EXIT_FAILURE +#define YY_EXIT_FAILURE 2 +#endif + +#ifdef YY_USE_PROTOS +static void yy_fatal_error( yyconst char msg[] ) +#else +static void yy_fatal_error( msg ) +char msg[]; +#endif + { + (void) fprintf( stderr, "%s\n", msg ); + exit( YY_EXIT_FAILURE ); + } + + + +/* Redefine yyless() so it works in section 3 code. */ + +#undef yyless +#define yyless(n) \ + do \ + { \ + /* Undo effects of setting up yytext. */ \ + yytext[yyleng] = yy_hold_char; \ + yy_c_buf_p = yytext + n; \ + yy_hold_char = *yy_c_buf_p; \ + *yy_c_buf_p = '\0'; \ + yyleng = n; \ + } \ + while ( 0 ) + + +/* Internal utility routines. */ + +#ifndef yytext_ptr +#ifdef YY_USE_PROTOS +static void yy_flex_strncpy( char *s1, yyconst char *s2, int n ) +#else +static void yy_flex_strncpy( s1, s2, n ) +char *s1; +yyconst char *s2; +int n; +#endif + { + register int i; + for ( i = 0; i < n; ++i ) + s1[i] = s2[i]; + } +#endif + +#ifdef YY_NEED_STRLEN +#ifdef YY_USE_PROTOS +static int yy_flex_strlen( yyconst char *s ) +#else +static int yy_flex_strlen( s ) +yyconst char *s; +#endif + { + register int n; + for ( n = 0; s[n]; ++n ) + ; + + return n; + } +#endif + + +#ifdef YY_USE_PROTOS +static void *yy_flex_alloc( yy_size_t size ) +#else +static void *yy_flex_alloc( size ) +yy_size_t size; +#endif + { + return (void *) malloc( size ); + } + +#ifdef YY_USE_PROTOS +static void *yy_flex_realloc( void *ptr, yy_size_t size ) +#else +static void *yy_flex_realloc( ptr, size ) +void *ptr; +yy_size_t size; +#endif + { + /* The cast to (char *) in the following accommodates both + * implementations that use char* generic pointers, and those + * that use void* generic pointers. It works with the latter + * because both ANSI C and C++ allow castless assignment from + * any pointer type to void*, and deal with argument conversions + * as though doing an assignment. + */ + return (void *) realloc( (char *) ptr, size ); + } + +#ifdef YY_USE_PROTOS +static void yy_flex_free( void *ptr ) +#else +static void yy_flex_free( ptr ) +void *ptr; +#endif + { + free( ptr ); + } + +#if YY_MAIN +int main() + { + yylex(); + return 0; + } +#endif +#line 134 "lex.l" + +#ifndef yywrap +int yywrap() { return(1);} +#endif + +#undef unput +#undef input +#undef output +#undef feof +#define unput(c) twmUnput(c) +#define input() (*twmInputFunc)() +#define output(c) TwmOutput(c) +#define feof() (1) diff --git a/app/twm/src/lex.l b/app/twm/src/lex.l new file mode 100644 index 000000000..6f0f6277a --- /dev/null +++ b/app/twm/src/lex.l @@ -0,0 +1,146 @@ +%{ +/*****************************************************************************/ +/* + +Copyright 1989,1998 The Open Group + +Permission to use, copy, modify, distribute, and sell this software and its +documentation for any purpose is hereby granted without fee, provided that +the above copyright notice appear in all copies and that both that +copyright notice and this permission notice appear in supporting +documentation. + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the name of The Open Group shall not be +used in advertising or otherwise to promote the sale, use or other dealings +in this Software without prior written authorization from The Open Group. + +*/ +/** Copyright 1988 by Evans & Sutherland Computer Corporation, **/ +/** Salt Lake City, Utah **/ +/** Cambridge, Massachusetts **/ +/** **/ +/** All Rights Reserved **/ +/** **/ +/** Permission to use, copy, modify, and distribute this software and **/ +/** its documentation for any purpose and without fee is hereby **/ +/** granted, provided that the above copyright notice appear in all **/ +/** copies and that both that copyright notice and this permis- **/ +/** sion notice appear in supporting documentation, and that the **/ +/** name of Evans & Sutherland not be used in advertising **/ +/** in publicity pertaining to distribution of the software without **/ +/** specific, written prior permission. **/ +/** **/ +/** EVANS & SUTHERLAND DISCLAIMs ALL WARRANTIES WITH REGARD **/ +/** TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANT- **/ +/** ABILITY AND FITNESS, IN NO EVENT SHALL EVANS & SUTHERLAND **/ +/** BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAM- **/ +/** AGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA **/ +/** OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER **/ +/** TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE **/ +/** OR PERFORMANCE OF THIS SOFTWARE. **/ +/*****************************************************************************/ + +/*********************************************************************** + * + * $Xorg: lex.l,v 1.4 2001/02/09 02:05:36 xorgcvs Exp $ + * + * .twmrc lex file + * + * 12-Nov-87 Thomas E. LaStrange File created + * + ***********************************************************************/ +/* $XFree86: xc/programs/twm/lex.l,v 3.13 2001/08/27 21:11:39 dawes Exp $ */ + +/* #include */ /* lex already includes stdio.h */ +#include "twm.h" +#include "gram.h" +#include "list.h" +#include "parse.h" + +#ifdef FLEX_SCANNER +int yylineno; + +#undef YY_INPUT +#define YY_INPUT(buf,result,size) ((result) = doinput((buf),(size))) +int doinput (char *buf, int size) +{ + int c; + + if (size == 0) + return (0); + + if ((c = (*twmInputFunc)()) <= 0) + return (0); + + buf[0] = c; + return (1); +} +#define YY_NO_UNPUT +#endif + +%} + +string \"([^"]|\\.)*\" +number [0-9]+ +%% +"{" { return (LB); } +"}" { return (RB); } +"(" { return (LP); } +")" { return (RP); } +"=" { return (EQUALS); } +":" { return (COLON); } +"+" { return PLUS; } +"-" { return MINUS; } +"|" { return OR; } + +[a-zA-Z\.]+ { int token = parse_keyword ((char *)yytext, + &yylval.num); + if (token == ERRORTOKEN) { + twmrc_error_prefix(); + fprintf (stderr, + "ignoring unknown keyword: %s\n", + yytext); + ParseError = 1; + } else + return token; + } + +"!" { yylval.num = F_EXEC; return FSKEYWORD; } +"^" { yylval.num = F_CUT; return FSKEYWORD; } + +{string} { yylval.ptr = (char *)yytext; return STRING; } +{number} { (void)sscanf((char *)yytext, "%d", &yylval.num); + return (NUMBER); + } +\#[^\n]*\n {;} +[\r\n\t ] {;} +. { + twmrc_error_prefix(); + fprintf (stderr, + "ignoring character \"%s\"\n", + yytext); + ParseError = 1; + } +%% +#ifndef yywrap +int yywrap() { return(1);} +#endif + +#undef unput +#undef input +#undef output +#undef feof +#define unput(c) twmUnput(c) +#define input() (*twmInputFunc)() +#define output(c) TwmOutput(c) +#define feof() (1) diff --git a/app/twm/src/list.c b/app/twm/src/list.c new file mode 100644 index 000000000..9a5b4f59f --- /dev/null +++ b/app/twm/src/list.c @@ -0,0 +1,220 @@ +/*****************************************************************************/ +/* + +Copyright 1989, 1998 The Open Group + +Permission to use, copy, modify, distribute, and sell this software and its +documentation for any purpose is hereby granted without fee, provided that +the above copyright notice appear in all copies and that both that +copyright notice and this permission notice appear in supporting +documentation. + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the name of The Open Group shall not be +used in advertising or otherwise to promote the sale, use or other dealings +in this Software without prior written authorization from The Open Group. + +*/ +/** Copyright 1988 by Evans & Sutherland Computer Corporation, **/ +/** Salt Lake City, Utah **/ +/** Cambridge, Massachusetts **/ +/** **/ +/** All Rights Reserved **/ +/** **/ +/** Permission to use, copy, modify, and distribute this software and **/ +/** its documentation for any purpose and without fee is hereby **/ +/** granted, provided that the above copyright notice appear in all **/ +/** copies and that both that copyright notice and this permis- **/ +/** sion notice appear in supporting documentation, and that the **/ +/** name of Evans & Sutherland not be used in advertising **/ +/** in publicity pertaining to distribution of the software without **/ +/** specific, written prior permission. **/ +/** **/ +/** EVANS & SUTHERLAND DISCLAIMs ALL WARRANTIES WITH REGARD **/ +/** TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANT- **/ +/** ABILITY AND FITNESS, IN NO EVENT SHALL EVANS & SUTHERLAND **/ +/** BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAM- **/ +/** AGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA **/ +/** OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER **/ +/** TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE **/ +/** OR PERFORMANCE OF THIS SOFTWARE. **/ +/*****************************************************************************/ +/* $XFree86: xc/programs/twm/list.c,v 1.8 2002/09/24 21:00:27 tsi Exp $ */ + + +/********************************************************************** + * + * $Xorg: list.c,v 1.4 2001/02/09 02:05:36 xorgcvs Exp $ + * + * TWM code to deal with the name lists for the NoTitle list and + * the AutoRaise list + * + * 11-Apr-88 Tom LaStrange Initial Version. + * + **********************************************************************/ + +#include +#include "twm.h" +#include "screen.h" +#include "gram.h" +#include "util.h" + +struct name_list_struct +{ + name_list *next; /**< pointer to the next name */ + char *name; /**< the name of the window */ + char *ptr; /**< list dependent data */ +}; + +/** + * add a window name to the appropriate list. + * + * If the list does not use the ptr value, a non-null value + * should be placed in it. LookInList returns this ptr value + * and procedures calling LookInList will check for a non-null + * return value as an indication of success. + * + * \param list the address of the pointer to the head of a list + * \param name a pointer to the name of the window + * \param ptr pointer to list dependent data + */ +void +AddToList(name_list **list_head, char *name, char *ptr) +{ + name_list *nptr; + + if (!list_head) return; /* ignore empty inserts */ + + nptr = (name_list *)malloc(sizeof(name_list)); + if (nptr == NULL) + { + twmrc_error_prefix(); + fprintf (stderr, "unable to allocate %ld bytes for name_list\n", + (unsigned long)sizeof(name_list)); + Done(NULL, NULL); + } + + nptr->next = *list_head; + nptr->name = name; + nptr->ptr = (ptr == NULL) ? (char *)TRUE : ptr; + *list_head = nptr; +} + +/** + * look through a list for a window name, or class + * + * \return the ptr field of the list structure or NULL if the name + * or class was not found in the list + * + * \param list a pointer to the head of a list + * \param name a pointer to the name to look for + * \param class a pointer to the class to look for + */ +char * +LookInList(name_list *list_head, char *name, XClassHint *class) +{ + name_list *nptr; + + /* look for the name first */ + for (nptr = list_head; nptr != NULL; nptr = nptr->next) + if (strcmp(name, nptr->name) == 0) + return (nptr->ptr); + + if (class) + { + /* look for the res_name next */ + for (nptr = list_head; nptr != NULL; nptr = nptr->next) + if (strcmp(class->res_name, nptr->name) == 0) + return (nptr->ptr); + + /* finally look for the res_class */ + for (nptr = list_head; nptr != NULL; nptr = nptr->next) + if (strcmp(class->res_class, nptr->name) == 0) + return (nptr->ptr); + } + return (NULL); +} + +char * +LookInNameList(name_list *list_head, char *name) +{ + return (LookInList(list_head, name, NULL)); +} + +/** + * look through a list for a window name, or class + * + * \return TRUE if the name was found + * \return FALSE if the name was not found + * + * \param list a pointer to the head of a list + * \param name a pointer to the name to look for + * \param class a pointer to the class to look for + * \param[out] ptr fill in the list value if the name was found + */ +int GetColorFromList(name_list *list_head, char *name, XClassHint *class, + Pixel *ptr) +{ + int save; + name_list *nptr; + + for (nptr = list_head; nptr != NULL; nptr = nptr->next) + if (strcmp(name, nptr->name) == 0) + { + save = Scr->FirstTime; + Scr->FirstTime = TRUE; + GetColor(Scr->Monochrome, ptr, nptr->ptr); + Scr->FirstTime = save; + return (TRUE); + } + + if (class) + { + for (nptr = list_head; nptr != NULL; nptr = nptr->next) + if (strcmp(class->res_name, nptr->name) == 0) + { + save = Scr->FirstTime; + Scr->FirstTime = TRUE; + GetColor(Scr->Monochrome, ptr, nptr->ptr); + Scr->FirstTime = save; + return (TRUE); + } + + for (nptr = list_head; nptr != NULL; nptr = nptr->next) + if (strcmp(class->res_class, nptr->name) == 0) + { + save = Scr->FirstTime; + Scr->FirstTime = TRUE; + GetColor(Scr->Monochrome, ptr, nptr->ptr); + Scr->FirstTime = save; + return (TRUE); + } + } + return (FALSE); +} + +/** + * free up a list + */ +void FreeList(name_list **list) +{ + name_list *nptr; + name_list *tmp; + + for (nptr = *list; nptr != NULL; ) + { + tmp = nptr->next; + free((char *) nptr); + nptr = tmp; + } + *list = NULL; +} diff --git a/app/twm/src/list.h b/app/twm/src/list.h new file mode 100644 index 000000000..35488f57a --- /dev/null +++ b/app/twm/src/list.h @@ -0,0 +1,84 @@ +/*****************************************************************************/ +/* + +Copyright 1989, 1998 The Open Group + +Permission to use, copy, modify, distribute, and sell this software and its +documentation for any purpose is hereby granted without fee, provided that +the above copyright notice appear in all copies and that both that +copyright notice and this permission notice appear in supporting +documentation. + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the name of The Open Group shall not be +used in advertising or otherwise to promote the sale, use or other dealings +in this Software without prior written authorization from The Open Group. + +*/ +/** Copyright 1988 by Evans & Sutherland Computer Corporation, **/ +/** Salt Lake City, Utah **/ +/** Cambridge, Massachusetts **/ +/** **/ +/** All Rights Reserved **/ +/** **/ +/** Permission to use, copy, modify, and distribute this software and **/ +/** its documentation for any purpose and without fee is hereby **/ +/** granted, provided that the above copyright notice appear in all **/ +/** copies and that both that copyright notice and this permis- **/ +/** sion notice appear in supporting documentation, and that the **/ +/** name of Evans & Sutherland not be used in advertising **/ +/** in publicity pertaining to distribution of the software without **/ +/** specific, written prior permission. **/ +/** **/ +/** EVANS & SUTHERLAND DISCLAIMs ALL WARRANTIES WITH REGARD **/ +/** TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANT- **/ +/** ABILITY AND FITNESS, IN NO EVENT SHALL EVANS & SUTHERLAND **/ +/** BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAM- **/ +/** AGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA **/ +/** OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER **/ +/** TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE **/ +/** OR PERFORMANCE OF THIS SOFTWARE. **/ +/*****************************************************************************/ +/* $XFree86: xc/programs/twm/list.h,v 1.4 2001/01/17 23:45:07 dawes Exp $ */ + + +/********************************************************************** + * + * $Xorg: list.h,v 1.4 2001/02/09 02:05:36 xorgcvs Exp $ + * + * TWM list handling external definitions + * + * 11-Apr-88 Tom LaStrange Initial Version. + * + **********************************************************************/ + +#ifndef _LIST_ +#define _LIST_ + +#include +#include +#include + +typedef struct name_list_struct name_list; + +extern void AddToList ( name_list **list_head, char *name, char *ptr ); +extern void FreeList ( name_list **list ); + +extern int GetColorFromList ( name_list *list_head, char *name, + XClassHint *class, Pixel *ptr ); +extern char * LookInList ( name_list *list_head, char *name, + XClassHint *class ); +extern char * LookInNameList ( name_list *list_head, char *name ); + + +#endif /* _LIST_ */ + diff --git a/app/twm/src/menus.c b/app/twm/src/menus.c new file mode 100644 index 000000000..d91dd2412 --- /dev/null +++ b/app/twm/src/menus.c @@ -0,0 +1,2937 @@ +/* $XFree86: xc/programs/twm/menus.c,v 1.18tsi Exp $ */ +/*****************************************************************************/ +/* + +Copyright 1989, 1998 The Open Group + +Permission to use, copy, modify, distribute, and sell this software and its +documentation for any purpose is hereby granted without fee, provided that +the above copyright notice appear in all copies and that both that +copyright notice and this permission notice appear in supporting +documentation. + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the name of The Open Group shall not be +used in advertising or otherwise to promote the sale, use or other dealings +in this Software without prior written authorization from The Open Group. + +*/ +/** Copyright 1988 by Evans & Sutherland Computer Corporation, **/ +/** Salt Lake City, Utah **/ +/** Cambridge, Massachusetts **/ +/** **/ +/** All Rights Reserved **/ +/** **/ +/** Permission to use, copy, modify, and distribute this software and **/ +/** its documentation for any purpose and without fee is hereby **/ +/** granted, provided that the above copyright notice appear in all **/ +/** copies and that both that copyright notice and this permis- **/ +/** sion notice appear in supporting documentation, and that the **/ +/** name of Evans & Sutherland not be used in advertising **/ +/** in publicity pertaining to distribution of the software without **/ +/** specific, written prior permission. **/ +/** **/ +/** EVANS & SUTHERLAND DISCLAIMs ALL WARRANTIES WITH REGARD **/ +/** TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANT- **/ +/** ABILITY AND FITNESS, IN NO EVENT SHALL EVANS & SUTHERLAND **/ +/** BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAM- **/ +/** AGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA **/ +/** OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER **/ +/** TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE **/ +/** OR PERFORMANCE OF THIS SOFTWARE. **/ +/*****************************************************************************/ + + +/*********************************************************************** + * + * $Xorg: menus.c,v 1.6 2001/02/09 02:05:36 xorgcvs Exp $ + * + * twm menu code + * + * 17-Nov-87 Thomas E. LaStrange File created + * + ***********************************************************************/ + +#include +#include +#include "twm.h" +#include "gc.h" +#include "menus.h" +#include "resize.h" +#include "events.h" +#include "util.h" +#include "parse.h" +#include "gram.h" +#include "screen.h" +#include "menus.h" +#include "iconmgr.h" +#include "add_window.h" +#include "icons.h" +#include "session.h" +#include +#include "version.h" +#include +#include + +int RootFunction = 0; +MenuRoot *ActiveMenu = NULL; /**< the active menu */ +MenuItem *ActiveItem = NULL; /**< the active menu item */ +int MoveFunction; /**< either F_MOVE or F_FORCEMOVE */ +int WindowMoved = FALSE; +int menuFromFrameOrWindowOrTitlebar = FALSE; + +int ConstMove = FALSE; /**< constrained move variables */ +int ConstMoveDir; +int ConstMoveX; +int ConstMoveY; +int ConstMoveXL; +int ConstMoveXR; +int ConstMoveYT; +int ConstMoveYB; + +/* Globals used to keep track of whether the mouse has moved during + a resize function. */ +int ResizeOrigX; +int ResizeOrigY; + +int MenuDepth = 0; /**< number of menus up */ +static struct { + int x; + int y; +} MenuOrigins[MAXMENUDEPTH]; +static Cursor LastCursor; + +static Bool belongs_to_twm_window ( TwmWindow *t, Window w ); +static void Identify ( TwmWindow *t ); +static void send_clientmessage ( Window w, Atom a, Time timestamp ); + +#define SHADOWWIDTH 5 /* in pixels */ + + + + +/** + * initialize menu roots + */ +void +InitMenus() +{ + int i, j, k; + FuncKey *key, *tmp; + + for (i = 0; i < MAX_BUTTONS+1; i++) + for (j = 0; j < NUM_CONTEXTS; j++) + for (k = 0; k < MOD_SIZE; k++) + { + Scr->Mouse[i][j][k].func = 0; + Scr->Mouse[i][j][k].item = NULL; + } + + Scr->DefaultFunction.func = 0; + Scr->WindowFunction.func = 0; + + if (FirstScreen) + { + for (key = Scr->FuncKeyRoot.next; key != NULL;) + { + free(key->name); + tmp = key; + key = key->next; + free((char *) tmp); + } + Scr->FuncKeyRoot.next = NULL; + } + +} + + + +/** + * add a function key to the list + * + * \param name the name of the key + * \param cont the context to look for the key press in + * \param mods modifier keys that need to be pressed + * \param func the function to perform + * \param win_name the window name (if any) + * \param action the action string associated with the function (if any) + */ +Bool AddFuncKey (char *name, int cont, int mods, int func, char *win_name, + char *action) +{ + FuncKey *tmp; + KeySym keysym; + KeyCode keycode; + + /* + * Don't let a 0 keycode go through, since that means AnyKey to the + * XGrabKey call in GrabKeys(). + */ + if ((keysym = XStringToKeysym(name)) == NoSymbol || + (keycode = XKeysymToKeycode(dpy, keysym)) == 0) + { + return False; + } + + /* see if there already is a key defined for this context */ + for (tmp = Scr->FuncKeyRoot.next; tmp != NULL; tmp = tmp->next) + { + if (tmp->keysym == keysym && + tmp->cont == cont && + tmp->mods == mods) + break; + } + + if (tmp == NULL) + { + tmp = (FuncKey *) malloc(sizeof(FuncKey)); + tmp->next = Scr->FuncKeyRoot.next; + Scr->FuncKeyRoot.next = tmp; + } + + tmp->name = name; + tmp->keysym = keysym; + tmp->keycode = keycode; + tmp->cont = cont; + tmp->mods = mods; + tmp->func = func; + tmp->win_name = win_name; + tmp->action = action; + + return True; +} + + + +int CreateTitleButton (char *name, int func, char *action, MenuRoot *menuroot, + Bool rightside, Bool append) +{ + TitleButton *tb = (TitleButton *) malloc (sizeof(TitleButton)); + + if (!tb) { + fprintf (stderr, + "%s: unable to allocate %ld bytes for title button\n", + ProgramName, (unsigned long)sizeof(TitleButton)); + return 0; + } + + tb->next = NULL; + tb->name = name; /* note that we are not copying */ + tb->bitmap = None; /* WARNING, values not set yet */ + tb->width = 0; /* see InitTitlebarButtons */ + tb->height = 0; /* ditto */ + tb->func = func; + tb->action = action; + tb->menuroot = menuroot; + tb->rightside = rightside; + if (rightside) { + Scr->TBInfo.nright++; + } else { + Scr->TBInfo.nleft++; + } + + /* + * Cases for list: + * + * 1. empty list, prepend left put at head of list + * 2. append left, prepend right put in between left and right + * 3. append right put at tail of list + * + * Do not refer to widths and heights yet since buttons not created + * (since fonts not loaded and heights not known). + */ + if ((!Scr->TBInfo.head) || ((!append) && (!rightside))) { /* 1 */ + tb->next = Scr->TBInfo.head; + Scr->TBInfo.head = tb; + } else if (append && rightside) { /* 3 */ + register TitleButton *t; + for /* SUPPRESS 530 */ + (t = Scr->TBInfo.head; t->next; t = t->next); + t->next = tb; + tb->next = NULL; + } else { /* 2 */ + register TitleButton *t, *prev = NULL; + for (t = Scr->TBInfo.head; t && !t->rightside; t = t->next) { + prev = t; + } + if (prev) { + tb->next = prev->next; + prev->next = tb; + } else { + tb->next = Scr->TBInfo.head; + Scr->TBInfo.head = tb; + } + } + + return 1; +} + + + +/** + * Do all the necessary stuff to load in a titlebar button. If we can't find + * the button, then put in a question; if we can't find the question mark, + * something is wrong and we are probably going to be in trouble later on. + */ +void InitTitlebarButtons () +{ + TitleButton *tb; + int h; + + /* + * initialize dimensions + */ + Scr->TBInfo.width = (Scr->TitleHeight - + 2 * (Scr->FramePadding + Scr->ButtonIndent)); + Scr->TBInfo.pad = ((Scr->TitlePadding > 1) + ? ((Scr->TitlePadding + 1) / 2) : 1); + h = Scr->TBInfo.width - 2 * Scr->TBInfo.border; + + /* + * add in some useful buttons and bindings so that novices can still + * use the system. + */ + if (!Scr->NoDefaults) { + /* insert extra buttons */ + if (!CreateTitleButton (TBPM_ICONIFY, F_ICONIFY, "", (MenuRoot *) NULL, + False, False)) { + fprintf (stderr, "%s: unable to add iconify button\n", + ProgramName); + } + if (!CreateTitleButton (TBPM_RESIZE, F_RESIZE, "", (MenuRoot *) NULL, + True, True)) { + fprintf (stderr, "%s: unable to add resize button\n", + ProgramName); + } + AddDefaultBindings (); + } + ComputeCommonTitleOffsets (); + + /* + * load in images and do appropriate centering + */ + + for (tb = Scr->TBInfo.head; tb; tb = tb->next) { + tb->bitmap = FindBitmap (tb->name, &tb->width, &tb->height); + if (!tb->bitmap) { + tb->bitmap = FindBitmap (TBPM_QUESTION, &tb->width, &tb->height); + if (!tb->bitmap) { /* cannot happen (see util.c) */ + fprintf (stderr, + "%s: unable to add titlebar button \"%s\"\n", + ProgramName, tb->name); + } + } + + tb->dstx = (h - tb->width + 1) / 2; + if (tb->dstx < 0) { /* clip to minimize copying */ + tb->srcx = -(tb->dstx); + tb->width = h; + tb->dstx = 0; + } else { + tb->srcx = 0; + } + tb->dsty = (h - tb->height + 1) / 2; + if (tb->dsty < 0) { + tb->srcy = -(tb->dsty); + tb->height = h; + tb->dsty = 0; + } else { + tb->srcy = 0; + } + } +} + + + +void +PaintEntry(MenuRoot *mr, MenuItem *mi, int exposure) +{ + int y_offset; + int text_y; + GC gc; + +#ifdef DEBUG_MENUS + fprintf(stderr, "Paint entry\n"); +#endif + y_offset = mi->item_num * Scr->EntryHeight; + text_y = y_offset + Scr->MenuFont.y; + + if (mi->func != F_TITLE) + { + int x, y; + + if (mi->state) + { + XSetForeground(dpy, Scr->NormalGC, mi->hi_back); + + XFillRectangle(dpy, mr->w, Scr->NormalGC, 0, y_offset, + mr->width, Scr->EntryHeight); + + MyFont_ChangeGC(mi->hi_fore, mi->hi_back, &Scr->MenuFont); + + MyFont_DrawString(dpy, mr->w, &Scr->MenuFont, Scr->NormalGC, mi->x, + text_y, mi->item, mi->strlen); + + gc = Scr->NormalGC; + } + else + { + if (mi->user_colors || !exposure) + { + XSetForeground(dpy, Scr->NormalGC, mi->back); + + XFillRectangle(dpy, mr->w, Scr->NormalGC, 0, y_offset, + mr->width, Scr->EntryHeight); + + MyFont_ChangeGC(mi->fore, mi->back, &Scr->MenuFont); + gc = Scr->NormalGC; + } + else + gc = Scr->MenuGC; + + MyFont_DrawString(dpy, mr->w, &Scr->MenuFont, gc, + mi->x, text_y, mi->item, mi->strlen); + + } + + if (mi->func == F_MENU) + { + /* create the pull right pixmap if needed */ + if (Scr->pullPm == None) + { + Scr->pullPm = CreateMenuIcon (Scr->MenuFont.height, + &Scr->pullW, &Scr->pullH); + } + x = mr->width - Scr->pullW - 5; + y = y_offset + ((Scr->MenuFont.height - Scr->pullH) / 2); + XCopyPlane(dpy, Scr->pullPm, mr->w, gc, 0, 0, + Scr->pullW, Scr->pullH, x, y, 1); + } + } + else + { + int y; + + XSetForeground(dpy, Scr->NormalGC, mi->back); + + /* fill the rectangle with the title background color */ + XFillRectangle(dpy, mr->w, Scr->NormalGC, 0, y_offset, + mr->width, Scr->EntryHeight); + + { + XSetForeground(dpy, Scr->NormalGC, mi->fore); + /* now draw the dividing lines */ + if (y_offset) + XDrawLine (dpy, mr->w, Scr->NormalGC, 0, y_offset, + mr->width, y_offset); + y = ((mi->item_num+1) * Scr->EntryHeight)-1; + XDrawLine(dpy, mr->w, Scr->NormalGC, 0, y, mr->width, y); + } + + MyFont_ChangeGC(mi->fore, mi->back, &Scr->MenuFont); + /* finally render the title */ + MyFont_DrawString(dpy, mr->w, &Scr->MenuFont, Scr->NormalGC, mi->x, + text_y, mi->item, mi->strlen); + } +} + + +void +PaintMenu(MenuRoot *mr, XEvent *e) +{ + MenuItem *mi; + + for (mi = mr->first; mi != NULL; mi = mi->next) + { + int y_offset = mi->item_num * Scr->EntryHeight; + + /* be smart about handling the expose, redraw only the entries + * that we need to + */ + if (e->xexpose.y < (y_offset + Scr->EntryHeight) && + (e->xexpose.y + e->xexpose.height) > y_offset) + { + PaintEntry(mr, mi, True); + } + } + XSync(dpy, 0); +} + + + +static Bool fromMenu; + +void +UpdateMenu() +{ + MenuItem *mi; + int i, x, y, x_root, y_root, entry; + int done; + MenuItem *badItem = NULL; + + fromMenu = TRUE; + + while (TRUE) + { + /* block until there is an event */ + if (!menuFromFrameOrWindowOrTitlebar) { + XMaskEvent(dpy, + ButtonPressMask | ButtonReleaseMask | + EnterWindowMask | ExposureMask | + VisibilityChangeMask | LeaveWindowMask | + ButtonMotionMask, &Event); + } + if (Event.type == MotionNotify) { + /* discard any extra motion events before a release */ + while(XCheckMaskEvent(dpy, + ButtonMotionMask | ButtonReleaseMask, &Event)) + if (Event.type == ButtonRelease) + break; + } + + if (!DispatchEvent ()) + continue; + + if (Event.type == ButtonRelease || Cancel) { + menuFromFrameOrWindowOrTitlebar = FALSE; + fromMenu = FALSE; + return; + } + + if (Event.type != MotionNotify) + continue; + + done = FALSE; + XQueryPointer( dpy, ActiveMenu->w, &JunkRoot, &JunkChild, + &x_root, &y_root, &x, &y, &JunkMask); + + /* if we haven't recieved the enter notify yet, wait */ + if (ActiveMenu && !ActiveMenu->entered) + continue; + + XFindContext(dpy, ActiveMenu->w, ScreenContext, (caddr_t *)&Scr); + + if (x < 0 || y < 0 || + x >= ActiveMenu->width || y >= ActiveMenu->height) + { + if (ActiveItem && ActiveItem->func != F_TITLE) + { + ActiveItem->state = 0; + PaintEntry(ActiveMenu, ActiveItem, False); + } + ActiveItem = NULL; + continue; + } + + /* look for the entry that the mouse is in */ + entry = y / Scr->EntryHeight; + for (i = 0, mi = ActiveMenu->first; mi != NULL; i++, mi=mi->next) + { + if (i == entry) + break; + } + + /* if there is an active item, we might have to turn it off */ + if (ActiveItem) + { + /* is the active item the one we are on ? */ + if (ActiveItem->item_num == entry && ActiveItem->state) + done = TRUE; + + /* if we weren't on the active entry, let's turn the old + * active one off + */ + if (!done && ActiveItem->func != F_TITLE) + { + ActiveItem->state = 0; + PaintEntry(ActiveMenu, ActiveItem, False); + } + } + + /* if we weren't on the active item, change the active item and turn + * it on + */ + if (!done) + { + ActiveItem = mi; + if (ActiveItem->func != F_TITLE && !ActiveItem->state) + { + ActiveItem->state = 1; + PaintEntry(ActiveMenu, ActiveItem, False); + } + } + + /* now check to see if we were over the arrow of a pull right entry */ + if (ActiveItem->func == F_MENU && + ((ActiveMenu->width - x) < (ActiveMenu->width >> 1))) + { + MenuRoot *save = ActiveMenu; + int savex = MenuOrigins[MenuDepth - 1].x; + int savey = MenuOrigins[MenuDepth - 1].y; + + if (MenuDepth < MAXMENUDEPTH) { + PopUpMenu (ActiveItem->sub, + (savex + (ActiveMenu->width >> 1)), + (savey + ActiveItem->item_num * Scr->EntryHeight) + /*(savey + ActiveItem->item_num * Scr->EntryHeight + + (Scr->EntryHeight >> 1))*/, False); + } else if (!badItem) { + Bell(XkbBI_MinorError,0,None); + badItem = ActiveItem; + } + + /* if the menu did get popped up, unhighlight the active item */ + if (save != ActiveMenu && ActiveItem->state) + { + ActiveItem->state = 0; + PaintEntry(save, ActiveItem, False); + ActiveItem = NULL; + } + } + if (badItem != ActiveItem) badItem = NULL; + XFlush(dpy); + } + +} + + + +/** + * create a new menu root + * + * \param name the name of the menu root + */ +MenuRoot * +NewMenuRoot(char *name) +{ + MenuRoot *tmp; + +#define UNUSED_PIXEL ((unsigned long) (~0)) /* more than 24 bits */ + + tmp = (MenuRoot *) malloc(sizeof(MenuRoot)); + tmp->hi_fore = UNUSED_PIXEL; + tmp->hi_back = UNUSED_PIXEL; + tmp->name = name; + tmp->prev = NULL; + tmp->first = NULL; + tmp->last = NULL; + tmp->items = 0; + tmp->width = 0; + tmp->mapped = NEVER_MAPPED; + tmp->pull = FALSE; + tmp->w = None; + tmp->shadow = None; + tmp->real_menu = FALSE; + + if (Scr->MenuList == NULL) + { + Scr->MenuList = tmp; + Scr->MenuList->next = NULL; + } + + if (Scr->LastMenu == NULL) + { + Scr->LastMenu = tmp; + Scr->LastMenu->next = NULL; + } + else + { + Scr->LastMenu->next = tmp; + Scr->LastMenu = tmp; + Scr->LastMenu->next = NULL; + } + + if (strcmp(name, TWM_WINDOWS) == 0) + Scr->Windows = tmp; + + return (tmp); +} + + + +/** + * add an item to a root menu + * + * \param menu pointer to the root menu to add the item + * \param item the text to appear in the menu + * \param action the string to possibly execute + * \param sub the menu root if it is a pull-right entry + * \param func the numeric function + * \param fore foreground color string + * \param back background color string + */ +MenuItem * +AddToMenu(MenuRoot *menu, char *item, char *action, MenuRoot *sub, int func, + char *fore, char *back) +{ + MenuItem *tmp; + int width; + +#ifdef DEBUG_MENUS + fprintf(stderr, "adding menu item=\"%s\", action=%s, sub=%d, f=%d\n", + item, action, sub, func); +#endif + + tmp = (MenuItem *) malloc(sizeof(MenuItem)); + tmp->root = menu; + + if (menu->first == NULL) + { + menu->first = tmp; + tmp->prev = NULL; + } + else + { + menu->last->next = tmp; + tmp->prev = menu->last; + } + menu->last = tmp; + + tmp->item = item; + tmp->strlen = strlen(item); + tmp->action = action; + tmp->next = NULL; + tmp->sub = NULL; + tmp->state = 0; + tmp->func = func; + + if (!Scr->HaveFonts) CreateFonts(); + width = MyFont_TextWidth(&Scr->MenuFont, item, tmp->strlen); + if (width <= 0) + width = 1; + if (width > menu->width) + menu->width = width; + + tmp->user_colors = FALSE; + if (Scr->Monochrome == COLOR && fore != NULL) + { + int save; + + save = Scr->FirstTime; + Scr->FirstTime = TRUE; + GetColor(COLOR, &tmp->fore, fore); + GetColor(COLOR, &tmp->back, back); + Scr->FirstTime = save; + tmp->user_colors = TRUE; + } + if (sub != NULL) + { + tmp->sub = sub; + menu->pull = TRUE; + } + tmp->item_num = menu->items++; + + return (tmp); +} + + +void +MakeMenus() +{ + MenuRoot *mr; + + for (mr = Scr->MenuList; mr != NULL; mr = mr->next) + { + if (mr->real_menu == FALSE) + continue; + + MakeMenu(mr); + } +} + + +void +MakeMenu(MenuRoot *mr) +{ + MenuItem *start, *end, *cur, *tmp; + XColor f1, f2, f3; + XColor b1, b2, b3; + XColor save_fore, save_back; + int num, i; + int fred, fgreen, fblue; + int bred, bgreen, bblue; + int width; + unsigned long valuemask; + XSetWindowAttributes attributes; + Colormap cmap = Scr->TwmRoot.cmaps.cwins[0]->colormap->c; + + Scr->EntryHeight = Scr->MenuFont.height + 4; + + /* lets first size the window accordingly */ + if (mr->mapped == NEVER_MAPPED) + { + if (mr->pull == TRUE) + { + mr->width += 16 + 10; + } + + width = mr->width + 10; + + for (cur = mr->first; cur != NULL; cur = cur->next) + { + if (cur->func != F_TITLE) + cur->x = 5; + else + { + cur->x = width - MyFont_TextWidth(&Scr->MenuFont, cur->item, + cur->strlen); + cur->x /= 2; + } + } + mr->height = mr->items * Scr->EntryHeight; + mr->width += 10; + + if (Scr->Shadow) + { + /* + * Make sure that you don't draw into the shadow window or else + * the background bits there will get saved + */ + valuemask = (CWBackPixel | CWBorderPixel); + attributes.background_pixel = Scr->MenuShadowColor; + attributes.border_pixel = Scr->MenuShadowColor; + if (Scr->SaveUnder) { + valuemask |= CWSaveUnder; + attributes.save_under = True; + } + mr->shadow = XCreateWindow (dpy, Scr->Root, 0, 0, + (unsigned int) mr->width, + (unsigned int) mr->height, + (unsigned int)0, + CopyFromParent, + (unsigned int) CopyFromParent, + (Visual *) CopyFromParent, + valuemask, &attributes); + } + + valuemask = (CWBackPixel | CWBorderPixel | CWEventMask); + attributes.background_pixel = Scr->MenuC.back; + attributes.border_pixel = Scr->MenuBorderColor; + attributes.event_mask = (ExposureMask | EnterWindowMask); + if (Scr->SaveUnder) { + valuemask |= CWSaveUnder; + attributes.save_under = True; + } + if (Scr->BackingStore) { + valuemask |= CWBackingStore; + attributes.backing_store = Always; + } + mr->w = XCreateWindow (dpy, Scr->Root, 0, 0, (unsigned int) mr->width, + (unsigned int) mr->height, + (unsigned int) Scr->MenuBorderWidth, + CopyFromParent, (unsigned int) CopyFromParent, + (Visual *) CopyFromParent, + valuemask, &attributes); + + + XSaveContext(dpy, mr->w, MenuContext, (caddr_t)mr); + XSaveContext(dpy, mr->w, ScreenContext, (caddr_t)Scr); + + mr->mapped = UNMAPPED; + } + + /* get the default colors into the menus */ + for (tmp = mr->first; tmp != NULL; tmp = tmp->next) + { + if (!tmp->user_colors) { + if (tmp->func != F_TITLE) { + tmp->fore = Scr->MenuC.fore; + tmp->back = Scr->MenuC.back; + } else { + tmp->fore = Scr->MenuTitleC.fore; + tmp->back = Scr->MenuTitleC.back; + } + } + + if (mr->hi_fore != UNUSED_PIXEL) + { + tmp->hi_fore = mr->hi_fore; + tmp->hi_back = mr->hi_back; + } + else + { + tmp->hi_fore = tmp->back; + tmp->hi_back = tmp->fore; + } + } + + if (Scr->Monochrome == MONOCHROME || !Scr->InterpolateMenuColors) + return; + + start = mr->first; + while (TRUE) + { + for (; start != NULL; start = start->next) + { + if (start->user_colors) + break; + } + if (start == NULL) + break; + + for (end = start->next; end != NULL; end = end->next) + { + if (end->user_colors) + break; + } + if (end == NULL) + break; + + /* we have a start and end to interpolate between */ + num = end->item_num - start->item_num; + + f1.pixel = start->fore; + XQueryColor(dpy, cmap, &f1); + f2.pixel = end->fore; + XQueryColor(dpy, cmap, &f2); + + b1.pixel = start->back; + XQueryColor(dpy, cmap, &b1); + b2.pixel = end->back; + XQueryColor(dpy, cmap, &b2); + + fred = ((int)f2.red - (int)f1.red) / num; + fgreen = ((int)f2.green - (int)f1.green) / num; + fblue = ((int)f2.blue - (int)f1.blue) / num; + + bred = ((int)b2.red - (int)b1.red) / num; + bgreen = ((int)b2.green - (int)b1.green) / num; + bblue = ((int)b2.blue - (int)b1.blue) / num; + + f3 = f1; + f3.flags = DoRed | DoGreen | DoBlue; + + b3 = b1; + b3.flags = DoRed | DoGreen | DoBlue; + + num -= 1; + for (i = 0, cur = start->next; i < num; i++, cur = cur->next) + { + f3.red += fred; + f3.green += fgreen; + f3.blue += fblue; + save_fore = f3; + + b3.red += bred; + b3.green += bgreen; + b3.blue += bblue; + save_back = b3; + + XAllocColor(dpy, cmap, &f3); + XAllocColor(dpy, cmap, &b3); + cur->hi_back = cur->fore = f3.pixel; + cur->hi_fore = cur->back = b3.pixel; + cur->user_colors = True; + + f3 = save_fore; + b3 = save_back; + } + start = end; + } +} + + + +/** + * pop up a pull down menu. + * + * \param menu the root pointer of the menu to pop up + * \param x,y location of upper left of menu + * \param center whether or not to center horizontally over position + */ +Bool +PopUpMenu (MenuRoot *menu, int x, int y, Bool center) +{ + int WindowNameCount; + TwmWindow **WindowNames; + TwmWindow *tmp_win2,*tmp_win3; + int i; + int (*compar)(const char *, const char *) = + (Scr->CaseSensitive ? strcmp : XmuCompareISOLatin1); + + if (!menu) return False; + + InstallRootColormap(); + + if (menu == Scr->Windows) + { + TwmWindow *tmp_win; + + /* this is the twm windows menu, let's go ahead and build it */ + + DestroyMenu (menu); + + menu->first = NULL; + menu->last = NULL; + menu->items = 0; + menu->width = 0; + menu->mapped = NEVER_MAPPED; + AddToMenu(menu, "TWM Windows", NULLSTR, NULL, F_TITLE,NULLSTR,NULLSTR); + + for(tmp_win = Scr->TwmRoot.next , WindowNameCount=0; + tmp_win != NULL; + tmp_win = tmp_win->next) + WindowNameCount++; + if (WindowNameCount != 0) + { + WindowNames = + (TwmWindow **)malloc(sizeof(TwmWindow *)*WindowNameCount); + WindowNames[0] = Scr->TwmRoot.next; + for(tmp_win = Scr->TwmRoot.next->next , WindowNameCount=1; + tmp_win != NULL; + tmp_win = tmp_win->next,WindowNameCount++) + { + tmp_win2 = tmp_win; + for (i=0;iname,WindowNames[i]->name) < 0) + { + tmp_win3 = tmp_win2; + tmp_win2 = WindowNames[i]; + WindowNames[i] = tmp_win3; + } + } + WindowNames[WindowNameCount] = tmp_win2; + } + for (i=0; iname, (char *)WindowNames[i], + NULL, F_POPUP,NULL,NULL); + } + free(WindowNames); + } + + MakeMenu(menu); + } + + if (menu->w == None || menu->items == 0) return False; + + /* Prevent recursively bringing up menus. */ + if (menu->mapped == MAPPED) return False; + + /* + * Dynamically set the parent; this allows pull-ups to also be main + * menus, or to be brought up from more than one place. + */ + menu->prev = ActiveMenu; + + XGrabPointer(dpy, Scr->Root, True, + ButtonPressMask | ButtonReleaseMask | + ButtonMotionMask | PointerMotionHintMask, + GrabModeAsync, GrabModeAsync, + Scr->Root, Scr->MenuCursor, CurrentTime); + + ActiveMenu = menu; + menu->mapped = MAPPED; + menu->entered = FALSE; + + if (center) { + x -= (menu->width / 2); + y -= (Scr->EntryHeight / 2); /* sticky menus would be nice here */ + } + + /* + * clip to screen + */ + if (x + menu->width > Scr->MyDisplayWidth) { + x = Scr->MyDisplayWidth - menu->width; + } + if (x < 0) x = 0; + if (y + menu->height > Scr->MyDisplayHeight) { + y = Scr->MyDisplayHeight - menu->height; + } + if (y < 0) y = 0; + + MenuOrigins[MenuDepth].x = x; + MenuOrigins[MenuDepth].y = y; + MenuDepth++; + + XMoveWindow(dpy, menu->w, x, y); + if (Scr->Shadow) { + XMoveWindow (dpy, menu->shadow, x + SHADOWWIDTH, y + SHADOWWIDTH); + } + if (Scr->Shadow) { + XRaiseWindow (dpy, menu->shadow); + } + XMapRaised(dpy, menu->w); + if (Scr->Shadow) { + XMapWindow (dpy, menu->shadow); + } + XSync(dpy, 0); + return True; +} + + + +/** + * unhighlight the current menu selection and take down the menus + */ +void +PopDownMenu() +{ + MenuRoot *tmp; + + if (ActiveMenu == NULL) + return; + + if (ActiveItem) + { + ActiveItem->state = 0; + PaintEntry(ActiveMenu, ActiveItem, False); + } + + for (tmp = ActiveMenu; tmp != NULL; tmp = tmp->prev) + { + if (Scr->Shadow) { + XUnmapWindow (dpy, tmp->shadow); + } + XUnmapWindow(dpy, tmp->w); + tmp->mapped = UNMAPPED; + UninstallRootColormap(); + } + + XFlush(dpy); + ActiveMenu = NULL; + ActiveItem = NULL; + MenuDepth = 0; + if (Context == C_WINDOW || Context == C_FRAME || Context == C_TITLE) + menuFromFrameOrWindowOrTitlebar = TRUE; +} + + + +/** + * look for a menu root + * + * \return a pointer to the menu root structure + * + * \param name the name of the menu root + */ +MenuRoot * +FindMenuRoot(char *name) +{ + MenuRoot *tmp; + + for (tmp = Scr->MenuList; tmp != NULL; tmp = tmp->next) + { + if (strcmp(name, tmp->name) == 0) + return (tmp); + } + return NULL; +} + + + +static Bool +belongs_to_twm_window (TwmWindow *t, Window w) +{ + if (!t) return False; + + if (w == t->frame || w == t->title_w || w == t->hilite_w || + w == t->icon_w || w == t->icon_bm_w) return True; + + if (t && t->titlebuttons) { + register TBWindow *tbw; + register int nb = Scr->TBInfo.nleft + Scr->TBInfo.nright; + for (tbw = t->titlebuttons; nb > 0; tbw++, nb--) { + if (tbw->window == w) return True; + } + } + return False; +} + + + +void +resizeFromCenter(Window w, TwmWindow *tmp_win) +{ + int lastx, lasty, bw2; + XEvent event; +#if 0 + int namelen; + int width, height; + + namelen = strlen (tmp_win->name); +#endif + bw2 = tmp_win->frame_bw * 2; + AddingW = tmp_win->attr.width + bw2; + AddingH = tmp_win->attr.height + tmp_win->title_height + bw2; +#if 0 + width = (SIZE_HINDENT + MyFont_TextWidth (&Scr->SizeFont, + tmp_win->name, namelen)); + height = Scr->SizeFont.height + SIZE_VINDENT * 2; +#endif + XGetGeometry(dpy, w, &JunkRoot, &origDragX, &origDragY, + (unsigned int *)&DragWidth, (unsigned int *)&DragHeight, + &JunkBW, &JunkDepth); + XWarpPointer(dpy, None, w, + 0, 0, 0, 0, DragWidth/2, DragHeight/2); + XQueryPointer (dpy, Scr->Root, &JunkRoot, + &JunkChild, &JunkX, &JunkY, + &AddingX, &AddingY, &JunkMask); +#if 0 + Scr->SizeStringOffset = width + + MyFont_TextWidth(&Scr->SizeFont, ": ", 2); + XResizeWindow (dpy, Scr->SizeWindow, Scr->SizeStringOffset + + Scr->SizeStringWidth, height); + MyFont_DrawImageString (dpy, Scr->SizeWindow, &Scr->SizeFont, Scr->NormalGC, + width, SIZE_VINDENT + Scr->SizeFont.ascent, + ": ", 2); +#endif + lastx = -10000; + lasty = -10000; +#if 0 + MoveOutline(Scr->Root, + origDragX - JunkBW, origDragY - JunkBW, + DragWidth * JunkBW, DragHeight * JunkBW, + tmp_win->frame_bw, + tmp_win->title_height); +#endif + MenuStartResize(tmp_win, origDragX, origDragY, DragWidth, DragHeight); + while (TRUE) + { + XMaskEvent(dpy, + ButtonPressMask | PointerMotionMask, &event); + + if (event.type == MotionNotify) { + /* discard any extra motion events before a release */ + while(XCheckMaskEvent(dpy, + ButtonMotionMask | ButtonPressMask, &event)) + if (event.type == ButtonPress) + break; + } + + if (event.type == ButtonPress) + { + MenuEndResize(tmp_win); + XMoveResizeWindow(dpy, w, AddingX, AddingY, AddingW, AddingH); + break; + } + +/* if (!DispatchEvent ()) continue; */ + + if (event.type != MotionNotify) { + continue; + } + + /* + * XXX - if we are going to do a loop, we ought to consider + * using multiple GXxor lines so that we don't need to + * grab the server. + */ + XQueryPointer(dpy, Scr->Root, &JunkRoot, &JunkChild, + &JunkX, &JunkY, &AddingX, &AddingY, &JunkMask); + + if (lastx != AddingX || lasty != AddingY) + { + MenuDoResize(AddingX, AddingY, tmp_win); + + lastx = AddingX; + lasty = AddingY; + } + + } +} + + + +/** \fn ExecuteFunction + * execute a twm root function. + * + * \param func the function to execute + * \param action the menu action to execute + * \param w the window to execute this function on + * \param tmp_win the twm window structure + * \param event the event that caused the function + * \param context the context in which the button was pressed + * \param pulldown flag indicating execution from pull down menu + * + * \return TRUE if should continue with remaining actions, + * else FALSE to abort + */ + +int +WarpThere(TwmWindow *t) +{ + if (Scr->WarpUnmapped || t->mapped) { + if (!t->mapped) DeIconify (t); + if (!Scr->NoRaiseWarp) XRaiseWindow (dpy, t->frame); + WarpToWindow (t); + return 1; + } + return 0; +} + + +int +ExecuteFunction(int func, char *action, Window w, TwmWindow *tmp_win, + XEvent *eventp, int context, int pulldown) +{ + static Time last_time = 0; + char tmp[200]; + char *ptr; + char buff[MAX_FILE_SIZE]; + int count, fd; + Window rootw; + int origX, origY; + int do_next_action = TRUE; + int moving_icon = FALSE; + Bool fromtitlebar = False; + + RootFunction = 0; + if (Cancel) + return TRUE; /* XXX should this be FALSE? */ + + switch (func) + { + case F_UPICONMGR: + case F_LEFTICONMGR: + case F_RIGHTICONMGR: + case F_DOWNICONMGR: + case F_FORWICONMGR: + case F_BACKICONMGR: + case F_NEXTICONMGR: + case F_PREVICONMGR: + case F_NOP: + case F_TITLE: + case F_DELTASTOP: + case F_RAISELOWER: + case F_WARPTOSCREEN: + case F_WARPTO: + case F_WARPRING: + case F_WARPTOICONMGR: + case F_WARPNEXT: + case F_WARPPREV: + case F_COLORMAP: + break; + default: + XGrabPointer(dpy, Scr->Root, True, + ButtonPressMask | ButtonReleaseMask, + GrabModeAsync, GrabModeAsync, + Scr->Root, Scr->WaitCursor, CurrentTime); + break; + } + + switch (func) + { + case F_NOP: + case F_TITLE: + break; + + case F_DELTASTOP: + if (WindowMoved) do_next_action = FALSE; + break; + + case F_RESTART: + { + XSync (dpy, 0); + Reborder (eventp->xbutton.time); + XSync (dpy, 0); + if (smcConn) + SmcCloseConnection (smcConn, 0, NULL); + execvp(*Argv, Argv); + fprintf (stderr, "%s: unable to restart: %s\n", ProgramName, *Argv); + break; + } + + case F_UPICONMGR: + case F_DOWNICONMGR: + case F_LEFTICONMGR: + case F_RIGHTICONMGR: + case F_FORWICONMGR: + case F_BACKICONMGR: + MoveIconManager(func); + break; + + case F_NEXTICONMGR: + case F_PREVICONMGR: + JumpIconManager(func); + break; + + case F_SHOWLIST: + if (Scr->NoIconManagers) + break; + DeIconify(Scr->iconmgr.twm_win); + XRaiseWindow(dpy, Scr->iconmgr.twm_win->frame); + break; + + case F_HIDELIST: + if (Scr->NoIconManagers) + break; + HideIconManager (); + break; + + case F_SORTICONMGR: + if (DeferExecution(context, func, Scr->SelectCursor)) + return TRUE; + + { + int save_sort; + + save_sort = Scr->SortIconMgr; + Scr->SortIconMgr = TRUE; + + if (context == C_ICONMGR) + SortIconManager((IconMgr *) NULL); + else if (tmp_win->iconmgr) + SortIconManager(tmp_win->iconmgrp); + else + Bell(XkbBI_Info,0,tmp_win->w); + + Scr->SortIconMgr = save_sort; + } + break; + + case F_IDENTIFY: + if (DeferExecution(context, func, Scr->SelectCursor)) + return TRUE; + + Identify(tmp_win); + break; + + case F_VERSION: + Identify ((TwmWindow *) NULL); + break; + + case F_AUTORAISE: + if (DeferExecution(context, func, Scr->SelectCursor)) + return TRUE; + + tmp_win->auto_raise = !tmp_win->auto_raise; + if (tmp_win->auto_raise) ++(Scr->NumAutoRaises); + else --(Scr->NumAutoRaises); + break; + + case F_BEEP: + Bell(XkbBI_Info,0,None); + break; + + case F_POPUP: + tmp_win = (TwmWindow *)action; + if (Scr->WindowFunction.func != 0) + { + ExecuteFunction(Scr->WindowFunction.func, + Scr->WindowFunction.item->action, + w, tmp_win, eventp, C_FRAME, FALSE); + } + else + { + DeIconify(tmp_win); + XRaiseWindow (dpy, tmp_win->frame); + } + break; + + case F_RESIZE: + EventHandler[EnterNotify] = HandleUnknown; + EventHandler[LeaveNotify] = HandleUnknown; + if (DeferExecution(context, func, Scr->MoveCursor)) + return TRUE; + + PopDownMenu(); + + if (pulldown) + XWarpPointer(dpy, None, Scr->Root, + 0, 0, 0, 0, eventp->xbutton.x_root, eventp->xbutton.y_root); + + if (w != tmp_win->icon_w) { /* can't resize icons */ + + if ((Context == C_FRAME || Context == C_WINDOW || Context == C_TITLE) + && fromMenu) + resizeFromCenter(w, tmp_win); + else { + /* + * see if this is being done from the titlebar + */ + fromtitlebar = + belongs_to_twm_window (tmp_win, eventp->xbutton.window); + + /* Save pointer position so we can tell if it was moved or + not during the resize. */ + ResizeOrigX = eventp->xbutton.x_root; + ResizeOrigY = eventp->xbutton.y_root; + + StartResize (eventp, tmp_win, fromtitlebar); + + do { + XMaskEvent(dpy, + ButtonPressMask | ButtonReleaseMask | + EnterWindowMask | LeaveWindowMask | + ButtonMotionMask, &Event); + + if (fromtitlebar && Event.type == ButtonPress) { + fromtitlebar = False; + continue; + } + + if (Event.type == MotionNotify) { + /* discard any extra motion events before a release */ + while + (XCheckMaskEvent + (dpy, ButtonMotionMask | ButtonReleaseMask, &Event)) + if (Event.type == ButtonRelease) + break; + } + + if (!DispatchEvent ()) continue; + + } while (!(Event.type == ButtonRelease || Cancel)); + return TRUE; + } + } + break; + + + case F_ZOOM: + case F_HORIZOOM: + case F_FULLZOOM: + case F_LEFTZOOM: + case F_RIGHTZOOM: + case F_TOPZOOM: + case F_BOTTOMZOOM: + if (DeferExecution(context, func, Scr->SelectCursor)) + return TRUE; + fullzoom(tmp_win, func); + break; + + case F_MOVE: + case F_FORCEMOVE: + if (DeferExecution(context, func, Scr->MoveCursor)) + return TRUE; + + PopDownMenu(); + rootw = eventp->xbutton.root; + MoveFunction = func; + + if (pulldown) + XWarpPointer(dpy, None, Scr->Root, + 0, 0, 0, 0, eventp->xbutton.x_root, eventp->xbutton.y_root); + + EventHandler[EnterNotify] = HandleUnknown; + EventHandler[LeaveNotify] = HandleUnknown; + + if (!Scr->NoGrabServer || !Scr->OpaqueMove) { + XGrabServer(dpy); + } + XGrabPointer(dpy, eventp->xbutton.root, True, + ButtonPressMask | ButtonReleaseMask | + ButtonMotionMask | PointerMotionMask, /* PointerMotionHintMask */ + GrabModeAsync, GrabModeAsync, + Scr->Root, Scr->MoveCursor, CurrentTime); + + if (context == C_ICON && tmp_win->icon_w) + { + w = tmp_win->icon_w; + DragX = eventp->xbutton.x; + DragY = eventp->xbutton.y; + moving_icon = TRUE; + } + + else if (w != tmp_win->icon_w) + { + XTranslateCoordinates(dpy, w, tmp_win->frame, + eventp->xbutton.x, + eventp->xbutton.y, + &DragX, &DragY, &JunkChild); + + w = tmp_win->frame; + } + + DragWindow = None; + + XGetGeometry(dpy, w, &JunkRoot, &origDragX, &origDragY, + (unsigned int *)&DragWidth, (unsigned int *)&DragHeight, &JunkBW, + &JunkDepth); + + origX = eventp->xbutton.x_root; + origY = eventp->xbutton.y_root; + CurrentDragX = origDragX; + CurrentDragY = origDragY; + + /* + * only do the constrained move if timer is set; need to check it + * in case of stupid or wicked fast servers + */ + if (ConstrainedMoveTime && + (eventp->xbutton.time - last_time) < ConstrainedMoveTime) + { + int width, height; + + ConstMove = TRUE; + ConstMoveDir = MOVE_NONE; + ConstMoveX = eventp->xbutton.x_root - DragX - JunkBW; + ConstMoveY = eventp->xbutton.y_root - DragY - JunkBW; + width = DragWidth + 2 * JunkBW; + height = DragHeight + 2 * JunkBW; + ConstMoveXL = ConstMoveX + width/3; + ConstMoveXR = ConstMoveX + 2*(width/3); + ConstMoveYT = ConstMoveY + height/3; + ConstMoveYB = ConstMoveY + 2*(height/3); + + XWarpPointer(dpy, None, w, + 0, 0, 0, 0, DragWidth/2, DragHeight/2); + + XQueryPointer(dpy, w, &JunkRoot, &JunkChild, + &JunkX, &JunkY, &DragX, &DragY, &JunkMask); + } + last_time = eventp->xbutton.time; + + if (!Scr->OpaqueMove) + { + InstallRootColormap(); + if (!Scr->MoveDelta) + { + /* + * Draw initial outline. This was previously done the + * first time though the outer loop by dropping out of + * the XCheckMaskEvent inner loop down to one of the + * MoveOutline's below. + */ + MoveOutline(rootw, + origDragX - JunkBW, origDragY - JunkBW, + DragWidth + 2 * JunkBW, DragHeight + 2 * JunkBW, + tmp_win->frame_bw, + moving_icon ? 0 : tmp_win->title_height); + /* + * This next line causes HandleReleaseNotify to call + * XRaiseWindow(). This is solely to preserve the + * previous behaviour that raises a window being moved + * on button release even if you never actually moved + * any distance (unless you move less than MoveDelta or + * NoRaiseMove is set or OpaqueMove is set). + */ + DragWindow = w; + } + } + + /* + * see if this is being done from the titlebar + */ + fromtitlebar = belongs_to_twm_window (tmp_win, eventp->xbutton.window); + + if (menuFromFrameOrWindowOrTitlebar) { + /* warp the pointer to the middle of the window */ + XWarpPointer(dpy, None, Scr->Root, 0, 0, 0, 0, + origDragX + DragWidth / 2, + origDragY + DragHeight / 2); + XFlush(dpy); + } + + while (TRUE) + { + long releaseEvent = menuFromFrameOrWindowOrTitlebar ? + ButtonPress : ButtonRelease; + long movementMask = menuFromFrameOrWindowOrTitlebar ? + PointerMotionMask : ButtonMotionMask; + + /* block until there is an interesting event */ + XMaskEvent(dpy, ButtonPressMask | ButtonReleaseMask | + EnterWindowMask | LeaveWindowMask | + ExposureMask | movementMask | + VisibilityChangeMask, &Event); + + /* throw away enter and leave events until release */ + if (Event.xany.type == EnterNotify || + Event.xany.type == LeaveNotify) continue; + + if (Event.type == MotionNotify) { + /* discard any extra motion events before a logical release */ + while(XCheckMaskEvent(dpy, + movementMask | releaseEvent, &Event)) + if (Event.type == releaseEvent) + break; + } + + /* test to see if we have a second button press to abort move */ + if (!menuFromFrameOrWindowOrTitlebar && !MovedFromKeyPress) { + if (Event.type == ButtonPress && DragWindow != None) { + if (Scr->OpaqueMove) + XMoveWindow (dpy, DragWindow, origDragX, origDragY); + else + MoveOutline(Scr->Root, 0, 0, 0, 0, 0, 0); + DragWindow = None; + } + } + if (fromtitlebar && Event.type == ButtonPress) { + fromtitlebar = False; + CurrentDragX = origX = Event.xbutton.x_root; + CurrentDragY = origY = Event.xbutton.y_root; + XTranslateCoordinates (dpy, rootw, tmp_win->frame, + origX, origY, + &DragX, &DragY, &JunkChild); + continue; + } + + if (!DispatchEvent2 ()) continue; + + if (Cancel) + { + WindowMoved = FALSE; + if (!Scr->OpaqueMove) + UninstallRootColormap(); + return TRUE; /* XXX should this be FALSE? */ + } + if (Event.type == releaseEvent) + { + MoveOutline(rootw, 0, 0, 0, 0, 0, 0); + if (moving_icon && + ((CurrentDragX != origDragX || + CurrentDragY != origDragY))) + tmp_win->icon_moved = TRUE; + if (!Scr->OpaqueMove && menuFromFrameOrWindowOrTitlebar) + XMoveWindow(dpy, DragWindow, + Event.xbutton.x_root - DragWidth / 2, + Event.xbutton.y_root - DragHeight / 2); + break; + } + + /* something left to do only if the pointer moved */ + if (Event.type != MotionNotify) + continue; + + XQueryPointer(dpy, rootw, &(eventp->xmotion.root), &JunkChild, + &(eventp->xmotion.x_root), &(eventp->xmotion.y_root), + &JunkX, &JunkY, &JunkMask); + + if (DragWindow == None && + abs(eventp->xmotion.x_root - origX) < Scr->MoveDelta && + abs(eventp->xmotion.y_root - origY) < Scr->MoveDelta) + continue; + + WindowMoved = TRUE; + DragWindow = w; + + if (!Scr->NoRaiseMove && Scr->OpaqueMove) /* can't restore... */ + XRaiseWindow(dpy, DragWindow); + + if (ConstMove) + { + switch (ConstMoveDir) + { + case MOVE_NONE: + if (eventp->xmotion.x_root < ConstMoveXL || + eventp->xmotion.x_root > ConstMoveXR) + ConstMoveDir = MOVE_HORIZ; + + if (eventp->xmotion.y_root < ConstMoveYT || + eventp->xmotion.y_root > ConstMoveYB) + ConstMoveDir = MOVE_VERT; + + XQueryPointer(dpy, DragWindow, &JunkRoot, &JunkChild, + &JunkX, &JunkY, &DragX, &DragY, &JunkMask); + break; + + case MOVE_VERT: + ConstMoveY = eventp->xmotion.y_root - DragY - JunkBW; + break; + + case MOVE_HORIZ: + ConstMoveX= eventp->xmotion.x_root - DragX - JunkBW; + break; + } + + if (ConstMoveDir != MOVE_NONE) + { + int xl, yt, xr, yb, w, h; + + xl = ConstMoveX; + yt = ConstMoveY; + w = DragWidth + 2 * JunkBW; + h = DragHeight + 2 * JunkBW; + + if (Scr->DontMoveOff && MoveFunction != F_FORCEMOVE) + { + xr = xl + w; + yb = yt + h; + + if (xl < 0) + xl = 0; + if (xr > Scr->MyDisplayWidth) + xl = Scr->MyDisplayWidth - w; + + if (yt < 0) + yt = 0; + if (yb > Scr->MyDisplayHeight) + yt = Scr->MyDisplayHeight - h; + } + CurrentDragX = xl; + CurrentDragY = yt; + if (Scr->OpaqueMove) + XMoveWindow(dpy, DragWindow, xl, yt); + else + MoveOutline(eventp->xmotion.root, xl, yt, w, h, + tmp_win->frame_bw, + moving_icon ? 0 : tmp_win->title_height); + } + } + else if (DragWindow != None) + { + int xl, yt, xr, yb, w, h; + if (!menuFromFrameOrWindowOrTitlebar) { + xl = eventp->xmotion.x_root - DragX - JunkBW; + yt = eventp->xmotion.y_root - DragY - JunkBW; + } + else { + xl = eventp->xmotion.x_root - (DragWidth / 2); + yt = eventp->xmotion.y_root - (DragHeight / 2); + } + w = DragWidth + 2 * JunkBW; + h = DragHeight + 2 * JunkBW; + + if (Scr->DontMoveOff && MoveFunction != F_FORCEMOVE) + { + xr = xl + w; + yb = yt + h; + + if (xl < 0) + xl = 0; + if (xr > Scr->MyDisplayWidth) + xl = Scr->MyDisplayWidth - w; + + if (yt < 0) + yt = 0; + if (yb > Scr->MyDisplayHeight) + yt = Scr->MyDisplayHeight - h; + } + + CurrentDragX = xl; + CurrentDragY = yt; + if (Scr->OpaqueMove) + XMoveWindow(dpy, DragWindow, xl, yt); + else + MoveOutline(eventp->xmotion.root, xl, yt, w, h, + tmp_win->frame_bw, + moving_icon ? 0 : tmp_win->title_height); + } + + } + MovedFromKeyPress = False; + + + if (!Scr->OpaqueMove && DragWindow == None) + UninstallRootColormap(); + + break; + + case F_FUNCTION: + { + MenuRoot *mroot; + MenuItem *mitem; + + if ((mroot = FindMenuRoot(action)) == NULL) + { + fprintf (stderr, "%s: couldn't find function \"%s\"\n", + ProgramName, action); + return TRUE; + } + + if (NeedToDefer(mroot) && DeferExecution(context, func, Scr->SelectCursor)) + return TRUE; + else + { + for (mitem = mroot->first; mitem != NULL; mitem = mitem->next) + { + if (!ExecuteFunction (mitem->func, mitem->action, w, + tmp_win, eventp, context, pulldown)) + break; + } + } + } + break; + + case F_DEICONIFY: + case F_ICONIFY: + if (DeferExecution(context, func, Scr->SelectCursor)) + return TRUE; + + if (tmp_win->icon) + { + DeIconify(tmp_win); + } + else if (func == F_ICONIFY) + { + Iconify (tmp_win, eventp->xbutton.x_root - 5, + eventp->xbutton.y_root - 5); + } + break; + + case F_RAISELOWER: + if (DeferExecution(context, func, Scr->SelectCursor)) + return TRUE; + + if (!WindowMoved) { + XWindowChanges xwc; + + xwc.stack_mode = Opposite; + if (w != tmp_win->icon_w) + w = tmp_win->frame; + XConfigureWindow (dpy, w, CWStackMode, &xwc); + } + break; + + case F_RAISE: + if (DeferExecution(context, func, Scr->SelectCursor)) + return TRUE; + + /* check to make sure raise is not from the WindowFunction */ + if (w == tmp_win->icon_w && Context != C_ROOT) + XRaiseWindow(dpy, tmp_win->icon_w); + else + XRaiseWindow(dpy, tmp_win->frame); + + break; + + case F_LOWER: + if (DeferExecution(context, func, Scr->SelectCursor)) + return TRUE; + + if (w == tmp_win->icon_w) + XLowerWindow(dpy, tmp_win->icon_w); + else + XLowerWindow(dpy, tmp_win->frame); + + break; + + case F_FOCUS: + if (DeferExecution(context, func, Scr->SelectCursor)) + return TRUE; + + if (tmp_win->icon == FALSE) + { + if (!Scr->FocusRoot && Scr->Focus == tmp_win) + { + FocusOnRoot(); + } + else + { + if (Scr->Focus != NULL) { + SetBorder (Scr->Focus, False); + if (Scr->Focus->hilite_w) + XUnmapWindow (dpy, Scr->Focus->hilite_w); + } + + InstallWindowColormaps (0, tmp_win); + if (tmp_win->hilite_w) XMapWindow (dpy, tmp_win->hilite_w); + SetBorder (tmp_win, True); + if (!tmp_win->wmhints || tmp_win->wmhints->input) + SetFocus (tmp_win, eventp->xbutton.time); + Scr->FocusRoot = FALSE; + Scr->Focus = tmp_win; + } + } + break; + + case F_DESTROY: + if (DeferExecution(context, func, Scr->DestroyCursor)) + return TRUE; + + if (tmp_win->iconmgr) + Bell(XkbBI_MinorError,0,tmp_win->w); + else + XKillClient(dpy, tmp_win->w); + break; + + case F_DELETE: + if (DeferExecution(context, func, Scr->DestroyCursor)) + return TRUE; + + if (tmp_win->iconmgr) /* don't send ourself a message */ + HideIconManager (); + else if (tmp_win->protocols & DoesWmDeleteWindow) + SendDeleteWindowMessage (tmp_win, LastTimestamp()); + else + Bell(XkbBI_MinorError,0,tmp_win->w); + break; + + case F_SAVEYOURSELF: + if (DeferExecution (context, func, Scr->SelectCursor)) + return TRUE; + + if (tmp_win->protocols & DoesWmSaveYourself) + SendSaveYourselfMessage (tmp_win, LastTimestamp()); + else + Bell(XkbBI_MinorError,0,tmp_win->w); + break; + + case F_CIRCLEUP: + XCirculateSubwindowsUp(dpy, Scr->Root); + break; + + case F_CIRCLEDOWN: + XCirculateSubwindowsDown(dpy, Scr->Root); + break; + + case F_EXEC: + PopDownMenu(); + if (!Scr->NoGrabServer) { + XUngrabServer (dpy); + XSync (dpy, 0); + } + Execute(action); + break; + + case F_UNFOCUS: + FocusOnRoot(); + break; + + case F_CUT: + strcpy(tmp, action); + strcat(tmp, "\n"); + XStoreBytes(dpy, tmp, strlen(tmp)); + break; + + case F_CUTFILE: + ptr = XFetchBytes(dpy, &count); + if (ptr) { + if (sscanf (ptr, "%s", tmp) == 1) { + XFree (ptr); + ptr = ExpandFilename(tmp); + if (ptr) { + fd = open (ptr, O_RDONLY); + if (fd >= 0) { + count = read (fd, buff, MAX_FILE_SIZE - 1); + if (count > 0) XStoreBytes (dpy, buff, count); + close(fd); + } else { + fprintf (stderr, + "%s: unable to open cut file \"%s\"\n", + ProgramName, tmp); + } + if (ptr != tmp) free (ptr); + } + } else { + XFree(ptr); + } + } else { + fprintf(stderr, "%s: cut buffer is empty\n", ProgramName); + } + break; + + case F_WARPTOSCREEN: + { + if (strcmp (action, WARPSCREEN_NEXT) == 0) { + WarpToScreen (Scr->screen + 1, 1); + } else if (strcmp (action, WARPSCREEN_PREV) == 0) { + WarpToScreen (Scr->screen - 1, -1); + } else if (strcmp (action, WARPSCREEN_BACK) == 0) { + WarpToScreen (PreviousScreen, 0); + } else { + WarpToScreen (atoi (action), 0); + } + } + break; + + case F_COLORMAP: + { + if (strcmp (action, COLORMAP_NEXT) == 0) { + BumpWindowColormap (tmp_win, 1); + } else if (strcmp (action, COLORMAP_PREV) == 0) { + BumpWindowColormap (tmp_win, -1); + } else { + BumpWindowColormap (tmp_win, 0); + } + } + break; + + case F_WARPPREV: + case F_WARPNEXT: + { + register TwmWindow *t; + static TwmWindow *savedwarp = NULL; + TwmWindow *of, *l, *n; + int c=0; + +#define wseq(w) (func == F_WARPNEXT ? (w)->next : (w)->prev) +#define nwin(w) ((w) && (n=wseq(w)) != NULL && n != &Scr->TwmRoot ? n : l) +#define bwin(w) (!(w)||(w)->iconmgr||(w)==of||!(Scr->WarpUnmapped||(w)->mapped)) + + of=(Scr->Focus ? Scr->Focus : &Scr->TwmRoot); + + for(t=Scr->TwmRoot.next; t; t=t->next) if(!bwin(t)) break; + if(!t) break; /* no windows we can use */ + + if(func == F_WARPPREV) for(l=of; l->next; l=l->next) ; + else l = Scr->TwmRoot.next; + + for(t=of; bwin(t) && c < 2; t=nwin(t)) if(t == of) c++; + + if(bwin(t) || c >= 2) Bell(XkbBI_MinorError,0,None); + else { + if(of && of == savedwarp) { + Iconify(of, 0, 0); + savedwarp = NULL; + } + if(!t->mapped) savedwarp = t; else savedwarp = NULL; + WarpThere(t); + } + break; + } + + case F_WARPTO: + { + register TwmWindow *t; + int len; + + len = strlen(action); + + for (t = Scr->TwmRoot.next; t != NULL; t = t->next) { + if (!strncmp(action, t->name, len)) + if (WarpThere(t)) break; + } + if (!t) { + for (t = Scr->TwmRoot.next; t != NULL; t = t->next) { + if (!strncmp(action, t->class.res_name, len)) + if (WarpThere(t)) break; + } + if (!t) { + for (t = Scr->TwmRoot.next; t != NULL; t = t->next) { + if (!strncmp(action, t->class.res_class, len)) + if (WarpThere(t)) break; + } + } + } + + if (!t) + Bell(XkbBI_MinorError,0,None); + } + break; + + case F_WARPTOICONMGR: + { + TwmWindow *t; + int len; + Window raisewin = None, iconwin = None; + + len = strlen(action); + if (len == 0) { + if (tmp_win && tmp_win->list) { + raisewin = tmp_win->list->iconmgr->twm_win->frame; + iconwin = tmp_win->list->icon; + } else if (Scr->iconmgr.active) { + raisewin = Scr->iconmgr.twm_win->frame; + iconwin = Scr->iconmgr.active->w; + } + } else { + for (t = Scr->TwmRoot.next; t != NULL; t = t->next) { + if (strncmp (action, t->icon_name, len) == 0) { + if (t->list && t->list->iconmgr->twm_win->mapped) { + raisewin = t->list->iconmgr->twm_win->frame; + iconwin = t->list->icon; + break; + } + } + } + } + + if (raisewin) { + XRaiseWindow (dpy, raisewin); + XWarpPointer (dpy, None, iconwin, 0,0,0,0, 5, 5); + } else { + Bell(XkbBI_MinorError,0,None); + } + } + break; + + case F_WARPRING: + switch (action[0]) { + case 'n': + WarpAlongRing (&eventp->xbutton, True); + break; + case 'p': + WarpAlongRing (&eventp->xbutton, False); + break; + default: + Bell(XkbBI_MinorError,0,None); + break; + } + break; + + case F_FILE: + ptr = ExpandFilename(action); + fd = open(ptr, O_RDONLY); + if (fd >= 0) + { + count = read(fd, buff, MAX_FILE_SIZE - 1); + if (count > 0) + XStoreBytes(dpy, buff, count); + + close(fd); + } + else + { + fprintf (stderr, "%s: unable to open file \"%s\"\n", + ProgramName, ptr); + } + if (ptr != action) free(ptr); + break; + + case F_REFRESH: + { + XSetWindowAttributes attributes; + unsigned long valuemask; + + valuemask = (CWBackPixel | CWBackingStore | CWSaveUnder); + attributes.background_pixel = Scr->Black; + attributes.backing_store = NotUseful; + attributes.save_under = False; + w = XCreateWindow (dpy, Scr->Root, 0, 0, + (unsigned int) Scr->MyDisplayWidth, + (unsigned int) Scr->MyDisplayHeight, + (unsigned int) 0, + CopyFromParent, (unsigned int) CopyFromParent, + (Visual *) CopyFromParent, valuemask, + &attributes); + XMapWindow (dpy, w); + XDestroyWindow (dpy, w); + XFlush (dpy); + } + break; + + case F_WINREFRESH: + if (DeferExecution(context, func, Scr->SelectCursor)) + return TRUE; + + if (context == C_ICON && tmp_win->icon_w) + w = XCreateSimpleWindow(dpy, tmp_win->icon_w, + 0, 0, 9999, 9999, 0, Scr->Black, Scr->Black); + else + w = XCreateSimpleWindow(dpy, tmp_win->frame, + 0, 0, 9999, 9999, 0, Scr->Black, Scr->Black); + + XMapWindow(dpy, w); + XDestroyWindow(dpy, w); + XFlush(dpy); + break; + + case F_QUIT: + Done(NULL, NULL); + break; + + case F_PRIORITY: + if (HasSync) + { + if (DeferExecution (context, func, Scr->SelectCursor)) + return TRUE; + (void)XSyncSetPriority(dpy, tmp_win->w, atoi(action)); + } + break; + case F_STARTWM: + execlp("/bin/sh", "sh", "-c", action, (void *)NULL); + fprintf (stderr, "%s: unable to start: %s\n", ProgramName, *Argv); + break; + + } + + if (ButtonPressed == -1) XUngrabPointer(dpy, CurrentTime); + return do_next_action; +} + + + +/** + * defer the execution of a function to the next button press if the context + * is C_ROOT + * + * \param context the context in which the mouse button was pressed + * \param func the function to defer + * \param cursor cursor the cursor to display while waiting + */ +int +DeferExecution(int context, int func, Cursor cursor) +{ + if (context == C_ROOT) + { + LastCursor = cursor; + XGrabPointer(dpy, Scr->Root, True, + ButtonPressMask | ButtonReleaseMask, + GrabModeAsync, GrabModeAsync, + Scr->Root, cursor, CurrentTime); + + RootFunction = func; + + return (TRUE); + } + + return (FALSE); +} + + + +/** + *regrab the pointer with the LastCursor; + */ +void +ReGrab() +{ + XGrabPointer(dpy, Scr->Root, True, + ButtonPressMask | ButtonReleaseMask, + GrabModeAsync, GrabModeAsync, + Scr->Root, LastCursor, CurrentTime); +} + + + +/** + * checks each function in the list to see if it is one that needs + * to be deferred. + * + * \param root the menu root to check + */ +Bool +NeedToDefer(MenuRoot *root) +{ + MenuItem *mitem; + + for (mitem = root->first; mitem != NULL; mitem = mitem->next) + { + switch (mitem->func) + { + case F_IDENTIFY: + case F_RESIZE: + case F_MOVE: + case F_FORCEMOVE: + case F_DEICONIFY: + case F_ICONIFY: + case F_RAISELOWER: + case F_RAISE: + case F_LOWER: + case F_FOCUS: + case F_DESTROY: + case F_WINREFRESH: + case F_ZOOM: + case F_FULLZOOM: + case F_HORIZOOM: + case F_RIGHTZOOM: + case F_LEFTZOOM: + case F_TOPZOOM: + case F_BOTTOMZOOM: + case F_AUTORAISE: + return TRUE; + } + } + return FALSE; +} + + + +#if defined(sun) && defined(SVR4) +#include + +/** + * execute the string by /bin/sh + * \param s the string containing the command + */ +static int +System (char *s) +{ + int pid, status; + if ((pid = fork ()) == 0) { + (void) setpgrp(); + execl ("/bin/sh", "sh", "-c", s, 0); + } else + waitpid (pid, &status, 0); + return status; +} +#define system(s) System(s) + +#endif + +void +Execute(char *s) +{ + /* FIXME: is all this stuff needed? There could be security problems here. */ + static char buf[256]; + char *ds = DisplayString (dpy); + char *colon, *dot1; + char oldDisplay[256]; + char *doisplay; + int restorevar = 0; + + oldDisplay[0] = '\0'; + doisplay=getenv("DISPLAY"); + if (doisplay) + strcpy (oldDisplay, doisplay); + + /* + * Build a display string using the current screen number, so that + * X programs which get fired up from a menu come up on the screen + * that they were invoked from, unless specifically overridden on + * their command line. + */ + colon = strrchr (ds, ':'); + if (colon) { /* if host[:]:dpy */ + strcpy (buf, "DISPLAY="); + strcat (buf, ds); + colon = buf + 8 + (colon - ds); /* use version in buf */ + dot1 = strchr (colon, '.'); /* first period after colon */ + if (!dot1) dot1 = colon + strlen (colon); /* if not there, append */ + (void) sprintf (dot1, ".%d", Scr->screen); + putenv (buf); + restorevar = 1; + } + + (void) system (s); + + if (restorevar) { /* why bother? */ + (void) sprintf (buf, "DISPLAY=%s", oldDisplay); + putenv (buf); + } +} + + + +/** + * put input focus on the root window. + */ +void +FocusOnRoot() +{ + SetFocus ((TwmWindow *) NULL, LastTimestamp()); + if (Scr->Focus != NULL) + { + SetBorder (Scr->Focus, False); + if (Scr->Focus->hilite_w) XUnmapWindow (dpy, Scr->Focus->hilite_w); + } + InstallWindowColormaps(0, &Scr->TwmRoot); + Scr->Focus = NULL; + Scr->FocusRoot = TRUE; +} + +void +DeIconify(TwmWindow *tmp_win) +{ + TwmWindow *t; + + /* de-iconify the main window */ + if (tmp_win->icon) + { + if (tmp_win->icon_on) + Zoom(tmp_win->icon_w, tmp_win->frame); + else if (tmp_win->group != (Window) 0) + { + for (t = Scr->TwmRoot.next; t != NULL; t = t->next) + { + if (tmp_win->group == t->w && t->icon_on) + { + Zoom(t->icon_w, tmp_win->frame); + break; + } + } + } + } + + XMapWindow(dpy, tmp_win->w); + tmp_win->mapped = TRUE; + if (Scr->NoRaiseDeicon) + XMapWindow(dpy, tmp_win->frame); + else + XMapRaised(dpy, tmp_win->frame); + SetMapStateProp(tmp_win, NormalState); + + if (tmp_win->icon_w) { + XUnmapWindow(dpy, tmp_win->icon_w); + IconDown (tmp_win); + } + if (tmp_win->list) + XUnmapWindow(dpy, tmp_win->list->icon); + if ((Scr->WarpCursor || + LookInList(Scr->WarpCursorL, tmp_win->full_name, &tmp_win->class)) && + tmp_win->icon) + WarpToWindow (tmp_win); + tmp_win->icon = FALSE; + tmp_win->icon_on = FALSE; + + + /* now de-iconify transients */ + for (t = Scr->TwmRoot.next; t != NULL; t = t->next) + { + if (t->transient && t->transientfor == tmp_win->w) + { + if (t->icon_on) + Zoom(t->icon_w, t->frame); + else + Zoom(tmp_win->icon_w, t->frame); + + XMapWindow(dpy, t->w); + t->mapped = TRUE; + if (Scr->NoRaiseDeicon) + XMapWindow(dpy, t->frame); + else + XMapRaised(dpy, t->frame); + SetMapStateProp(t, NormalState); + + if (t->icon_w) { + XUnmapWindow(dpy, t->icon_w); + IconDown (t); + } + if (t->list) XUnmapWindow(dpy, t->list->icon); + t->icon = FALSE; + t->icon_on = FALSE; + } + } + + XSync (dpy, 0); +} + + + +void +Iconify(TwmWindow *tmp_win, int def_x, int def_y) +{ + TwmWindow *t; + int iconify; + XWindowAttributes winattrs; + unsigned long eventMask; + + iconify = ((!tmp_win->iconify_by_unmapping) || tmp_win->transient); + if (iconify) + { + if (tmp_win->icon_w == (Window) 0) + CreateIconWindow(tmp_win, def_x, def_y); + else + IconUp(tmp_win); + XMapRaised(dpy, tmp_win->icon_w); + } + if (tmp_win->list) + XMapWindow(dpy, tmp_win->list->icon); + + XGetWindowAttributes(dpy, tmp_win->w, &winattrs); + eventMask = winattrs.your_event_mask; + + /* iconify transients first */ + for (t = Scr->TwmRoot.next; t != NULL; t = t->next) + { + if (t->transient && t->transientfor == tmp_win->w) + { + if (iconify) + { + if (t->icon_on) + Zoom(t->icon_w, tmp_win->icon_w); + else + Zoom(t->frame, tmp_win->icon_w); + } + + /* + * Prevent the receipt of an UnmapNotify, since that would + * cause a transition to the Withdrawn state. + */ + t->mapped = FALSE; + XSelectInput(dpy, t->w, eventMask & ~StructureNotifyMask); + XUnmapWindow(dpy, t->w); + XSelectInput(dpy, t->w, eventMask); + XUnmapWindow(dpy, t->frame); + if (t->icon_w) + XUnmapWindow(dpy, t->icon_w); + SetMapStateProp(t, IconicState); + SetBorder (t, False); + if (t == Scr->Focus) + { + SetFocus ((TwmWindow *) NULL, LastTimestamp()); + Scr->Focus = NULL; + Scr->FocusRoot = TRUE; + } + if (t->list) XMapWindow(dpy, t->list->icon); + t->icon = TRUE; + t->icon_on = FALSE; + } + } + + if (iconify) + Zoom(tmp_win->frame, tmp_win->icon_w); + + /* + * Prevent the receipt of an UnmapNotify, since that would + * cause a transition to the Withdrawn state. + */ + tmp_win->mapped = FALSE; + XSelectInput(dpy, tmp_win->w, eventMask & ~StructureNotifyMask); + XUnmapWindow(dpy, tmp_win->w); + XSelectInput(dpy, tmp_win->w, eventMask); + XUnmapWindow(dpy, tmp_win->frame); + SetMapStateProp(tmp_win, IconicState); + + SetBorder (tmp_win, False); + if (tmp_win == Scr->Focus) + { + SetFocus ((TwmWindow *) NULL, LastTimestamp()); + Scr->Focus = NULL; + Scr->FocusRoot = TRUE; + } + tmp_win->icon = TRUE; + if (iconify) + tmp_win->icon_on = TRUE; + else + tmp_win->icon_on = FALSE; + XSync (dpy, 0); +} + + + +static void +Identify (TwmWindow *t) +{ + int i, n, twidth, width, height; + int x, y; + unsigned int wwidth, wheight, bw, depth; + Window junk; + int px, py, dummy; + unsigned udummy; + + n = 0; + (void) sprintf(Info[n++], "Twm version: %s", Version); + Info[n++][0] = '\0'; + + if (t) { + XGetGeometry (dpy, t->w, &JunkRoot, &JunkX, &JunkY, + &wwidth, &wheight, &bw, &depth); + (void) XTranslateCoordinates (dpy, t->w, Scr->Root, 0, 0, + &x, &y, &junk); + (void) sprintf(Info[n++], "Name = \"%s\"", t->full_name); + (void) sprintf(Info[n++], "Class.res_name = \"%s\"", t->class.res_name); + (void) sprintf(Info[n++], "Class.res_class = \"%s\"", t->class.res_class); + Info[n++][0] = '\0'; + (void) sprintf(Info[n++], "Geometry/root = %dx%d+%d+%d", wwidth, wheight, + x, y); + (void) sprintf(Info[n++], "Border width = %d", bw); + (void) sprintf(Info[n++], "Depth = %d", depth); + if (HasSync) + { + int priority; + (void)XSyncGetPriority(dpy, t->w, &priority); + (void) sprintf(Info[n++], "Priority = %d", priority); + } + } + + Info[n++][0] = '\0'; + (void) sprintf(Info[n++], "Click to dismiss...."); + + /* figure out the width and height of the info window */ + height = n * (Scr->DefaultFont.height+2); + width = 1; + for (i = 0; i < n; i++) + { + twidth = MyFont_TextWidth(&Scr->DefaultFont, Info[i], + strlen(Info[i])); + if (twidth > width) + width = twidth; + } + if (InfoLines) XUnmapWindow(dpy, Scr->InfoWindow); + + width += 10; /* some padding */ + if (XQueryPointer (dpy, Scr->Root, &JunkRoot, &JunkChild, &px, &py, + &dummy, &dummy, &udummy)) { + px -= (width / 2); + py -= (height / 3); + if (px + width + BW2 >= Scr->MyDisplayWidth) + px = Scr->MyDisplayWidth - width - BW2; + if (py + height + BW2 >= Scr->MyDisplayHeight) + py = Scr->MyDisplayHeight - height - BW2; + if (px < 0) px = 0; + if (py < 0) py = 0; + } else { + px = py = 0; + } + XMoveResizeWindow(dpy, Scr->InfoWindow, px, py, width, height); + XMapRaised(dpy, Scr->InfoWindow); + InfoLines = n; +} + + +void +SetMapStateProp(TwmWindow *tmp_win, int state) +{ + unsigned long data[2]; /* "suggested" by ICCCM version 1 */ + + data[0] = (unsigned long) state; + data[1] = (unsigned long) (tmp_win->iconify_by_unmapping ? None : + tmp_win->icon_w); + + XChangeProperty (dpy, tmp_win->w, _XA_WM_STATE, _XA_WM_STATE, 32, + PropModeReplace, (unsigned char *) data, 2); +} + + + +Bool +GetWMState (Window w, int *statep, Window *iwp) +{ + Atom actual_type; + int actual_format; + unsigned long nitems, bytesafter; + unsigned long *datap = NULL; + Bool retval = False; + + if (XGetWindowProperty (dpy, w, _XA_WM_STATE, 0L, 2L, False, _XA_WM_STATE, + &actual_type, &actual_format, &nitems, &bytesafter, + (unsigned char **) &datap) != Success || !datap) + return False; + + if (nitems <= 2) { /* "suggested" by ICCCM version 1 */ + *statep = (int) datap[0]; + *iwp = (Window) datap[1]; + retval = True; + } + + XFree ((char *) datap); + return retval; +} + + +void +WarpToScreen (int n, int inc) +{ + Window dumwin; + int x, y, dumint; + unsigned int dummask; + ScreenInfo *newscr = NULL; + + while (!newscr) { + /* wrap around */ + if (n < 0) + n = NumScreens - 1; + else if (n >= NumScreens) + n = 0; + + newscr = ScreenList[n]; + if (!newscr) { /* make sure screen is managed */ + if (inc) { /* walk around the list */ + n += inc; + continue; + } + fprintf (stderr, "%s: unable to warp to unmanaged screen %d\n", + ProgramName, n); + Bell(XkbBI_MinorError,0,None); + return; + } + } + + if (Scr->screen == n) return; /* already on that screen */ + + PreviousScreen = Scr->screen; + XQueryPointer (dpy, Scr->Root, &dumwin, &dumwin, &x, &y, + &dumint, &dumint, &dummask); + + XWarpPointer (dpy, None, newscr->Root, 0, 0, 0, 0, x, y); + return; +} + + + + +/** + * rotate our internal copy of WM_COLORMAP_WINDOWS + */ +void +BumpWindowColormap (TwmWindow *tmp, int inc) +{ + int i, j, previously_installed; + ColormapWindow **cwins; + + if (!tmp) return; + + if (inc && tmp->cmaps.number_cwins > 0) { + cwins = (ColormapWindow **) malloc(sizeof(ColormapWindow *)* + tmp->cmaps.number_cwins); + if (cwins) { + if ((previously_installed = + /* SUPPRESS 560 */(Scr->cmapInfo.cmaps == &tmp->cmaps && + tmp->cmaps.number_cwins))) { + for (i = tmp->cmaps.number_cwins; i-- > 0; ) + tmp->cmaps.cwins[i]->colormap->state = 0; + } + + for (i = 0; i < tmp->cmaps.number_cwins; i++) { + j = i - inc; + if (j >= tmp->cmaps.number_cwins) + j -= tmp->cmaps.number_cwins; + else if (j < 0) + j += tmp->cmaps.number_cwins; + cwins[j] = tmp->cmaps.cwins[i]; + } + + free((char *) tmp->cmaps.cwins); + + tmp->cmaps.cwins = cwins; + + if (tmp->cmaps.number_cwins > 1) + bzero (tmp->cmaps.scoreboard, + ColormapsScoreboardLength(&tmp->cmaps)); + + if (previously_installed) + InstallWindowColormaps(PropertyNotify, (TwmWindow *) NULL); + } + } else + FetchWmColormapWindows (tmp); +} + + +void +HideIconManager () +{ + SetMapStateProp (Scr->iconmgr.twm_win, WithdrawnState); + XUnmapWindow(dpy, Scr->iconmgr.twm_win->frame); + if (Scr->iconmgr.twm_win->icon_w) + XUnmapWindow (dpy, Scr->iconmgr.twm_win->icon_w); + Scr->iconmgr.twm_win->mapped = FALSE; + Scr->iconmgr.twm_win->icon = TRUE; +} + + + +void +SetBorder (TwmWindow *tmp, Bool onoroff) +{ + if (tmp->highlight) { + if (onoroff) { + XSetWindowBorder (dpy, tmp->frame, tmp->border); + if (tmp->title_w) + XSetWindowBorder (dpy, tmp->title_w, tmp->border); + } else { + XSetWindowBorderPixmap (dpy, tmp->frame, tmp->gray); + if (tmp->title_w) + XSetWindowBorderPixmap (dpy, tmp->title_w, tmp->gray); + } + } +} + + +void +DestroyMenu (MenuRoot *menu) +{ + MenuItem *item; + + if (menu->w) { + XDeleteContext (dpy, menu->w, MenuContext); + XDeleteContext (dpy, menu->w, ScreenContext); + if (Scr->Shadow) XDestroyWindow (dpy, menu->shadow); + XDestroyWindow(dpy, menu->w); + } + + for (item = menu->first; item; ) { + MenuItem *tmp = item; + item = item->next; + free ((char *) tmp); + } +} + + + +/* + * warping routines + */ + +void +WarpAlongRing (XButtonEvent *ev, Bool forward) +{ + TwmWindow *r, *head; + + if (Scr->RingLeader) + head = Scr->RingLeader; + else if (!(head = Scr->Ring)) + return; + + if (forward) { + for (r = head->ring.next; r != head; r = r->ring.next) { + if (!r || r->mapped) break; + } + } else { + for (r = head->ring.prev; r != head; r = r->ring.prev) { + if (!r || r->mapped) break; + } + } + + if (r && r != head) { + TwmWindow *p = Scr->RingLeader, *t; + + Scr->RingLeader = r; + WarpToWindow (r); + + if (p && p->mapped && + XFindContext (dpy, ev->window, TwmContext, (caddr_t *)&t) == XCSUCCESS && + p == t) { + p->ring.cursor_valid = True; + p->ring.curs_x = ev->x_root - t->frame_x; + p->ring.curs_y = ev->y_root - t->frame_y; + if (p->ring.curs_x < -p->frame_bw || + p->ring.curs_x >= p->frame_width + p->frame_bw || + p->ring.curs_y < -p->frame_bw || + p->ring.curs_y >= p->frame_height + p->frame_bw) { + /* somehow out of window */ + p->ring.curs_x = p->frame_width / 2; + p->ring.curs_y = p->frame_height / 2; + } + } + } +} + + + +void +WarpToWindow (TwmWindow *t) +{ + int x, y; + + if (t->auto_raise || !Scr->NoRaiseWarp) AutoRaiseWindow (t); + if (t->ring.cursor_valid) { + x = t->ring.curs_x; + y = t->ring.curs_y; + } else { + x = t->frame_width / 2; + y = t->frame_height / 2; + } + XWarpPointer (dpy, None, t->frame, 0, 0, 0, 0, x, y); +} + + + + +/* + * ICCCM Client Messages - Section 4.2.8 of the ICCCM dictates that all + * client messages will have the following form: + * + * event type ClientMessage + * message type _XA_WM_PROTOCOLS + * window tmp->w + * format 32 + * data[0] message atom + * data[1] time stamp + */ +static void +send_clientmessage (Window w, Atom a, Time timestamp) +{ + XClientMessageEvent ev; + + ev.type = ClientMessage; + ev.window = w; + ev.message_type = _XA_WM_PROTOCOLS; + ev.format = 32; + ev.data.l[0] = a; + ev.data.l[1] = timestamp; + XSendEvent (dpy, w, False, 0L, (XEvent *) &ev); +} + +void +SendDeleteWindowMessage (TwmWindow *tmp, Time timestamp) +{ + send_clientmessage (tmp->w, _XA_WM_DELETE_WINDOW, timestamp); +} + +void +SendSaveYourselfMessage (TwmWindow *tmp, Time timestamp) +{ + send_clientmessage (tmp->w, _XA_WM_SAVE_YOURSELF, timestamp); +} + +void +SendTakeFocusMessage (TwmWindow *tmp, Time timestamp) +{ + send_clientmessage (tmp->w, _XA_WM_TAKE_FOCUS, timestamp); +} diff --git a/app/twm/src/menus.h b/app/twm/src/menus.h new file mode 100644 index 000000000..6e8c31f59 --- /dev/null +++ b/app/twm/src/menus.h @@ -0,0 +1,206 @@ +/*****************************************************************************/ +/* + +Copyright 1989,1998 The Open Group + +Permission to use, copy, modify, distribute, and sell this software and its +documentation for any purpose is hereby granted without fee, provided that +the above copyright notice appear in all copies and that both that +copyright notice and this permission notice appear in supporting +documentation. + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the name of The Open Group shall not be +used in advertising or otherwise to promote the sale, use or other dealings +in this Software without prior written authorization from The Open Group. + +*/ +/** Copyright 1988 by Evans & Sutherland Computer Corporation, **/ +/** Salt Lake City, Utah **/ +/** Cambridge, Massachusetts **/ +/** **/ +/** All Rights Reserved **/ +/** **/ +/** Permission to use, copy, modify, and distribute this software and **/ +/** its documentation for any purpose and without fee is hereby **/ +/** granted, provided that the above copyright notice appear in all **/ +/** copies and that both that copyright notice and this permis- **/ +/** sion notice appear in supporting documentation, and that the **/ +/** name of Evans & Sutherland not be used in advertising **/ +/** in publicity pertaining to distribution of the software without **/ +/** specific, written prior permission. **/ +/** **/ +/** EVANS & SUTHERLAND DISCLAIMs ALL WARRANTIES WITH REGARD **/ +/** TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANT- **/ +/** ABILITY AND FITNESS, IN NO EVENT SHALL EVANS & SUTHERLAND **/ +/** BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAM- **/ +/** AGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA **/ +/** OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER **/ +/** TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE **/ +/** OR PERFORMANCE OF THIS SOFTWARE. **/ +/*****************************************************************************/ +/* $XFree86: xc/programs/twm/menus.h,v 1.5 2001/08/27 21:11:40 dawes Exp $ */ + + +/*********************************************************************** + * + * $Xorg: menus.h,v 1.4 2001/02/09 02:05:37 xorgcvs Exp $ + * + * twm menus include file + * + * 17-Nov-87 Thomas E. LaStrange File created + * + ***********************************************************************/ + +#ifndef _MENUS_ +#define _MENUS_ + +#define TWM_ROOT "bLoB_GoOp" /* my private root menu */ +#define TWM_WINDOWS "TwmWindows" /* for f.menu "TwmWindows" */ + +#define MAX_FILE_SIZE 4096 /* max chars to read from file for cut */ + +typedef struct MenuItem +{ + struct MenuItem *next; /* next menu item */ + struct MenuItem *prev; /* prev menu item */ + struct MenuRoot *sub; /* MenuRoot of a pull right menu */ + struct MenuRoot *root; /* back pointer to my MenuRoot */ + char *item; /* the character string displayed */ + char *action; /* action to be performed */ + Pixel fore; /* foreground color */ + Pixel back; /* background color */ + Pixel hi_fore; /* highlight foreground */ + Pixel hi_back; /* highlight background */ + short item_num; /* item number of this menu */ + short x; /* x coordinate for text */ + short func; /* twm built in function */ + short state; /* video state, 0 = normal, 1 = reversed */ + short strlen; /* strlen(item) */ + short user_colors; /* colors were specified */ +} MenuItem; + +typedef struct MenuRoot +{ + struct MenuItem *first; /* first item in menu */ + struct MenuItem *last; /* last item in menu */ + struct MenuRoot *prev; /* previous root menu if pull right */ + struct MenuRoot *next; /* next in list of root menus */ + char *name; /* name of root */ + Window w; /* the window of the menu */ + Window shadow; /* the shadow window */ + Pixel hi_fore; /* highlight foreground */ + Pixel hi_back; /* highlight background */ + short mapped; /* NEVER_MAPPED, UNMAPPED, or MAPPED */ + short height; /* height of the menu */ + short width; /* width of the menu */ + short items; /* number of items in the menu */ + short pull; /* is there a pull right entry ? */ + short entered; /* EnterNotify following pop up */ + short real_menu; /* this is a real menu */ +} MenuRoot; + +#define NEVER_MAPPED 0 /* constants for mapped field of MenuRoot */ +#define UNMAPPED 1 +#define MAPPED 2 + + +typedef struct MouseButton +{ + int func; /* the function number */ + int mask; /* modifier mask */ + MenuRoot *menu; /* menu if func is F_MENU */ + MenuItem *item; /* action to perform if func != F_MENU */ +} MouseButton; + +typedef struct FuncKey +{ + struct FuncKey *next; /* next in the list of function keys */ + char *name; /* key name */ + KeySym keysym; /* X keysym */ + KeyCode keycode; /* X keycode */ + int cont; /* context */ + int mods; /* modifiers */ + int func; /* function to perform */ + char *win_name; /* window name (if any) */ + char *action; /* action string (if any) */ +} FuncKey; + +extern int RootFunction; +extern MenuRoot *ActiveMenu; +extern MenuItem *ActiveItem; +extern int MoveFunction; +extern int WindowMoved; +extern int ConstMove; +extern int ConstMoveDir; +extern int ConstMoveX; +extern int ConstMoveY; +extern int ConstMoveXL; +extern int ConstMoveXR; +extern int ConstMoveYT; +extern int ConstMoveYB; +extern int menuFromFrameOrWindowOrTitlebar; +extern int ResizeOrigX; +extern int ResizeOrigY; + +#define MAXMENUDEPTH 10 /* max number of nested menus */ +extern int MenuDepth; + +#define MOVE_NONE 0 /* modes of constrained move */ +#define MOVE_VERT 1 +#define MOVE_HORIZ 2 + +#define WARPSCREEN_NEXT "next" +#define WARPSCREEN_PREV "prev" +#define WARPSCREEN_BACK "back" + +#define COLORMAP_NEXT "next" +#define COLORMAP_PREV "prev" +#define COLORMAP_DEFAULT "default" + +extern void InitMenus ( void ); +extern Bool AddFuncKey ( char *name, int cont, int mods, int func, char *win_name, char *action ); +extern int CreateTitleButton ( char *name, int func, char *action, MenuRoot *menuroot, Bool rightside, Bool append ); +extern void InitTitlebarButtons ( void ); +extern void PaintEntry ( MenuRoot *mr, MenuItem *mi, int exposure ); +extern void PaintMenu ( MenuRoot *mr, XEvent *e ); +extern void UpdateMenu ( void ); +extern MenuRoot * NewMenuRoot ( char *name ); +extern MenuItem * AddToMenu ( MenuRoot *menu, char *item, char *action, MenuRoot *sub, int func, char *fore, char *back ); +extern void MakeMenus ( void ); +extern void MakeMenu ( MenuRoot *mr ); +extern Bool PopUpMenu ( MenuRoot *menu, int x, int y, Bool center ); +extern void PopDownMenu ( void ); +extern MenuRoot * FindMenuRoot ( char *name ); +extern void resizeFromCenter ( Window w, TwmWindow *tmp_win ); +extern int WarpThere ( TwmWindow * t ); +extern int ExecuteFunction ( int func, char *action, Window w, TwmWindow *tmp_win, XEvent *eventp, int context, int pulldown ); +extern int DeferExecution ( int context, int func, Cursor cursor ); +extern void ReGrab ( void ); +extern Bool NeedToDefer ( MenuRoot *root ); +extern void Execute ( char *s ); +extern void FocusOnRoot ( void ); +extern void DeIconify ( TwmWindow *tmp_win ); +extern void Iconify ( TwmWindow *tmp_win, int def_x, int def_y ); +extern void SetMapStateProp ( TwmWindow *tmp_win, int state ); +extern void WarpToScreen ( int n, int inc ); +extern void BumpWindowColormap ( TwmWindow *tmp, int inc ); +extern void HideIconManager ( void ); +extern void SetBorder ( TwmWindow *tmp, Bool onoroff ); +extern void DestroyMenu ( MenuRoot *menu ); +extern void WarpAlongRing ( XButtonEvent *ev, Bool forward ); +extern void WarpToWindow ( TwmWindow *t ); +extern void SendDeleteWindowMessage ( TwmWindow *tmp, Time timestamp ); +extern void SendSaveYourselfMessage ( TwmWindow *tmp, Time timestamp ); +extern void SendTakeFocusMessage ( TwmWindow *tmp, Time timestamp ); + +#endif /* _MENUS_ */ diff --git a/app/twm/src/parse.c b/app/twm/src/parse.c new file mode 100644 index 000000000..88b0b0887 --- /dev/null +++ b/app/twm/src/parse.c @@ -0,0 +1,1122 @@ +/* $XdotOrg: $ */ +/* $XFree86: xc/programs/twm/parse.c,v 1.15 2002/09/24 21:00:28 tsi Exp $ */ +/*****************************************************************************/ +/* + +Copyright 1989, 1998 The Open Group + +Permission to use, copy, modify, distribute, and sell this software and its +documentation for any purpose is hereby granted without fee, provided that +the above copyright notice appear in all copies and that both that +copyright notice and this permission notice appear in supporting +documentation. + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the name of The Open Group shall not be +used in advertising or otherwise to promote the sale, use or other dealings +in this Software without prior written authorization from The Open Group. + +*/ +/** Copyright 1988 by Evans & Sutherland Computer Corporation, **/ +/** Salt Lake City, Utah **/ +/** Cambridge, Massachusetts **/ +/** **/ +/** All Rights Reserved **/ +/** **/ +/** Permission to use, copy, modify, and distribute this software and **/ +/** its documentation for any purpose and without fee is hereby **/ +/** granted, provided that the above copyright notice appear in all **/ +/** copies and that both that copyright notice and this permis- **/ +/** sion notice appear in supporting documentation, and that the **/ +/** name of Evans & Sutherland not be used in advertising **/ +/** in publicity pertaining to distribution of the software without **/ +/** specific, written prior permission. **/ +/** **/ +/** EVANS & SUTHERLAND DISCLAIMs ALL WARRANTIES WITH REGARD **/ +/** TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANT- **/ +/** ABILITY AND FITNESS, IN NO EVENT SHALL EVANS & SUTHERLAND **/ +/** BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAM- **/ +/** AGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA **/ +/** OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER **/ +/** TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE **/ +/** OR PERFORMANCE OF THIS SOFTWARE. **/ +/*****************************************************************************/ + + +/*********************************************************************** + * + * $Xorg: parse.c,v 1.5 2001/02/09 02:05:37 xorgcvs Exp $ + * + * parse the .twmrc file + * + * 17-Nov-87 Thomas E. LaStrange File created + * 10-Oct-90 David M. Sternlicht Storing saved colors on root + ***********************************************************************/ + +#include +#include +#include +#include "twm.h" +#include "screen.h" +#include "menus.h" +#include "util.h" +#include "gram.h" +#include "parse.h" +#include +#include + +#ifndef SYSTEM_INIT_FILE +#define SYSTEM_INIT_FILE "/usr/lib/X11/twm/system.twmrc" +#endif +#define BUF_LEN 300 + +static FILE *twmrc; +static int ptr = 0; +static int len = 0; +static unsigned char buff[BUF_LEN+1]; +static unsigned char overflowbuff[20]; /* really only need one */ +static int overflowlen; +static unsigned char **stringListSource, *currentString; + +static int doparse ( int (*ifunc)(void), char *srctypename, char *srcname ); +static int twmFileInput ( void ); +static int twmStringListInput ( void ); +static int ParseUsePPosition ( char *s ); + +extern int yylineno; + +int ConstrainedMoveTime = 400; /* milliseconds, event times */ + +int (*twmInputFunc)(void); + + +/** + * parse the .twmrc file + * \param filename the filename to parse. NULL indicates $HOME/.twmrc + */ +static int doparse (int (*ifunc)(void), char *srctypename, char*srcname) +{ + mods = 0; + ptr = 0; + len = 0; + yylineno = 1; + ParseError = FALSE; + twmInputFunc = ifunc; + overflowlen = 0; + + yyparse(); + + if (Scr->PointerForeground.pixel != Scr->Black || + Scr->PointerBackground.pixel != Scr->White) + { + XRecolorCursor(dpy, UpperLeftCursor, + &Scr->PointerForeground, &Scr->PointerBackground); + XRecolorCursor(dpy, RightButt, + &Scr->PointerForeground, &Scr->PointerBackground); + XRecolorCursor(dpy, LeftButt, + &Scr->PointerForeground, &Scr->PointerBackground); + XRecolorCursor(dpy, MiddleButt, + &Scr->PointerForeground, &Scr->PointerBackground); + XRecolorCursor(dpy, Scr->FrameCursor, + &Scr->PointerForeground, &Scr->PointerBackground); + XRecolorCursor(dpy, Scr->TitleCursor, + &Scr->PointerForeground, &Scr->PointerBackground); + XRecolorCursor(dpy, Scr->IconCursor, + &Scr->PointerForeground, &Scr->PointerBackground); + XRecolorCursor(dpy, Scr->IconMgrCursor, + &Scr->PointerForeground, &Scr->PointerBackground); + XRecolorCursor(dpy, Scr->MoveCursor, + &Scr->PointerForeground, &Scr->PointerBackground); + XRecolorCursor(dpy, Scr->ResizeCursor, + &Scr->PointerForeground, &Scr->PointerBackground); + XRecolorCursor(dpy, Scr->MenuCursor, + &Scr->PointerForeground, &Scr->PointerBackground); + XRecolorCursor(dpy, Scr->ButtonCursor, + &Scr->PointerForeground, &Scr->PointerBackground); + XRecolorCursor(dpy, Scr->WaitCursor, + &Scr->PointerForeground, &Scr->PointerBackground); + XRecolorCursor(dpy, Scr->SelectCursor, + &Scr->PointerForeground, &Scr->PointerBackground); + XRecolorCursor(dpy, Scr->DestroyCursor, + &Scr->PointerForeground, &Scr->PointerBackground); + } + if (ParseError) { + fprintf (stderr, "%s: errors found in twm %s", + ProgramName, srctypename); + if (srcname) fprintf (stderr, " \"%s\"", srcname); + fprintf (stderr, "\n"); + } + return (ParseError ? 0 : 1); +} + + +int ParseTwmrc (char *filename) +{ + int i; + char *home = NULL; + int homelen = 0; + char *cp = NULL; + char tmpfilename[257]; + + /* + * If filename given, try it, else try ~/.twmrc.# then ~/.twmrc. Then + * try system.twmrc; finally using built-in defaults. + */ + for (twmrc = NULL, i = 0; !twmrc && i < 4; i++) { + switch (i) { + case 0: /* -f filename */ + cp = filename; + break; + + case 1: /* ~/.twmrc.screennum */ + if (!filename) { + home = getenv ("HOME"); + if (home) { + homelen = strlen (home); + cp = tmpfilename; + (void) sprintf (tmpfilename, "%s/.twmrc.%d", + home, Scr->screen); + break; + } + } + continue; + + case 2: /* ~/.twmrc */ + if (home) { + tmpfilename[homelen + 7] = '\0'; + } + break; + + case 3: /* system.twmrc */ + cp = SYSTEM_INIT_FILE; + break; + } + + if (cp) twmrc = fopen (cp, "r"); + } + + if (twmrc) { + int status; + + if (filename && cp != filename) { + fprintf (stderr, + "%s: unable to open twmrc file %s, using %s instead\n", + ProgramName, filename, cp); + } + status = doparse (twmFileInput, "file", cp); + fclose (twmrc); + return status; + } else { + if (filename) { + fprintf (stderr, + "%s: unable to open twmrc file %s, using built-in defaults instead\n", + ProgramName, filename); + } + return ParseStringList (defTwmrc); + } +} + +int ParseStringList (unsigned char **sl) +{ + stringListSource = sl; + currentString = *sl; + return doparse (twmStringListInput, "string list", (char *)NULL); +} + + +/** + * redefinition of the lex input routine for file input + * + * \return the next input character + */ +static int twmFileInput() +{ + if (overflowlen) return (int) overflowbuff[--overflowlen]; + + while (ptr == len) + { + if (fgets((char *) buff, BUF_LEN, twmrc) == NULL) + return 0; + + ptr = 0; + len = strlen((char *) buff); + } + return ((int)buff[ptr++]); +} + +static int twmStringListInput() +{ + if (overflowlen) return (int) overflowbuff[--overflowlen]; + + /* + * return the character currently pointed to + */ + if (currentString) { + unsigned int c = (unsigned int) *currentString++; + + if (c) return c; /* if non-nul char */ + currentString = *++stringListSource; /* advance to next bol */ + return '\n'; /* but say that we hit last eol */ + } + return 0; /* eof */ +} + + +/* + * redefinition of the lex unput routine + * + * \param c the character to push back onto the input stream + */ +void twmUnput (int c) +{ + if (overflowlen < sizeof overflowbuff) { + overflowbuff[overflowlen++] = (unsigned char) c; + } else { + twmrc_error_prefix (); + fprintf (stderr, "unable to unput character (%d)\n", + c); + } +} + + +/** + * redefinition of the lex output routine + * + * \param c the character to print + */ + +void +TwmOutput(int c) +{ + putchar(c); +} + + +/********************************************************************** + * Parsing table and routines + ***********************************************************************/ + +typedef struct _TwmKeyword { + char *name; + int value; + int subnum; +} TwmKeyword; + +#define kw0_NoDefaults 1 +#define kw0_AutoRelativeResize 2 +#define kw0_ForceIcons 3 +#define kw0_NoIconManagers 4 +#define kw0_OpaqueMove 5 +#define kw0_InterpolateMenuColors 6 +#define kw0_NoVersion 7 +#define kw0_SortIconManager 8 +#define kw0_NoGrabServer 9 +#define kw0_NoMenuShadows 10 +#define kw0_NoRaiseOnMove 11 +#define kw0_NoRaiseOnResize 12 +#define kw0_NoRaiseOnDeiconify 13 +#define kw0_DontMoveOff 14 +#define kw0_NoBackingStore 15 +#define kw0_NoSaveUnders 16 +#define kw0_RestartPreviousState 17 +#define kw0_ClientBorderWidth 18 +#define kw0_NoTitleFocus 19 +#define kw0_RandomPlacement 20 +#define kw0_DecorateTransients 21 +#define kw0_ShowIconManager 22 +#define kw0_NoCaseSensitive 23 +#define kw0_NoRaiseOnWarp 24 +#define kw0_WarpUnmapped 25 + +#define kws_UsePPosition 1 +#define kws_IconFont 2 +#define kws_ResizeFont 3 +#define kws_MenuFont 4 +#define kws_TitleFont 5 +#define kws_IconManagerFont 6 +#define kws_UnknownIcon 7 +#define kws_IconDirectory 8 +#define kws_MaxWindowSize 9 + +#define kwn_ConstrainedMoveTime 1 +#define kwn_MoveDelta 2 +#define kwn_XorValue 3 +#define kwn_FramePadding 4 +#define kwn_TitlePadding 5 +#define kwn_ButtonIndent 6 +#define kwn_BorderWidth 7 +#define kwn_IconBorderWidth 8 +#define kwn_TitleButtonBorderWidth 9 +#define kwn_Priority 10 +#define kwn_MenuBorderWidth 11 + +#define kwcl_BorderColor 1 +#define kwcl_IconManagerHighlight 2 +#define kwcl_BorderTileForeground 3 +#define kwcl_BorderTileBackground 4 +#define kwcl_TitleForeground 5 +#define kwcl_TitleBackground 6 +#define kwcl_IconForeground 7 +#define kwcl_IconBackground 8 +#define kwcl_IconBorderColor 9 +#define kwcl_IconManagerForeground 10 +#define kwcl_IconManagerBackground 11 + +#define kwc_DefaultForeground 1 +#define kwc_DefaultBackground 2 +#define kwc_MenuForeground 3 +#define kwc_MenuBackground 4 +#define kwc_MenuTitleForeground 5 +#define kwc_MenuTitleBackground 6 +#define kwc_MenuShadowColor 7 +#define kwc_PointerForeground 8 +#define kwc_PointerBackground 9 +#define kwc_MenuBorderColor 10 + + +/* + * The following is sorted alphabetically according to name (which must be + * in lowercase and only contain the letters a-z). It is fed to a binary + * search to parse keywords. + */ +static TwmKeyword keytable[] = { + { "all", ALL, 0 }, + { "autoraise", AUTO_RAISE, 0 }, + { "autorelativeresize", KEYWORD, kw0_AutoRelativeResize }, + { "bordercolor", CLKEYWORD, kwcl_BorderColor }, + { "bordertilebackground", CLKEYWORD, kwcl_BorderTileBackground }, + { "bordertileforeground", CLKEYWORD, kwcl_BorderTileForeground }, + { "borderwidth", NKEYWORD, kwn_BorderWidth }, + { "button", BUTTON, 0 }, + { "buttonindent", NKEYWORD, kwn_ButtonIndent }, + { "c", CONTROL, 0 }, + { "center", JKEYWORD, J_CENTER }, + { "clientborderwidth", KEYWORD, kw0_ClientBorderWidth }, + { "color", COLOR, 0 }, + { "constrainedmovetime", NKEYWORD, kwn_ConstrainedMoveTime }, + { "control", CONTROL, 0 }, + { "cursors", CURSORS, 0 }, + { "decoratetransients", KEYWORD, kw0_DecorateTransients }, + { "defaultbackground", CKEYWORD, kwc_DefaultBackground }, + { "defaultforeground", CKEYWORD, kwc_DefaultForeground }, + { "defaultfunction", DEFAULT_FUNCTION, 0 }, + { "destroy", KILL, 0 }, + { "donticonifybyunmapping", DONT_ICONIFY_BY_UNMAPPING, 0 }, + { "dontmoveoff", KEYWORD, kw0_DontMoveOff }, + { "dontsqueezetitle", DONT_SQUEEZE_TITLE, 0 }, + { "east", DKEYWORD, D_EAST }, + { "f", FRAME, 0 }, + { "f.autoraise", FKEYWORD, F_AUTORAISE }, + { "f.backiconmgr", FKEYWORD, F_BACKICONMGR }, + { "f.beep", FKEYWORD, F_BEEP }, + { "f.bottomzoom", FKEYWORD, F_BOTTOMZOOM }, + { "f.circledown", FKEYWORD, F_CIRCLEDOWN }, + { "f.circleup", FKEYWORD, F_CIRCLEUP }, + { "f.colormap", FSKEYWORD, F_COLORMAP }, + { "f.cut", FSKEYWORD, F_CUT }, + { "f.cutfile", FKEYWORD, F_CUTFILE }, + { "f.deiconify", FKEYWORD, F_DEICONIFY }, + { "f.delete", FKEYWORD, F_DELETE }, + { "f.deltastop", FKEYWORD, F_DELTASTOP }, + { "f.destroy", FKEYWORD, F_DESTROY }, + { "f.downiconmgr", FKEYWORD, F_DOWNICONMGR }, + { "f.exec", FSKEYWORD, F_EXEC }, + { "f.file", FSKEYWORD, F_FILE }, + { "f.focus", FKEYWORD, F_FOCUS }, + { "f.forcemove", FKEYWORD, F_FORCEMOVE }, + { "f.forwiconmgr", FKEYWORD, F_FORWICONMGR }, + { "f.fullzoom", FKEYWORD, F_FULLZOOM }, + { "f.function", FSKEYWORD, F_FUNCTION }, + { "f.hbzoom", FKEYWORD, F_BOTTOMZOOM }, + { "f.hideiconmgr", FKEYWORD, F_HIDELIST }, + { "f.horizoom", FKEYWORD, F_HORIZOOM }, + { "f.htzoom", FKEYWORD, F_TOPZOOM }, + { "f.hzoom", FKEYWORD, F_HORIZOOM }, + { "f.iconify", FKEYWORD, F_ICONIFY }, + { "f.identify", FKEYWORD, F_IDENTIFY }, + { "f.lefticonmgr", FKEYWORD, F_LEFTICONMGR }, + { "f.leftzoom", FKEYWORD, F_LEFTZOOM }, + { "f.lower", FKEYWORD, F_LOWER }, + { "f.menu", FSKEYWORD, F_MENU }, + { "f.move", FKEYWORD, F_MOVE }, + { "f.nexticonmgr", FKEYWORD, F_NEXTICONMGR }, + { "f.nop", FKEYWORD, F_NOP }, + { "f.previconmgr", FKEYWORD, F_PREVICONMGR }, + { "f.priority", FSKEYWORD, F_PRIORITY }, + { "f.quit", FKEYWORD, F_QUIT }, + { "f.raise", FKEYWORD, F_RAISE }, + { "f.raiselower", FKEYWORD, F_RAISELOWER }, + { "f.refresh", FKEYWORD, F_REFRESH }, + { "f.resize", FKEYWORD, F_RESIZE }, + { "f.restart", FKEYWORD, F_RESTART }, + { "f.righticonmgr", FKEYWORD, F_RIGHTICONMGR }, + { "f.rightzoom", FKEYWORD, F_RIGHTZOOM }, + { "f.saveyourself", FKEYWORD, F_SAVEYOURSELF }, + { "f.showiconmgr", FKEYWORD, F_SHOWLIST }, + { "f.sorticonmgr", FKEYWORD, F_SORTICONMGR }, + { "f.source", FSKEYWORD, F_BEEP }, /* XXX - don't work */ + { "f.startwm", FSKEYWORD, F_STARTWM }, + { "f.title", FKEYWORD, F_TITLE }, + { "f.topzoom", FKEYWORD, F_TOPZOOM }, + { "f.twmrc", FKEYWORD, F_RESTART }, + { "f.unfocus", FKEYWORD, F_UNFOCUS }, + { "f.upiconmgr", FKEYWORD, F_UPICONMGR }, + { "f.version", FKEYWORD, F_VERSION }, + { "f.vlzoom", FKEYWORD, F_LEFTZOOM }, + { "f.vrzoom", FKEYWORD, F_RIGHTZOOM }, + { "f.warpnext", FKEYWORD, F_WARPNEXT }, + { "f.warpprev", FKEYWORD, F_WARPPREV }, + { "f.warpring", FSKEYWORD, F_WARPRING }, + { "f.warpto", FSKEYWORD, F_WARPTO }, + { "f.warptoiconmgr", FSKEYWORD, F_WARPTOICONMGR }, + { "f.warptoscreen", FSKEYWORD, F_WARPTOSCREEN }, + { "f.winrefresh", FKEYWORD, F_WINREFRESH }, + { "f.zoom", FKEYWORD, F_ZOOM }, + { "forceicons", KEYWORD, kw0_ForceIcons }, + { "frame", FRAME, 0 }, + { "framepadding", NKEYWORD, kwn_FramePadding }, + { "function", FUNCTION, 0 }, + { "grayscale", GRAYSCALE, 0 }, + { "greyscale", GRAYSCALE, 0 }, + { "i", ICON, 0 }, + { "icon", ICON, 0 }, + { "iconbackground", CLKEYWORD, kwcl_IconBackground }, + { "iconbordercolor", CLKEYWORD, kwcl_IconBorderColor }, + { "iconborderwidth", NKEYWORD, kwn_IconBorderWidth }, + { "icondirectory", SKEYWORD, kws_IconDirectory }, + { "iconfont", SKEYWORD, kws_IconFont }, + { "iconforeground", CLKEYWORD, kwcl_IconForeground }, + { "iconifybyunmapping", ICONIFY_BY_UNMAPPING, 0 }, + { "iconmanagerbackground", CLKEYWORD, kwcl_IconManagerBackground }, + { "iconmanagerdontshow", ICONMGR_NOSHOW, 0 }, + { "iconmanagerfont", SKEYWORD, kws_IconManagerFont }, + { "iconmanagerforeground", CLKEYWORD, kwcl_IconManagerForeground }, + { "iconmanagergeometry", ICONMGR_GEOMETRY, 0 }, + { "iconmanagerhighlight", CLKEYWORD, kwcl_IconManagerHighlight }, + { "iconmanagers", ICONMGRS, 0 }, + { "iconmanagershow", ICONMGR_SHOW, 0 }, + { "iconmgr", ICONMGR, 0 }, + { "iconregion", ICON_REGION, 0 }, + { "icons", ICONS, 0 }, + { "interpolatemenucolors", KEYWORD, kw0_InterpolateMenuColors }, + { "l", LOCK, 0 }, + { "left", JKEYWORD, J_LEFT }, + { "lefttitlebutton", LEFT_TITLEBUTTON, 0 }, + { "lock", LOCK, 0 }, + { "m", META, 0 }, + { "maketitle", MAKE_TITLE, 0 }, + { "maxwindowsize", SKEYWORD, kws_MaxWindowSize }, + { "menu", MENU, 0 }, + { "menubackground", CKEYWORD, kwc_MenuBackground }, + { "menubordercolor", CKEYWORD, kwc_MenuBorderColor }, + { "menuborderwidth", NKEYWORD, kwn_MenuBorderWidth }, + { "menufont", SKEYWORD, kws_MenuFont }, + { "menuforeground", CKEYWORD, kwc_MenuForeground }, + { "menushadowcolor", CKEYWORD, kwc_MenuShadowColor }, + { "menutitlebackground", CKEYWORD, kwc_MenuTitleBackground }, + { "menutitleforeground", CKEYWORD, kwc_MenuTitleForeground }, + { "meta", META, 0 }, + { "mod", META, 0 }, /* fake it */ + { "monochrome", MONOCHROME, 0 }, + { "move", MOVE, 0 }, + { "movedelta", NKEYWORD, kwn_MoveDelta }, + { "nobackingstore", KEYWORD, kw0_NoBackingStore }, + { "nocasesensitive", KEYWORD, kw0_NoCaseSensitive }, + { "nodefaults", KEYWORD, kw0_NoDefaults }, + { "nograbserver", KEYWORD, kw0_NoGrabServer }, + { "nohighlight", NO_HILITE, 0 }, + { "noiconmanagers", KEYWORD, kw0_NoIconManagers }, + { "nomenushadows", KEYWORD, kw0_NoMenuShadows }, + { "noraiseondeiconify", KEYWORD, kw0_NoRaiseOnDeiconify }, + { "noraiseonmove", KEYWORD, kw0_NoRaiseOnMove }, + { "noraiseonresize", KEYWORD, kw0_NoRaiseOnResize }, + { "noraiseonwarp", KEYWORD, kw0_NoRaiseOnWarp }, + { "north", DKEYWORD, D_NORTH }, + { "nosaveunders", KEYWORD, kw0_NoSaveUnders }, + { "nostackmode", NO_STACKMODE, 0 }, + { "notitle", NO_TITLE, 0 }, + { "notitlefocus", KEYWORD, kw0_NoTitleFocus }, + { "notitlehighlight", NO_TITLE_HILITE, 0 }, + { "noversion", KEYWORD, kw0_NoVersion }, + { "opaquemove", KEYWORD, kw0_OpaqueMove }, + { "pixmaps", PIXMAPS, 0 }, + { "pointerbackground", CKEYWORD, kwc_PointerBackground }, + { "pointerforeground", CKEYWORD, kwc_PointerForeground }, + { "priority", NKEYWORD, kwn_Priority }, + { "r", ROOT, 0 }, + { "randomplacement", KEYWORD, kw0_RandomPlacement }, + { "resize", RESIZE, 0 }, + { "resizefont", SKEYWORD, kws_ResizeFont }, + { "restartpreviousstate", KEYWORD, kw0_RestartPreviousState }, + { "right", JKEYWORD, J_RIGHT }, + { "righttitlebutton", RIGHT_TITLEBUTTON, 0 }, + { "root", ROOT, 0 }, + { "s", SHIFT, 0 }, + { "savecolor", SAVECOLOR, 0}, + { "select", SELECT, 0 }, + { "shift", SHIFT, 0 }, + { "showiconmanager", KEYWORD, kw0_ShowIconManager }, + { "sorticonmanager", KEYWORD, kw0_SortIconManager }, + { "south", DKEYWORD, D_SOUTH }, + { "squeezetitle", SQUEEZE_TITLE, 0 }, + { "starticonified", START_ICONIFIED, 0 }, + { "t", TITLE, 0 }, + { "title", TITLE, 0 }, + { "titlebackground", CLKEYWORD, kwcl_TitleBackground }, + { "titlebuttonborderwidth", NKEYWORD, kwn_TitleButtonBorderWidth }, + { "titlefont", SKEYWORD, kws_TitleFont }, + { "titleforeground", CLKEYWORD, kwcl_TitleForeground }, + { "titlehighlight", TITLE_HILITE, 0 }, + { "titlepadding", NKEYWORD, kwn_TitlePadding }, + { "unknownicon", SKEYWORD, kws_UnknownIcon }, + { "usepposition", SKEYWORD, kws_UsePPosition }, + { "w", WINDOW, 0 }, + { "wait", WAIT, 0 }, + { "warpcursor", WARP_CURSOR, 0 }, + { "warpunmapped", KEYWORD, kw0_WarpUnmapped }, + { "west", DKEYWORD, D_WEST }, + { "window", WINDOW, 0 }, + { "windowfunction", WINDOW_FUNCTION, 0 }, + { "windowring", WINDOW_RING, 0 }, + { "xorvalue", NKEYWORD, kwn_XorValue }, + { "zoom", ZOOM, 0 }, +}; + +static int numkeywords = (sizeof(keytable)/sizeof(keytable[0])); + +int parse_keyword (char *s, int *nump) +{ + register int lower = 0, upper = numkeywords - 1; + + XmuCopyISOLatin1Lowered (s, s); + while (lower <= upper) { + int middle = (lower + upper) / 2; + TwmKeyword *p = &keytable[middle]; + int res = strcmp (p->name, s); + + if (res < 0) { + lower = middle + 1; + } else if (res == 0) { + *nump = p->subnum; + return p->value; + } else { + upper = middle - 1; + } + } + return ERRORTOKEN; +} + + + +/* + * action routines called by grammar + */ + +int do_single_keyword (int keyword) +{ + switch (keyword) { + case kw0_NoDefaults: + Scr->NoDefaults = TRUE; + return 1; + + case kw0_AutoRelativeResize: + Scr->AutoRelativeResize = TRUE; + return 1; + + case kw0_ForceIcons: + if (Scr->FirstTime) Scr->ForceIcon = TRUE; + return 1; + + case kw0_NoIconManagers: + Scr->NoIconManagers = TRUE; + return 1; + + case kw0_OpaqueMove: + Scr->OpaqueMove = TRUE; + return 1; + + case kw0_InterpolateMenuColors: + if (Scr->FirstTime) Scr->InterpolateMenuColors = TRUE; + return 1; + + case kw0_NoVersion: + /* obsolete */ + return 1; + + case kw0_SortIconManager: + if (Scr->FirstTime) Scr->SortIconMgr = TRUE; + return 1; + + case kw0_NoGrabServer: + Scr->NoGrabServer = TRUE; + return 1; + + case kw0_NoMenuShadows: + if (Scr->FirstTime) Scr->Shadow = FALSE; + return 1; + + case kw0_NoRaiseOnMove: + if (Scr->FirstTime) Scr->NoRaiseMove = TRUE; + return 1; + + case kw0_NoRaiseOnResize: + if (Scr->FirstTime) Scr->NoRaiseResize = TRUE; + return 1; + + case kw0_NoRaiseOnDeiconify: + if (Scr->FirstTime) Scr->NoRaiseDeicon = TRUE; + return 1; + + case kw0_DontMoveOff: + Scr->DontMoveOff = TRUE; + return 1; + + case kw0_NoBackingStore: + Scr->BackingStore = FALSE; + return 1; + + case kw0_NoSaveUnders: + Scr->SaveUnder = FALSE; + return 1; + + case kw0_RestartPreviousState: + RestartPreviousState = True; + return 1; + + case kw0_ClientBorderWidth: + if (Scr->FirstTime) Scr->ClientBorderWidth = TRUE; + return 1; + + case kw0_NoTitleFocus: + Scr->TitleFocus = FALSE; + return 1; + + case kw0_RandomPlacement: + Scr->RandomPlacement = TRUE; + return 1; + + case kw0_DecorateTransients: + Scr->DecorateTransients = TRUE; + return 1; + + case kw0_ShowIconManager: + Scr->ShowIconManager = TRUE; + return 1; + + case kw0_NoCaseSensitive: + Scr->CaseSensitive = FALSE; + return 1; + + case kw0_NoRaiseOnWarp: + Scr->NoRaiseWarp = TRUE; + return 1; + + case kw0_WarpUnmapped: + Scr->WarpUnmapped = TRUE; + return 1; + } + + return 0; +} + + +int do_string_keyword (int keyword, char *s) +{ + switch (keyword) { + case kws_UsePPosition: + { + int ppos = ParseUsePPosition (s); + if (ppos < 0) { + twmrc_error_prefix(); + fprintf (stderr, + "ignoring invalid UsePPosition argument \"%s\"\n", s); + } else { + Scr->UsePPosition = ppos; + } + return 1; + } + + case kws_IconFont: + if (!Scr->HaveFonts) Scr->IconFont.name = s; + return 1; + + case kws_ResizeFont: + if (!Scr->HaveFonts) Scr->SizeFont.name = s; + return 1; + + case kws_MenuFont: + if (!Scr->HaveFonts) Scr->MenuFont.name = s; + return 1; + + case kws_TitleFont: + if (!Scr->HaveFonts) Scr->TitleBarFont.name = s; + return 1; + + case kws_IconManagerFont: + if (!Scr->HaveFonts) Scr->IconManagerFont.name = s; + return 1; + + case kws_UnknownIcon: + if (Scr->FirstTime) GetUnknownIcon (s); + return 1; + + case kws_IconDirectory: + if (Scr->FirstTime) Scr->IconDirectory = ExpandFilename (s); + return 1; + + case kws_MaxWindowSize: + JunkMask = XParseGeometry (s, &JunkX, &JunkY, &JunkWidth, &JunkHeight); + if ((JunkMask & (WidthValue | HeightValue)) != + (WidthValue | HeightValue)) { + twmrc_error_prefix(); + fprintf (stderr, "bad MaxWindowSize \"%s\"\n", s); + return 0; + } + if (JunkWidth <= 0 || JunkHeight <= 0) { + twmrc_error_prefix(); + fprintf (stderr, "MaxWindowSize \"%s\" must be positive\n", s); + return 0; + } + Scr->MaxWindowWidth = JunkWidth; + Scr->MaxWindowHeight = JunkHeight; + return 1; + } + + return 0; +} + + +int do_number_keyword (int keyword, int num) +{ + switch (keyword) { + case kwn_ConstrainedMoveTime: + ConstrainedMoveTime = num; + return 1; + + case kwn_MoveDelta: + Scr->MoveDelta = num; + return 1; + + case kwn_XorValue: + if (Scr->FirstTime) Scr->XORvalue = num; + return 1; + + case kwn_FramePadding: + if (Scr->FirstTime) Scr->FramePadding = num; + return 1; + + case kwn_TitlePadding: + if (Scr->FirstTime) Scr->TitlePadding = num; + return 1; + + case kwn_ButtonIndent: + if (Scr->FirstTime) Scr->ButtonIndent = num; + return 1; + + case kwn_BorderWidth: + if (Scr->FirstTime) Scr->BorderWidth = num; + return 1; + + case kwn_IconBorderWidth: + if (Scr->FirstTime) Scr->IconBorderWidth = num; + return 1; + + case kwn_MenuBorderWidth: + if (Scr->FirstTime) Scr->MenuBorderWidth = num; + return 1; + + case kwn_TitleButtonBorderWidth: + if (Scr->FirstTime) Scr->TBInfo.border = num; + return 1; + + case kwn_Priority: + if (HasSync) XSyncSetPriority(dpy, /*self*/ None, num); + return 1; + } + + return 0; +} + +name_list **do_colorlist_keyword (int keyword, int colormode, char *s) +{ + switch (keyword) { + case kwcl_BorderColor: + GetColor (colormode, &Scr->BorderColor, s); + return &Scr->BorderColorL; + + case kwcl_IconManagerHighlight: + GetColor (colormode, &Scr->IconManagerHighlight, s); + return &Scr->IconManagerHighlightL; + + case kwcl_BorderTileForeground: + GetColor (colormode, &Scr->BorderTileC.fore, s); + return &Scr->BorderTileForegroundL; + + case kwcl_BorderTileBackground: + GetColor (colormode, &Scr->BorderTileC.back, s); + return &Scr->BorderTileBackgroundL; + + case kwcl_TitleForeground: + GetColor (colormode, &Scr->TitleC.fore, s); + return &Scr->TitleForegroundL; + + case kwcl_TitleBackground: + GetColor (colormode, &Scr->TitleC.back, s); + return &Scr->TitleBackgroundL; + + case kwcl_IconForeground: + GetColor (colormode, &Scr->IconC.fore, s); + return &Scr->IconForegroundL; + + case kwcl_IconBackground: + GetColor (colormode, &Scr->IconC.back, s); + return &Scr->IconBackgroundL; + + case kwcl_IconBorderColor: + GetColor (colormode, &Scr->IconBorderColor, s); + return &Scr->IconBorderColorL; + + case kwcl_IconManagerForeground: + GetColor (colormode, &Scr->IconManagerC.fore, s); + return &Scr->IconManagerFL; + + case kwcl_IconManagerBackground: + GetColor (colormode, &Scr->IconManagerC.back, s); + return &Scr->IconManagerBL; + } + return NULL; +} + +int do_color_keyword (int keyword, int colormode, char *s) +{ + switch (keyword) { + case kwc_DefaultForeground: + GetColor (colormode, &Scr->DefaultC.fore, s); + return 1; + + case kwc_DefaultBackground: + GetColor (colormode, &Scr->DefaultC.back, s); + return 1; + + case kwc_MenuForeground: + GetColor (colormode, &Scr->MenuC.fore, s); + return 1; + + case kwc_MenuBackground: + GetColor (colormode, &Scr->MenuC.back, s); + return 1; + + case kwc_MenuBorderColor: + GetColor (colormode, &Scr->MenuBorderColor, s); + return 1; + + case kwc_MenuTitleForeground: + GetColor (colormode, &Scr->MenuTitleC.fore, s); + return 1; + + case kwc_MenuTitleBackground: + GetColor (colormode, &Scr->MenuTitleC.back, s); + return 1; + + case kwc_MenuShadowColor: + GetColor (colormode, &Scr->MenuShadowColor, s); + return 1; + + case kwc_PointerForeground: + GetColorValue (colormode, &Scr->PointerForeground, s); + return 1; + + case kwc_PointerBackground: + GetColorValue (colormode, &Scr->PointerBackground, s); + return 1; + } + + return 0; +} + +/** + * Save a pixel value in twm root window color property. + */ +void +put_pixel_on_root(Pixel pixel) +{ + int i, addPixel = 1; + Atom pixelAtom, retAtom; + int retFormat; + unsigned long nPixels, retAfter; + Pixel *retProp; + pixelAtom = XInternAtom(dpy, "_MIT_PRIORITY_COLORS", True); + XGetWindowProperty(dpy, Scr->Root, pixelAtom, 0, 8192, + False, XA_CARDINAL, &retAtom, + &retFormat, &nPixels, &retAfter, + (unsigned char **)&retProp); + + for (i=0; i< nPixels; i++) + if (pixel == retProp[i]) addPixel = 0; + + if (addPixel) + XChangeProperty (dpy, Scr->Root, _XA_MIT_PRIORITY_COLORS, + XA_CARDINAL, 32, PropModeAppend, + (unsigned char *)&pixel, 1); +} + +/** + * save a color from a string in the twmrc file. + */ +void +do_string_savecolor(int colormode, char *s) +{ + Pixel p; + GetColor(colormode, &p, s); + put_pixel_on_root(p); +} + +typedef struct _cnode {int i; struct _cnode *next;} Cnode, *Cptr; +Cptr chead = NULL; + +/** + * save a color from a var in the twmrc file + */ +void +do_var_savecolor(int key) +{ + Cptr cptrav, cpnew; + if (!chead) { + chead = (Cptr)malloc(sizeof(Cnode)); + chead->i = key; chead->next = NULL; + } + else { + cptrav = chead; + while (cptrav->next != NULL) { cptrav = cptrav->next; } + cpnew = (Cptr)malloc(sizeof(Cnode)); + cpnew->i = key; cpnew->next = NULL; cptrav->next = cpnew; + } +} + +/** + * traverse the var save color list placeing the pixels + * in the root window property. + */ +void +assign_var_savecolor() +{ + Cptr cp = chead; + while (cp != NULL) { + switch (cp->i) { + case kwcl_BorderColor: + put_pixel_on_root(Scr->BorderColor); + break; + case kwcl_IconManagerHighlight: + put_pixel_on_root(Scr->IconManagerHighlight); + break; + case kwcl_BorderTileForeground: + put_pixel_on_root(Scr->BorderTileC.fore); + break; + case kwcl_BorderTileBackground: + put_pixel_on_root(Scr->BorderTileC.back); + break; + case kwcl_TitleForeground: + put_pixel_on_root(Scr->TitleC.fore); + break; + case kwcl_TitleBackground: + put_pixel_on_root(Scr->TitleC.back); + break; + case kwcl_IconForeground: + put_pixel_on_root(Scr->IconC.fore); + break; + case kwcl_IconBackground: + put_pixel_on_root(Scr->IconC.back); + break; + case kwcl_IconBorderColor: + put_pixel_on_root(Scr->IconBorderColor); + break; + case kwcl_IconManagerForeground: + put_pixel_on_root(Scr->IconManagerC.fore); + break; + case kwcl_IconManagerBackground: + put_pixel_on_root(Scr->IconManagerC.back); + break; + } + cp = cp->next; + } + if (chead) { + free(chead); + chead = NULL; + } +} + +static int +ParseUsePPosition (char *s) +{ + XmuCopyISOLatin1Lowered (s, s); + + if (strcmp (s, "off") == 0) { + return PPOS_OFF; + } else if (strcmp (s, "on") == 0) { + return PPOS_ON; + } else if (strcmp (s, "non-zero") == 0 || + strcmp (s, "nonzero") == 0) { + return PPOS_NON_ZERO; + } + + return -1; +} + + +/** + * + * \param list squeeze or dont-squeeze list + * \param name window name + * \param justify left, center, or right + * \param num signed num + * \param denom 0 or indicates fraction denom + */ +void +do_squeeze_entry (name_list **list, char *name, int justify, int num, int denom) +{ + int absnum = (num < 0 ? -num : num); + + if (denom < 0) { + twmrc_error_prefix(); + fprintf (stderr, "negative SqueezeTitle denominator %d\n", denom); + return; + } + if (absnum > denom && denom != 0) { + twmrc_error_prefix(); + fprintf (stderr, "SqueezeTitle fraction %d/%d outside window\n", + num, denom); + return; + } + if (denom == 1) { + twmrc_error_prefix(); + fprintf (stderr, "useless SqueezeTitle faction %d/%d, assuming 0/0\n", + num, denom); + num = 0; + denom = 0; + } + + if (HasShape) { + SqueezeInfo *sinfo; + sinfo = (SqueezeInfo *) malloc (sizeof(SqueezeInfo)); + + if (!sinfo) { + twmrc_error_prefix(); + fprintf (stderr, "unable to allocate %ld bytes for squeeze info\n", + (unsigned long)sizeof(SqueezeInfo)); + return; + } + sinfo->justify = justify; + sinfo->num = num; + sinfo->denom = denom; + AddToList (list, name, (char *) sinfo); + } +} diff --git a/app/twm/src/parse.h b/app/twm/src/parse.h new file mode 100644 index 000000000..1768f1091 --- /dev/null +++ b/app/twm/src/parse.h @@ -0,0 +1,161 @@ +/* $XdotOrg: $ */ +/* $XFree86: xc/programs/twm/parse.h,v 1.10 2001/09/30 17:58:19 herrb Exp $ */ +/*****************************************************************************/ +/* + +Copyright 1989, 1998 The Open Group + +Permission to use, copy, modify, distribute, and sell this software and its +documentation for any purpose is hereby granted without fee, provided that +the above copyright notice appear in all copies and that both that +copyright notice and this permission notice appear in supporting +documentation. + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the name of The Open Group shall not be +used in advertising or otherwise to promote the sale, use or other dealings +in this Software without prior written authorization from The Open Group. + +*/ +/** Copyright 1988 by Evans & Sutherland Computer Corporation, **/ +/** Salt Lake City, Utah **/ +/** Cambridge, Massachusetts **/ +/** **/ +/** All Rights Reserved **/ +/** **/ +/** Permission to use, copy, modify, and distribute this software and **/ +/** its documentation for any purpose and without fee is hereby **/ +/** granted, provided that the above copyright notice appear in all **/ +/** copies and that both that copyright notice and this permis- **/ +/** sion notice appear in supporting documentation, and that the **/ +/** name of Evans & Sutherland not be used in advertising **/ +/** in publicity pertaining to distribution of the software without **/ +/** specific, written prior permission. **/ +/** **/ +/** EVANS & SUTHERLAND DISCLAIMs ALL WARRANTIES WITH REGARD **/ +/** TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANT- **/ +/** ABILITY AND FITNESS, IN NO EVENT SHALL EVANS & SUTHERLAND **/ +/** BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAM- **/ +/** AGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA **/ +/** OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER **/ +/** TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE **/ +/** OR PERFORMANCE OF THIS SOFTWARE. **/ +/*****************************************************************************/ + + +/********************************************************************** + * + * $Xorg: parse.h,v 1.4 2001/02/09 02:05:37 xorgcvs Exp $ + * + * .twmrc parsing externs + * + * 8-Apr-88 Tom LaStrange Initial Version. + * + **********************************************************************/ + +#ifndef _PARSE_ +#define _PARSE_ + +#include "list.h" + +extern void assign_var_savecolor ( void ); +extern int do_single_keyword ( int keyword ); +extern int do_string_keyword ( int keyword, char *s ); +extern int do_number_keyword ( int keyword, int num ); +extern name_list **do_colorlist_keyword ( int keyword, int colormode, + char *s ); +extern int do_color_keyword ( int keyword, int colormode, char *s ); +void put_pixel_on_root ( Pixel pixel ); +extern void do_string_savecolor ( int colormode, char *s ); +extern void do_var_savecolor ( int key ); +extern int ParseStringList ( unsigned char **sl ); +extern int ParseTwmrc ( char *filename ); +extern int parse_keyword ( char *s, int *nump ); +extern void TwmOutput ( int c ); +extern void twmUnput ( int c ); +extern void do_squeeze_entry ( name_list **list, char *name, int justify, + int num, int denom ); + + +extern int (*twmInputFunc)(void); +extern int ConstrainedMoveTime; +extern unsigned char *defTwmrc[]; +extern int mods; + +#define F_NOP 0 +#define F_BEEP 1 +#define F_RESTART 2 +#define F_QUIT 3 +#define F_FOCUS 4 +#define F_REFRESH 5 +#define F_WINREFRESH 6 +#define F_DELTASTOP 7 +#define F_MOVE 8 +#define F_POPUP 9 +#define F_FORCEMOVE 10 +#define F_AUTORAISE 11 +#define F_IDENTIFY 12 +#define F_ICONIFY 13 +#define F_DEICONIFY 14 +#define F_UNFOCUS 15 +#define F_RESIZE 16 +#define F_ZOOM 17 +#define F_LEFTZOOM 18 +#define F_RIGHTZOOM 19 +#define F_TOPZOOM 20 +#define F_BOTTOMZOOM 21 +#define F_HORIZOOM 22 +#define F_FULLZOOM 23 +#define F_RAISE 24 +#define F_RAISELOWER 25 +#define F_LOWER 26 +#define F_DESTROY 27 +#define F_DELETE 28 +#define F_SAVEYOURSELF 29 +#define F_VERSION 30 +#define F_TITLE 31 +#define F_RIGHTICONMGR 32 +#define F_LEFTICONMGR 33 +#define F_UPICONMGR 34 +#define F_DOWNICONMGR 35 +#define F_FORWICONMGR 36 +#define F_BACKICONMGR 37 +#define F_NEXTICONMGR 38 +#define F_PREVICONMGR 39 +#define F_SORTICONMGR 40 +#define F_CIRCLEUP 41 +#define F_CIRCLEDOWN 42 +#define F_CUTFILE 43 +#define F_SHOWLIST 44 +#define F_HIDELIST 45 + +#define F_MENU 101 /* string */ +#define F_WARPNEXT 112 /* string */ +#define F_WARPPREV 113 /* string */ +#define F_WARPTO 102 /* string */ +#define F_WARPTOICONMGR 103 /* string */ +#define F_WARPRING 104 /* string */ +#define F_FILE 105 /* string */ +#define F_EXEC 106 /* string */ +#define F_CUT 107 /* string */ +#define F_FUNCTION 108 /* string */ +#define F_WARPTOSCREEN 109 /* string */ +#define F_COLORMAP 110 /* string */ +#define F_PRIORITY 111 /* string */ +#define F_STARTWM 114 /* string */ + +#define D_NORTH 1 +#define D_SOUTH 2 +#define D_EAST 3 +#define D_WEST 4 + +#endif /* _PARSE_ */ diff --git a/app/twm/src/resize.c b/app/twm/src/resize.c new file mode 100644 index 000000000..2f114e197 --- /dev/null +++ b/app/twm/src/resize.c @@ -0,0 +1,1143 @@ +/*****************************************************************************/ +/* + +Copyright 1989, 1998 The Open Group + +Permission to use, copy, modify, distribute, and sell this software and its +documentation for any purpose is hereby granted without fee, provided that +the above copyright notice appear in all copies and that both that +copyright notice and this permission notice appear in supporting +documentation. + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the name of The Open Group shall not be +used in advertising or otherwise to promote the sale, use or other dealings +in this Software without prior written authorization from The Open Group. + +*/ +/** Copyright 1988 by Evans & Sutherland Computer Corporation, **/ +/** Salt Lake City, Utah **/ +/** Cambridge, Massachusetts **/ +/** **/ +/** All Rights Reserved **/ +/** **/ +/** Permission to use, copy, modify, and distribute this software and **/ +/** its documentation for any purpose and without fee is hereby **/ +/** granted, provided that the above copyright notice appear in all **/ +/** copies and that both that copyright notice and this permis- **/ +/** sion notice appear in supporting documentation, and that the **/ +/** name of Evans & Sutherland not be used in advertising **/ +/** in publicity pertaining to distribution of the software without **/ +/** specific, written prior permission. **/ +/** **/ +/** EVANS & SUTHERLAND DISCLAIMs ALL WARRANTIES WITH REGARD **/ +/** TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANT- **/ +/** ABILITY AND FITNESS, IN NO EVENT SHALL EVANS & SUTHERLAND **/ +/** BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAM- **/ +/** AGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA **/ +/** OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER **/ +/** TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE **/ +/** OR PERFORMANCE OF THIS SOFTWARE. **/ +/*****************************************************************************/ + + +/*********************************************************************** + * + * $Xorg: resize.c,v 1.5 2001/02/09 02:05:37 xorgcvs Exp $ + * + * window resizing borrowed from the "wm" window manager + * + * 11-Dec-87 Thomas E. LaStrange File created + * + ***********************************************************************/ + +/* $XFree86: xc/programs/twm/resize.c,v 1.7 2001/01/17 23:45:07 dawes Exp $ */ + +#include +#include "twm.h" +#include "parse.h" +#include "util.h" +#include "resize.h" +#include "iconmgr.h" +#include "add_window.h" +#include "screen.h" +#include "events.h" + +#define MINHEIGHT 0 /* had been 32 */ +#define MINWIDTH 0 /* had been 60 */ + +static int dragx; /* all these variables are used */ +static int dragy; /* in resize operations */ +static int dragWidth; +static int dragHeight; + +static int origx; +static int origy; +static int origWidth; +static int origHeight; + +static int clampTop; +static int clampBottom; +static int clampLeft; +static int clampRight; +static int clampDX; +static int clampDY; + +static int last_width; +static int last_height; + + +static void +do_auto_clamp (TwmWindow *tmp_win, XEvent *evp) +{ + Window junkRoot; + int x, y, h, v, junkbw; + unsigned int junkMask; + + switch (evp->type) { + case ButtonPress: + x = evp->xbutton.x_root; + y = evp->xbutton.y_root; + break; + case KeyPress: + x = evp->xkey.x_root; + y = evp->xkey.y_root; + break; + default: + if (!XQueryPointer (dpy, Scr->Root, &junkRoot, &junkRoot, + &x, &y, &junkbw, &junkbw, &junkMask)) + return; + } + + h = ((x - dragx) / (dragWidth < 3 ? 1 : (dragWidth / 3))); + v = ((y - dragy - tmp_win->title_height) / + (dragHeight < 3 ? 1 : (dragHeight / 3))); + + if (h <= 0) { + clampLeft = 1; + clampDX = (x - dragx); + } else if (h >= 2) { + clampRight = 1; + clampDX = (x - dragx - dragWidth); + } + + if (v <= 0) { + clampTop = 1; + clampDY = (y - dragy); + } else if (v >= 2) { + clampBottom = 1; + clampDY = (y - dragy - dragHeight); + } +} + + +/** + * begin a window resize operation + * \param ev the event structure (button press) + * \param tmp_win the TwmWindow pointer + * \param fromtitlebar action invoked from titlebar button + */ +void +StartResize(XEvent *evp, TwmWindow *tmp_win, Bool fromtitlebar) +{ + Window junkRoot; + unsigned int junkbw, junkDepth; + + ResizeWindow = tmp_win->frame; + XGrabServer(dpy); + XGrabPointer(dpy, Scr->Root, True, + ButtonPressMask | ButtonReleaseMask | + ButtonMotionMask | PointerMotionHintMask, + GrabModeAsync, GrabModeAsync, + Scr->Root, Scr->ResizeCursor, CurrentTime); + + XGetGeometry(dpy, (Drawable) tmp_win->frame, &junkRoot, + &dragx, &dragy, (unsigned int *)&dragWidth, (unsigned int *)&dragHeight, &junkbw, + &junkDepth); + dragx += tmp_win->frame_bw; + dragy += tmp_win->frame_bw; + origx = dragx; + origy = dragy; + origWidth = dragWidth; + origHeight = dragHeight; + clampTop = clampBottom = clampLeft = clampRight = clampDX = clampDY = 0; + + if (Scr->AutoRelativeResize && !fromtitlebar) + do_auto_clamp (tmp_win, evp); + + Scr->SizeStringOffset = SIZE_HINDENT; + XResizeWindow (dpy, Scr->SizeWindow, + Scr->SizeStringWidth + SIZE_HINDENT * 2, + Scr->SizeFont.height + SIZE_VINDENT * 2); + XMapRaised(dpy, Scr->SizeWindow); + InstallRootColormap(); + last_width = 0; + last_height = 0; + DisplaySize(tmp_win, origWidth, origHeight); + MoveOutline (Scr->Root, dragx - tmp_win->frame_bw, + dragy - tmp_win->frame_bw, dragWidth + 2 * tmp_win->frame_bw, + dragHeight + 2 * tmp_win->frame_bw, + tmp_win->frame_bw, tmp_win->title_height); +} + + + +void +MenuStartResize(TwmWindow *tmp_win, int x, int y, int w, int h) +{ + XGrabServer(dpy); + XGrabPointer(dpy, Scr->Root, True, + ButtonPressMask | ButtonMotionMask | PointerMotionMask, + GrabModeAsync, GrabModeAsync, + Scr->Root, Scr->ResizeCursor, CurrentTime); + dragx = x + tmp_win->frame_bw; + dragy = y + tmp_win->frame_bw; + origx = dragx; + origy = dragy; + dragWidth = origWidth = w; /* - 2 * tmp_win->frame_bw; */ + dragHeight = origHeight = h; /* - 2 * tmp_win->frame_bw; */ + clampTop = clampBottom = clampLeft = clampRight = clampDX = clampDY = 0; + last_width = 0; + last_height = 0; + Scr->SizeStringOffset = SIZE_HINDENT; + XResizeWindow (dpy, Scr->SizeWindow, + Scr->SizeStringWidth + SIZE_HINDENT * 2, + Scr->SizeFont.height + SIZE_VINDENT * 2); + XMapRaised(dpy, Scr->SizeWindow); + DisplaySize(tmp_win, origWidth, origHeight); + MoveOutline (Scr->Root, dragx - tmp_win->frame_bw, + dragy - tmp_win->frame_bw, + dragWidth + 2 * tmp_win->frame_bw, + dragHeight + 2 * tmp_win->frame_bw, + tmp_win->frame_bw, tmp_win->title_height); +} + +/** + * begin a windorew resize operation from AddWindow + * \param tmp_win the TwmWindow pointer + */ +void +AddStartResize(TwmWindow *tmp_win, int x, int y, int w, int h) +{ + XGrabServer(dpy); + XGrabPointer(dpy, Scr->Root, True, + ButtonReleaseMask | ButtonMotionMask | PointerMotionHintMask, + GrabModeAsync, GrabModeAsync, + Scr->Root, Scr->ResizeCursor, CurrentTime); + + dragx = x + tmp_win->frame_bw; + dragy = y + tmp_win->frame_bw; + origx = dragx; + origy = dragy; + dragWidth = origWidth = w - 2 * tmp_win->frame_bw; + dragHeight = origHeight = h - 2 * tmp_win->frame_bw; + clampTop = clampBottom = clampLeft = clampRight = clampDX = clampDY = 0; +/***** + if (Scr->AutoRelativeResize) { + clampRight = clampBottom = 1; + } +*****/ + last_width = 0; + last_height = 0; + DisplaySize(tmp_win, origWidth, origHeight); +} + + + +void +MenuDoResize(int x_root, int y_root, TwmWindow *tmp_win) +{ + int action; + + action = 0; + + x_root -= clampDX; + y_root -= clampDY; + + if (clampTop) { + int delta = y_root - dragy; + if (dragHeight - delta < MINHEIGHT) { + delta = dragHeight - MINHEIGHT; + clampTop = 0; + } + dragy += delta; + dragHeight -= delta; + action = 1; + } + else if (y_root <= dragy/* || + y_root == findRootInfo(root)->rooty*/) { + dragy = y_root; + dragHeight = origy + origHeight - + y_root; + clampBottom = 0; + clampTop = 1; + clampDY = 0; + action = 1; + } + if (clampLeft) { + int delta = x_root - dragx; + if (dragWidth - delta < MINWIDTH) { + delta = dragWidth - MINWIDTH; + clampLeft = 0; + } + dragx += delta; + dragWidth -= delta; + action = 1; + } + else if (x_root <= dragx/* || + x_root == findRootInfo(root)->rootx*/) { + dragx = x_root; + dragWidth = origx + origWidth - + x_root; + clampRight = 0; + clampLeft = 1; + clampDX = 0; + action = 1; + } + if (clampBottom) { + int delta = y_root - dragy - dragHeight; + if (dragHeight + delta < MINHEIGHT) { + delta = MINHEIGHT - dragHeight; + clampBottom = 0; + } + dragHeight += delta; + action = 1; + } + else if (y_root >= dragy + dragHeight) { + dragy = origy; + dragHeight = 1 + y_root - dragy; + clampTop = 0; + clampBottom = 1; + clampDY = 0; + action = 1; + } + if (clampRight) { + int delta = x_root - dragx - dragWidth; + if (dragWidth + delta < MINWIDTH) { + delta = MINWIDTH - dragWidth; + clampRight = 0; + } + dragWidth += delta; + action = 1; + } + else if (x_root >= dragx + dragWidth) { + dragx = origx; + dragWidth = 1 + x_root - origx; + clampLeft = 0; + clampRight = 1; + clampDX = 0; + action = 1; + } + + if (action) { + ConstrainSize (tmp_win, &dragWidth, &dragHeight); + if (clampLeft) + dragx = origx + origWidth - dragWidth; + if (clampTop) + dragy = origy + origHeight - dragHeight; + MoveOutline(Scr->Root, + dragx - tmp_win->frame_bw, + dragy - tmp_win->frame_bw, + dragWidth + 2 * tmp_win->frame_bw, + dragHeight + 2 * tmp_win->frame_bw, + tmp_win->frame_bw, tmp_win->title_height); + } + + DisplaySize(tmp_win, dragWidth, dragHeight); +} + + +/** + * move the rubberband around. This is called for each motion event when + * we are resizing + * + * \param x_root the X corrdinate in the root window + * \param y_root the Y corrdinate in the root window + * \param tmp_win the current twm window + */ +void +DoResize(int x_root, int y_root, TwmWindow *tmp_win) +{ + int action; + + action = 0; + + x_root -= clampDX; + y_root -= clampDY; + + if (clampTop) { + int delta = y_root - dragy; + if (dragHeight - delta < MINHEIGHT) { + delta = dragHeight - MINHEIGHT; + clampTop = 0; + } + dragy += delta; + dragHeight -= delta; + action = 1; + } + else if (y_root <= dragy/* || + y_root == findRootInfo(root)->rooty*/) { + dragy = y_root; + dragHeight = origy + origHeight - + y_root; + clampBottom = 0; + clampTop = 1; + clampDY = 0; + action = 1; + } + if (clampLeft) { + int delta = x_root - dragx; + if (dragWidth - delta < MINWIDTH) { + delta = dragWidth - MINWIDTH; + clampLeft = 0; + } + dragx += delta; + dragWidth -= delta; + action = 1; + } + else if (x_root <= dragx/* || + x_root == findRootInfo(root)->rootx*/) { + dragx = x_root; + dragWidth = origx + origWidth - + x_root; + clampRight = 0; + clampLeft = 1; + clampDX = 0; + action = 1; + } + if (clampBottom) { + int delta = y_root - dragy - dragHeight; + if (dragHeight + delta < MINHEIGHT) { + delta = MINHEIGHT - dragHeight; + clampBottom = 0; + } + dragHeight += delta; + action = 1; + } + else if (y_root >= dragy + dragHeight - 1/* || + y_root == findRootInfo(root)->rooty + + findRootInfo(root)->rootheight - 1*/) { + dragy = origy; + dragHeight = 1 + y_root - dragy; + clampTop = 0; + clampBottom = 1; + clampDY = 0; + action = 1; + } + if (clampRight) { + int delta = x_root - dragx - dragWidth; + if (dragWidth + delta < MINWIDTH) { + delta = MINWIDTH - dragWidth; + clampRight = 0; + } + dragWidth += delta; + action = 1; + } + else if (x_root >= dragx + dragWidth - 1/* || + x_root == findRootInfo(root)->rootx + + findRootInfo(root)->rootwidth - 1*/) { + dragx = origx; + dragWidth = 1 + x_root - origx; + clampLeft = 0; + clampRight = 1; + clampDX = 0; + action = 1; + } + + if (action) { + ConstrainSize (tmp_win, &dragWidth, &dragHeight); + if (clampLeft) + dragx = origx + origWidth - dragWidth; + if (clampTop) + dragy = origy + origHeight - dragHeight; + MoveOutline(Scr->Root, + dragx - tmp_win->frame_bw, + dragy - tmp_win->frame_bw, + dragWidth + 2 * tmp_win->frame_bw, + dragHeight + 2 * tmp_win->frame_bw, + tmp_win->frame_bw, tmp_win->title_height); + } + + DisplaySize(tmp_win, dragWidth, dragHeight); +} + +/** + * display the size in the dimensions window. + * + * \param tmp_win the current twm window + * \param width the width of the rubber band + * \param height the height of the rubber band + */ +void +DisplaySize(TwmWindow *tmp_win, int width, int height) +{ + char str[100]; + int dwidth; + int dheight; + + if (last_width == width && last_height == height) + return; + + last_width = width; + last_height = height; + + dheight = height - tmp_win->title_height; + dwidth = width; + + /* + * ICCCM says that PMinSize is the default is no PBaseSize is given, + * and vice-versa. + */ + if (tmp_win->hints.flags&(PMinSize|PBaseSize) && tmp_win->hints.flags & PResizeInc) + { + if (tmp_win->hints.flags & PBaseSize) { + dwidth -= tmp_win->hints.base_width; + dheight -= tmp_win->hints.base_height; + } else { + dwidth -= tmp_win->hints.min_width; + dheight -= tmp_win->hints.min_height; + } + } + + if (tmp_win->hints.flags & PResizeInc) + { + dwidth /= tmp_win->hints.width_inc; + dheight /= tmp_win->hints.height_inc; + } + + (void) sprintf (str, " %4d x %-4d ", dwidth, dheight); + XRaiseWindow(dpy, Scr->SizeWindow); + MyFont_ChangeGC(Scr->DefaultC.fore, Scr->DefaultC.back, &Scr->SizeFont); + MyFont_DrawImageString (dpy, Scr->SizeWindow, &Scr->SizeFont, + Scr->NormalGC, Scr->SizeStringOffset, + Scr->SizeFont.ascent + SIZE_VINDENT, + str, 13); +} + +/** + * finish the resize operation + */ +void +EndResize() +{ + TwmWindow *tmp_win; + +#ifdef DEBUG + fprintf(stderr, "EndResize\n"); +#endif + + MoveOutline(Scr->Root, 0, 0, 0, 0, 0, 0); + XUnmapWindow(dpy, Scr->SizeWindow); + + XFindContext(dpy, ResizeWindow, TwmContext, (caddr_t *)&tmp_win); + + ConstrainSize (tmp_win, &dragWidth, &dragHeight); + + if (dragWidth != tmp_win->frame_width || + dragHeight != tmp_win->frame_height) + tmp_win->zoomed = ZOOM_NONE; + + SetupWindow (tmp_win, dragx - tmp_win->frame_bw, dragy - tmp_win->frame_bw, + dragWidth, dragHeight, -1); + + if (tmp_win->iconmgr) + { + int ncols = tmp_win->iconmgrp->cur_columns; + if (ncols == 0) ncols = 1; + + tmp_win->iconmgrp->width = (int) ((dragWidth * + (long) tmp_win->iconmgrp->columns) + / ncols); + PackIconManager(tmp_win->iconmgrp); + } + + if (!Scr->NoRaiseResize) + XRaiseWindow(dpy, tmp_win->frame); + + UninstallRootColormap(); + + ResizeWindow = None; +} + +void +MenuEndResize(TwmWindow *tmp_win) +{ + MoveOutline(Scr->Root, 0, 0, 0, 0, 0, 0); + XUnmapWindow(dpy, Scr->SizeWindow); + ConstrainSize (tmp_win, &dragWidth, &dragHeight); + AddingX = dragx - tmp_win->frame_bw; + AddingY = dragy - tmp_win->frame_bw; + AddingW = dragWidth;/* + (2 * tmp_win->frame_bw);*/ + AddingH = dragHeight;/* + (2 * tmp_win->frame_bw);*/ + SetupWindow (tmp_win, AddingX, AddingY, AddingW, AddingH, -1); +} + + + +/** + * finish the resize operation for AddWindoframe_bw; + AddingY = dragy - tmp_win->frame_bw; + AddingW = dragWidth + (2 * tmp_win->frame_bw); + AddingH = dragHeight + (2 * tmp_win->frame_bw); +} + +/** + * adjust the given width and height to account for the constraints imposed + * by size hints. + * + * The general algorithm, especially the aspect ratio stuff, is + * borrowed from uwm's CheckConsistency routine. + */ +void +ConstrainSize (TwmWindow *tmp_win, int *widthp, int *heightp) +{ +#define makemult(a,b) ((b==1) ? (a) : (((int)((a)/(b))) * (b)) ) +#define _min(a,b) (((a) < (b)) ? (a) : (b)) + + int minWidth, minHeight, maxWidth, maxHeight, xinc, yinc, delta; + int baseWidth, baseHeight; + int dwidth = *widthp, dheight = *heightp; + + + dheight -= tmp_win->title_height; + + if (tmp_win->hints.flags & PMinSize) { + minWidth = tmp_win->hints.min_width; + minHeight = tmp_win->hints.min_height; + } else if (tmp_win->hints.flags & PBaseSize) { + minWidth = tmp_win->hints.base_width; + minHeight = tmp_win->hints.base_height; + } else + minWidth = minHeight = 1; + + if (tmp_win->hints.flags & PBaseSize) { + baseWidth = tmp_win->hints.base_width; + baseHeight = tmp_win->hints.base_height; + } else if (tmp_win->hints.flags & PMinSize) { + baseWidth = tmp_win->hints.min_width; + baseHeight = tmp_win->hints.min_height; + } else + baseWidth = baseHeight = 0; + + + if (tmp_win->hints.flags & PMaxSize) { + maxWidth = _min (Scr->MaxWindowWidth, tmp_win->hints.max_width); + maxHeight = _min (Scr->MaxWindowHeight, tmp_win->hints.max_height); + } else { + maxWidth = Scr->MaxWindowWidth; + maxHeight = Scr->MaxWindowHeight; + } + + if (tmp_win->hints.flags & PResizeInc) { + xinc = tmp_win->hints.width_inc; + yinc = tmp_win->hints.height_inc; + } else + xinc = yinc = 1; + + /* + * First, clamp to min and max values + */ + if (dwidth < minWidth) dwidth = minWidth; + if (dheight < minHeight) dheight = minHeight; + + if (dwidth > maxWidth) dwidth = maxWidth; + if (dheight > maxHeight) dheight = maxHeight; + + + /* + * Second, fit to base + N * inc + */ + dwidth = ((dwidth - baseWidth) / xinc * xinc) + baseWidth; + dheight = ((dheight - baseHeight) / yinc * yinc) + baseHeight; + + + /* + * Third, adjust for aspect ratio + */ +#define maxAspectX tmp_win->hints.max_aspect.x +#define maxAspectY tmp_win->hints.max_aspect.y +#define minAspectX tmp_win->hints.min_aspect.x +#define minAspectY tmp_win->hints.min_aspect.y + /* + * The math looks like this: + * + * minAspectX dwidth maxAspectX + * ---------- <= ------- <= ---------- + * minAspectY dheight maxAspectY + * + * If that is multiplied out, then the width and height are + * invalid in the following situations: + * + * minAspectX * dheight > minAspectY * dwidth + * maxAspectX * dheight < maxAspectY * dwidth + * + */ + + if (tmp_win->hints.flags & PAspect) + { + if (minAspectX * dheight > minAspectY * dwidth) + { + delta = makemult(minAspectX * dheight / minAspectY - dwidth, + xinc); + if (dwidth + delta <= maxWidth) dwidth += delta; + else + { + delta = makemult(dheight - dwidth*minAspectY/minAspectX, + yinc); + if (dheight - delta >= minHeight) dheight -= delta; + } + } + + if (maxAspectX * dheight < maxAspectY * dwidth) + { + delta = makemult(dwidth * maxAspectY / maxAspectX - dheight, + yinc); + if (dheight + delta <= maxHeight) dheight += delta; + else + { + delta = makemult(dwidth - maxAspectX*dheight/maxAspectY, + xinc); + if (dwidth - delta >= minWidth) dwidth -= delta; + } + } + } + + + /* + * Fourth, account for border width and title height + */ + *widthp = dwidth; + *heightp = dheight + tmp_win->title_height; +} + + +/** + * set window sizes, this was called from either AddWindow, EndResize, or + * HandleConfigureNotify. + * + * Special Considerations: + * This routine will check to make sure the window is not completely off the + * display, if it is, it'll bring some of it back on. + * + * The tmp_win->frame_XXX variables should NOT be updated with the values of + * x,y,w,h prior to calling this routine, since the new values are compared + * against the old to see whether a synthetic ConfigureNotify event should be + * sent. (It should be sent if the window was moved but not resized.) + * + * \param tmp_win the TwmWindow pointer + * \param x the x coordinate of the upper-left outer corner of the frame + * \param y the y coordinate of the upper-left outer corner of the frame + * \param w the width of the frame window w/o border + * \param h the height of the frame window w/o border + * \param bw the border width of the frame window or -1 not to change + */ +void SetupWindow (TwmWindow *tmp_win, int x, int y, int w, int h, int bw) +{ + SetupFrame (tmp_win, x, y, w, h, bw, False); +} + +/** + * \param sendEvent whether or not to force a send + */ +void SetupFrame (TwmWindow *tmp_win, int x, int y, int w, int h, int bw, Bool sendEvent) +{ + XEvent client_event; + XWindowChanges frame_wc, xwc; + unsigned long frame_mask, xwcm; + int title_width, title_height; + int reShape; + +#ifdef DEBUG + fprintf (stderr, "SetupWindow: x=%d, y=%d, w=%d, h=%d, bw=%d\n", + x, y, w, h, bw); +#endif + + if (x >= Scr->MyDisplayWidth) + x = Scr->MyDisplayWidth - 16; /* one "average" cursor width */ + if (y >= Scr->MyDisplayHeight) + y = Scr->MyDisplayHeight - 16; /* one "average" cursor width */ + if (bw < 0) + bw = tmp_win->frame_bw; /* -1 means current frame width */ + + if (tmp_win->iconmgr) { + tmp_win->iconmgrp->width = w; + h = tmp_win->iconmgrp->height + tmp_win->title_height; + } + + /* + * According to the July 27, 1988 ICCCM draft, we should send a + * "synthetic" ConfigureNotify event to the client if the window + * was moved but not resized. + */ + if (((x != tmp_win->frame_x || y != tmp_win->frame_y) && + (w == tmp_win->frame_width && h == tmp_win->frame_height)) || + (bw != tmp_win->frame_bw)) + sendEvent = TRUE; + + xwcm = CWWidth; + title_width = xwc.width = w; + title_height = Scr->TitleHeight + bw; + + ComputeWindowTitleOffsets (tmp_win, xwc.width, True); + + reShape = (tmp_win->wShaped ? TRUE : FALSE); + if (tmp_win->squeeze_info) /* check for title shaping */ + { + title_width = tmp_win->rightx + Scr->TBInfo.rightoff; + if (title_width < xwc.width) + { + xwc.width = title_width; + if (tmp_win->frame_height != h || + tmp_win->frame_width != w || + tmp_win->frame_bw != bw || + title_width != tmp_win->title_width) + reShape = TRUE; + } + else + { + if (!tmp_win->wShaped) reShape = TRUE; + title_width = xwc.width; + } + } + + tmp_win->title_width = title_width; + if (tmp_win->title_height) tmp_win->title_height = title_height; + + if (tmp_win->title_w) { + if (bw != tmp_win->frame_bw) { + xwc.border_width = bw; + tmp_win->title_x = xwc.x = -bw; + tmp_win->title_y = xwc.y = -bw; + xwcm |= (CWX | CWY | CWBorderWidth); + } + + XConfigureWindow(dpy, tmp_win->title_w, xwcm, &xwc); + } + + if (tmp_win->attr.width != w) + tmp_win->widthEverChangedByUser = True; + + if (tmp_win->attr.height != (h - tmp_win->title_height)) + tmp_win->heightEverChangedByUser = True; + + tmp_win->attr.width = w; + tmp_win->attr.height = h - tmp_win->title_height; + + XMoveResizeWindow (dpy, tmp_win->w, 0, tmp_win->title_height, + w, h - tmp_win->title_height); + + /* + * fix up frame and assign size/location values in tmp_win + */ + frame_mask = 0; + if (bw != tmp_win->frame_bw) { + frame_wc.border_width = tmp_win->frame_bw = bw; + frame_mask |= CWBorderWidth; + } + frame_wc.x = tmp_win->frame_x = x; + frame_wc.y = tmp_win->frame_y = y; + frame_wc.width = tmp_win->frame_width = w; + frame_wc.height = tmp_win->frame_height = h; + frame_mask |= (CWX | CWY | CWWidth | CWHeight); + XConfigureWindow (dpy, tmp_win->frame, frame_mask, &frame_wc); + + /* + * fix up highlight window + */ + if (tmp_win->title_height && tmp_win->hilite_w) + { + xwc.width = (tmp_win->rightx - tmp_win->highlightx); + if (Scr->TBInfo.nright > 0) xwc.width -= Scr->TitlePadding; + if (xwc.width <= 0) { + xwc.x = Scr->MyDisplayWidth; /* move offscreen */ + xwc.width = 1; + } else { + xwc.x = tmp_win->highlightx; + } + + xwcm = CWX | CWWidth; + XConfigureWindow(dpy, tmp_win->hilite_w, xwcm, &xwc); + } + + if (HasShape && reShape) { + SetFrameShape (tmp_win); + } + + if (sendEvent) + { + client_event.type = ConfigureNotify; + client_event.xconfigure.display = dpy; + client_event.xconfigure.event = tmp_win->w; + client_event.xconfigure.window = tmp_win->w; + client_event.xconfigure.x = (x + tmp_win->frame_bw - tmp_win->old_bw); + client_event.xconfigure.y = (y + tmp_win->frame_bw + + tmp_win->title_height - tmp_win->old_bw); + client_event.xconfigure.width = tmp_win->frame_width; + client_event.xconfigure.height = tmp_win->frame_height - + tmp_win->title_height; + client_event.xconfigure.border_width = tmp_win->old_bw; + /* Real ConfigureNotify events say we're above title window, so ... */ + /* what if we don't have a title ????? */ + client_event.xconfigure.above = tmp_win->frame; + client_event.xconfigure.override_redirect = False; + XSendEvent(dpy, tmp_win->w, False, StructureNotifyMask, &client_event); + } +} + + +/** + * zooms window to full height of screen or to full height and width of screen. + * (Toggles so that it can undo the zoom - even when switching between fullzoom + * and vertical zoom.) + * + * \param tmp_win the TwmWindow pointer + */ +void +fullzoom(TwmWindow *tmp_win, int flag) +{ + Window junkRoot; + unsigned int junkbw, junkDepth; + int basex, basey; + int frame_bw_times_2; + + XGetGeometry(dpy, (Drawable) tmp_win->frame, &junkRoot, + &dragx, &dragy, (unsigned int *)&dragWidth, (unsigned int *)&dragHeight, &junkbw, + &junkDepth); + + basex = 0; + basey = 0; + + if (tmp_win->zoomed == flag) + { + dragHeight = tmp_win->save_frame_height; + dragWidth = tmp_win->save_frame_width; + dragx = tmp_win->save_frame_x; + dragy = tmp_win->save_frame_y; + tmp_win->zoomed = ZOOM_NONE; + } + else + { + if (tmp_win->zoomed == ZOOM_NONE) + { + tmp_win->save_frame_x = dragx; + tmp_win->save_frame_y = dragy; + tmp_win->save_frame_width = dragWidth; + tmp_win->save_frame_height = dragHeight; + tmp_win->zoomed = flag; + } + else + tmp_win->zoomed = flag; + + + frame_bw_times_2 = 2*tmp_win->frame_bw; + + switch (flag) + { + case ZOOM_NONE: + break; + case F_ZOOM: + dragHeight = Scr->MyDisplayHeight - frame_bw_times_2; + dragy=basey; + break; + case F_HORIZOOM: + dragx = basex; + dragWidth = Scr->MyDisplayWidth - frame_bw_times_2; + break; + case F_FULLZOOM: + dragx = basex; + dragy = basey; + dragHeight = Scr->MyDisplayHeight - frame_bw_times_2; + dragWidth = Scr->MyDisplayWidth - frame_bw_times_2; + break; + case F_LEFTZOOM: + dragx = basex; + dragy = basey; + dragHeight = Scr->MyDisplayHeight - frame_bw_times_2; + dragWidth = Scr->MyDisplayWidth/2 - frame_bw_times_2; + break; + case F_RIGHTZOOM: + dragx = basex + Scr->MyDisplayWidth/2; + dragy = basey; + dragHeight = Scr->MyDisplayHeight - frame_bw_times_2; + dragWidth = Scr->MyDisplayWidth/2 - frame_bw_times_2; + break; + case F_TOPZOOM: + dragx = basex; + dragy = basey; + dragHeight = Scr->MyDisplayHeight/2 - frame_bw_times_2; + dragWidth = Scr->MyDisplayWidth - frame_bw_times_2; + break; + case F_BOTTOMZOOM: + dragx = basex; + dragy = basey + Scr->MyDisplayHeight/2; + dragHeight = Scr->MyDisplayHeight/2 - frame_bw_times_2; + dragWidth = Scr->MyDisplayWidth - frame_bw_times_2; + break; + } + } + + if (!Scr->NoRaiseResize) + XRaiseWindow(dpy, tmp_win->frame); + + ConstrainSize(tmp_win, &dragWidth, &dragHeight); + + SetupWindow (tmp_win, dragx , dragy , dragWidth, dragHeight, -1); + XUngrabPointer (dpy, CurrentTime); + XUngrabServer (dpy); +} + +void +SetFrameShape (TwmWindow *tmp) +{ + /* + * see if the titlebar needs to move + */ + if (tmp->title_w) { + int oldx = tmp->title_x, oldy = tmp->title_y; + ComputeTitleLocation (tmp); + if (oldx != tmp->title_x || oldy != tmp->title_y) + XMoveWindow (dpy, tmp->title_w, tmp->title_x, tmp->title_y); + } + + /* + * The frame consists of the shape of the contents window offset by + * title_height or'ed with the shape of title_w (which is always + * rectangular). + */ + if (tmp->wShaped) { + /* + * need to do general case + */ + XShapeCombineShape (dpy, tmp->frame, ShapeBounding, + 0, tmp->title_height, tmp->w, + ShapeBounding, ShapeSet); + if (tmp->title_w) { + XShapeCombineShape (dpy, tmp->frame, ShapeBounding, + tmp->title_x + tmp->frame_bw, + tmp->title_y + tmp->frame_bw, + tmp->title_w, ShapeBounding, + ShapeUnion); + } + } else { + /* + * can optimize rectangular contents window + */ + if (tmp->squeeze_info) { + XRectangle newBounding[2]; + XRectangle newClip[2]; + int fbw2 = 2 * tmp->frame_bw; + + /* + * Build the border clipping rectangles; one around title, one + * around window. The title_[xy] field already have had frame_bw + * subtracted off them so that they line up properly in the frame. + * + * The frame_width and frame_height do *not* include borders. + */ + /* border */ + newBounding[0].x = tmp->title_x; + newBounding[0].y = tmp->title_y; + newBounding[0].width = tmp->title_width + fbw2; + newBounding[0].height = tmp->title_height; + newBounding[1].x = -tmp->frame_bw; + newBounding[1].y = Scr->TitleHeight; + newBounding[1].width = tmp->attr.width + fbw2; + newBounding[1].height = tmp->attr.height + fbw2; + XShapeCombineRectangles (dpy, tmp->frame, ShapeBounding, 0, 0, + newBounding, 2, ShapeSet, YXBanded); + /* insides */ + newClip[0].x = tmp->title_x + tmp->frame_bw; + newClip[0].y = 0; + newClip[0].width = tmp->title_width; + newClip[0].height = Scr->TitleHeight; + newClip[1].x = 0; + newClip[1].y = tmp->title_height; + newClip[1].width = tmp->attr.width; + newClip[1].height = tmp->attr.height; + XShapeCombineRectangles (dpy, tmp->frame, ShapeClip, 0, 0, + newClip, 2, ShapeSet, YXBanded); + } else { + (void) XShapeCombineMask (dpy, tmp->frame, ShapeBounding, 0, 0, + None, ShapeSet); + (void) XShapeCombineMask (dpy, tmp->frame, ShapeClip, 0, 0, + None, ShapeSet); + } + } +} + +/* + * Squeezed Title: + * + * tmp->title_x + * 0 | + * tmp->title_y ........+--------------+......... -+,- tmp->frame_bw + * 0 : ......| +----------+ |....... : -++ + * : : | | | | : : ||-Scr->TitleHeight + * : : | | | | : : || + * +-------+ +----------+ +--------+ -+|-tmp->title_height + * | +---------------------------+ | --+ + * | | | | + * | | | | + * | | | | + * | | | | + * | | | | + * | +---------------------------+ | + * +-------------------------------+ + * + * + * Unsqueezed Title: + * + * tmp->title_x + * | 0 + * tmp->title_y +-------------------------------+ -+,tmp->frame_bw + * 0 | +---------------------------+ | -+' + * | | | | |-Scr->TitleHeight + * | | | | | + * + +---------------------------+ + -+ + * |-+---------------------------+-| + * | | | | + * | | | | + * | | | | + * | | | | + * | | | | + * | +---------------------------+ | + * +-------------------------------+ + * + * + * + * Dimensions and Positions: + * + * frame orgin (0, 0) + * frame upper left border (-tmp->frame_bw, -tmp->frame_bw) + * frame size w/o border tmp->frame_width , tmp->frame_height + * frame/title border width tmp->frame_bw + * extra title height w/o bdr tmp->title_height = TitleHeight + frame_bw + * title window height Scr->TitleHeight + * title origin w/o border (tmp->title_x, tmp->title_y) + * client origin (0, Scr->TitleHeight + tmp->frame_bw) + * client size tmp->attr.width , tmp->attr.height + * + * When shaping, need to remember that the width and height of rectangles + * are really deltax and deltay to lower right handle corner, so they need + * to have -1 subtracted from would normally be the actual extents. + */ diff --git a/app/twm/src/resize.h b/app/twm/src/resize.h new file mode 100644 index 000000000..4cee8f21b --- /dev/null +++ b/app/twm/src/resize.h @@ -0,0 +1,82 @@ +/*****************************************************************************/ +/* + +Copyright 1989, 1998 The Open Group + +Permission to use, copy, modify, distribute, and sell this software and its +documentation for any purpose is hereby granted without fee, provided that +the above copyright notice appear in all copies and that both that +copyright notice and this permission notice appear in supporting +documentation. + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the name of The Open Group shall not be +used in advertising or otherwise to promote the sale, use or other dealings +in this Software without prior written authorization from The Open Group. + +*/ +/** Copyright 1988 by Evans & Sutherland Computer Corporation, **/ +/** Salt Lake City, Utah **/ +/** Cambridge, Massachusetts **/ +/** **/ +/** All Rights Reserved **/ +/** **/ +/** Permission to use, copy, modify, and distribute this software and **/ +/** its documentation for any purpose and without fee is hereby **/ +/** granted, provided that the above copyright notice appear in all **/ +/** copies and that both that copyright notice and this permis- **/ +/** sion notice appear in supporting documentation, and that the **/ +/** name of Evans & Sutherland not be used in advertising **/ +/** in publicity pertaining to distribution of the software without **/ +/** specific, written prior permission. **/ +/** **/ +/** EVANS & SUTHERLAND DISCLAIMs ALL WARRANTIES WITH REGARD **/ +/** TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANT- **/ +/** ABILITY AND FITNESS, IN NO EVENT SHALL EVANS & SUTHERLAND **/ +/** BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAM- **/ +/** AGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA **/ +/** OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER **/ +/** TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE **/ +/** OR PERFORMANCE OF THIS SOFTWARE. **/ +/*****************************************************************************/ +/* $XFree86: xc/programs/twm/resize.h,v 1.4 2001/01/17 23:45:08 dawes Exp $ */ + + +/********************************************************************** + * + * $Xorg: resize.h,v 1.4 2001/02/09 02:05:37 xorgcvs Exp $ + * + * resize function externs + * + * 8-Apr-88 Tom LaStrange Initial Version. + * + **********************************************************************/ + +#ifndef _RESIZE_ +#define _RESIZE_ + +extern void AddEndResize ( TwmWindow *tmp_win ); +extern void AddStartResize ( TwmWindow *tmp_win, int x, int y, int w, int h ); +extern void ConstrainSize ( TwmWindow *tmp_win, int *widthp, int *heightp ); +extern void DisplaySize ( TwmWindow *tmp_win, int width, int height ); +extern void DoResize ( int x_root, int y_root, TwmWindow *tmp_win ); +extern void EndResize ( void ); +extern void fullzoom ( TwmWindow *tmp_win, int flag ); +extern void MenuDoResize ( int x_root, int y_root, TwmWindow *tmp_win ); +extern void MenuEndResize ( TwmWindow *tmp_win ); +extern void MenuStartResize ( TwmWindow *tmp_win, int x, int y, int w, int h ); +extern void SetFrameShape ( TwmWindow *tmp ); +extern void SetupFrame ( TwmWindow *tmp_win, int x, int y, int w, int h, int bw, Bool sendEvent ); +extern void SetupWindow ( TwmWindow *tmp_win, int x, int y, int w, int h, int bw ); +extern void StartResize ( XEvent *evp, TwmWindow *tmp_win, Bool fromtitlebar ); + +#endif /* _RESIZE_ */ diff --git a/app/twm/src/screen.h b/app/twm/src/screen.h new file mode 100644 index 000000000..2299262c8 --- /dev/null +++ b/app/twm/src/screen.h @@ -0,0 +1,270 @@ +/* + * +Copyright 1989, 1998 The Open Group + +Permission to use, copy, modify, distribute, and sell this software and its +documentation for any purpose is hereby granted without fee, provided that +the above copyright notice appear in all copies and that both that +copyright notice and this permission notice appear in supporting +documentation. + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the name of The Open Group shall not be +used in advertising or otherwise to promote the sale, use or other dealings +in this Software without prior written authorization from The Open Group. + * */ + +/*********************************************************************** + * + * $Xorg: screen.h,v 1.4 2001/02/09 02:05:37 xorgcvs Exp $ + * + * twm per-screen data include file + * + * 11-3-88 Dave Payne, Apple Computer File created + * + ***********************************************************************/ +/* $XFree86: xc/programs/twm/screen.h,v 1.4 2001/01/17 23:45:08 dawes Exp $ */ + +#ifndef _SCREEN_ +#define _SCREEN_ + +#include +#include +#include +#include "list.h" +#include "menus.h" +#include "iconmgr.h" + +typedef struct _StdCmap { + struct _StdCmap *next; /* next link in chain */ + Atom atom; /* property from which this came */ + int nmaps; /* number of maps below */ + XStandardColormap *maps; /* the actual maps */ +} StdCmap; + +#define SIZE_HINDENT 10 +#define SIZE_VINDENT 2 + +typedef struct _TitlebarPixmaps { + Pixmap xlogo; + Pixmap resize; + Pixmap question; + Pixmap menu; + Pixmap delete; +} TitlebarPixmaps; + +typedef struct ScreenInfo +{ + int screen; /* the default screen */ + int d_depth; /* copy of DefaultDepth(dpy, screen) */ + Visual *d_visual; /* copy of DefaultVisual(dpy, screen) */ + int Monochrome; /* is the display monochrome ? */ + int MyDisplayWidth; /* my copy of DisplayWidth(dpy, screen) */ + int MyDisplayHeight; /* my copy of DisplayHeight(dpy, screen) */ + int MaxWindowWidth; /* largest window to allow */ + int MaxWindowHeight; /* ditto */ + + TwmWindow TwmRoot; /* the head of the twm window list */ + + Window Root; /* the root window */ + Window SizeWindow; /* the resize dimensions window */ + Window InfoWindow; /* the information window */ + + name_list *Icons; /* list of icon pixmaps */ + TitlebarPixmaps tbpm; /* titlebar pixmaps */ + Pixmap UnknownPm; /* the unknown icon pixmap */ + Pixmap siconifyPm; /* the icon manager iconify pixmap */ + Pixmap pullPm; /* pull right menu icon */ + unsigned int pullW, pullH; /* size of pull right menu icon */ + Pixmap hilitePm; /* focus highlight window background */ + int hilite_pm_width, hilite_pm_height; /* cache the size */ + + MenuRoot *MenuList; /* head of the menu list */ + MenuRoot *LastMenu; /* the last menu (mostly unused?) */ + MenuRoot *Windows; /* the TwmWindows menu */ + + TwmWindow *Ring; /* one of the windows in window ring */ + TwmWindow *RingLeader; /* current winodw in ring */ + + MouseButton Mouse[MAX_BUTTONS+1][NUM_CONTEXTS][MOD_SIZE]; + MouseButton DefaultFunction; + MouseButton WindowFunction; + + struct { + Colormaps *cmaps; /* current list of colormap windows */ + int maxCmaps; /* maximum number of installed colormaps */ + unsigned long first_req; /* seq # for first XInstallColormap() req in + pass thru loading a colortable list */ + int root_pushes; /* current push level to install root + colormap windows */ + TwmWindow *pushed_window; /* saved window to install when pushes drops + to zero */ + } cmapInfo; + + struct { + StdCmap *head, *tail; /* list of maps */ + StdCmap *mru; /* most recently used in list */ + int mruindex; /* index of mru in entry */ + } StdCmapInfo; + + struct { + int nleft, nright; /* numbers of buttons in list */ + TitleButton *head; /* start of list */ + int border; /* button border */ + int pad; /* button-padding */ + int width; /* width of single button & border */ + int leftx; /* start of left buttons */ + int titlex; /* start of title string */ + int rightoff; /* offset back from right edge */ + } TBInfo; + ColorPair BorderTileC; /* border tile colors */ + ColorPair TitleC; /* titlebar colors */ + ColorPair MenuC; /* menu colors */ + ColorPair MenuTitleC; /* menu title colors */ + ColorPair IconC; /* icon colors */ + ColorPair IconManagerC; /* icon manager colors */ + XColor PointerForeground; /* pointer foreground color */ + XColor PointerBackground; /* pointer background color */ + ColorPair DefaultC; /* default colors */ + Pixel BorderColor; /* color of window borders */ + Pixel MenuShadowColor; /* menu shadow color */ + Pixel MenuBorderColor; /* menu border color */ + Pixel IconBorderColor; /* icon border color */ + Pixel IconManagerHighlight; /* icon manager highlight */ + + Cursor TitleCursor; /* title bar cursor */ + Cursor FrameCursor; /* frame cursor */ + Cursor IconCursor; /* icon cursor */ + Cursor IconMgrCursor; /* icon manager cursor */ + Cursor ButtonCursor; /* title bar button cursor */ + Cursor MoveCursor; /* move cursor */ + Cursor ResizeCursor; /* resize cursor */ + Cursor WaitCursor; /* wait a while cursor */ + Cursor MenuCursor; /* menu cursor */ + Cursor SelectCursor; /* dot cursor for f.move, etc. from menus */ + Cursor DestroyCursor; /* skull and cross bones, f.destroy */ + + name_list *BorderColorL; + name_list *IconBorderColorL; + name_list *BorderTileForegroundL; + name_list *BorderTileBackgroundL; + name_list *TitleForegroundL; + name_list *TitleBackgroundL; + name_list *IconForegroundL; + name_list *IconBackgroundL; + name_list *IconManagerFL; + name_list *IconManagerBL; + name_list *IconMgrs; + name_list *NoTitle; /* list of window names with no title bar */ + name_list *MakeTitle; /* list of window names with title bar */ + name_list *AutoRaise; /* list of window names to auto-raise */ + name_list *IconNames; /* list of window names and icon names */ + name_list *NoHighlight; /* list of windows to not highlight */ + name_list *NoStackModeL; /* windows to ignore stack mode requests */ + name_list *NoTitleHighlight;/* list of windows to not highlight the TB*/ + name_list *DontIconify; /* don't iconify by unmapping */ + name_list *IconMgrNoShow; /* don't show in the icon manager */ + name_list *IconMgrShow; /* show in the icon manager */ + name_list *IconifyByUn; /* windows to iconify by unmapping */ + name_list *StartIconified; /* windows to start iconic */ + name_list *IconManagerHighlightL; /* icon manager highlight colors */ + name_list *SqueezeTitleL; /* windows of which to squeeze title */ + name_list *DontSqueezeTitleL; /* windows of which not to squeeze */ + name_list *WindowRingL; /* windows in ring */ + name_list *WarpCursorL; /* windows to warp cursor to on deiconify */ + + GC NormalGC; /* normal GC for everything */ + GC MenuGC; /* gc for menus */ + GC DrawGC; /* GC to draw lines for move and resize */ + + unsigned long Black; + unsigned long White; + unsigned long XORvalue; /* number to use when drawing xor'ed */ + MyFont TitleBarFont; /* title bar font structure */ + MyFont MenuFont; /* menu font structure */ + MyFont IconFont; /* icon font structure */ + MyFont SizeFont; /* resize font structure */ + MyFont IconManagerFont; /* window list font structure */ + MyFont DefaultFont; + IconMgr iconmgr; /* default icon manager */ + struct IconRegion *FirstRegion; /* pointer to icon regions */ + struct IconRegion *LastRegion; /* pointer to the last icon region */ + char *IconDirectory; /* icon directory to search */ + int SizeStringOffset; /* x offset in size window for drawing */ + int SizeStringWidth; /* minimum width of size window */ + int BorderWidth; /* border width of twm windows */ + int IconBorderWidth; /* border width of icon windows */ + int MenuBorderWidth; /* border width of twm menus */ + int UnknownWidth; /* width of the unknown icon */ + int UnknownHeight; /* height of the unknown icon */ + int TitleHeight; /* height of the title bar window */ + TwmWindow *Focus; /* the twm window that has focus */ + int EntryHeight; /* menu entry height */ + int FramePadding; /* distance between decorations and border */ + int TitlePadding; /* distance between items in titlebar */ + int ButtonIndent; /* amount to shrink buttons on each side */ + int NumAutoRaises; /* number of autoraise windows on screen */ + short NoDefaults; /* do not add in default UI stuff */ + short UsePPosition; /* what do with PPosition, see values below */ + short AutoRelativeResize; /* start resize relative to position in quad */ + short FocusRoot; /* is the input focus on the root ? */ + short WarpCursor; /* warp cursor on de-iconify ? */ + short ForceIcon; /* force the icon to the user specified */ + short NoGrabServer; /* don't do server grabs */ + short NoRaiseMove; /* don't raise window following move */ + short NoRaiseResize; /* don't raise window following resize */ + short NoRaiseDeicon; /* don't raise window on deiconify */ + short NoRaiseWarp; /* don't raise window on warp */ + short DontMoveOff; /* don't allow windows to be moved off */ + short DoZoom; /* zoom in and out of icons */ + short TitleFocus; /* focus on window in title bar ? */ + short NoTitlebar; /* put title bars on windows */ + short DecorateTransients; /* put title bars on transients */ + short IconifyByUnmapping; /* simply unmap windows when iconifying */ + short ShowIconManager; /* display the window list */ + short IconManagerDontShow; /* show nothing in the icon manager */ + short BackingStore; /* use backing store for menus */ + short SaveUnder; /* use save under's for menus */ + short RandomPlacement; /* randomly place windows that no give hints */ + short OpaqueMove; /* move the window rather than outline */ + short Highlight; /* should we highlight the window borders */ + short StackMode; /* should we honor stack mode requests */ + short TitleHighlight; /* should we highlight the titlebar */ + short MoveDelta; /* number of pixels before f.move starts */ + short ZoomCount; /* zoom outline count */ + short SortIconMgr; /* sort entries in the icon manager */ + short Shadow; /* show the menu shadow */ + short InterpolateMenuColors;/* make pretty menus */ + short NoIconManagers; /* Don't create any icon managers */ + short ClientBorderWidth; /* respect client window border width */ + short SqueezeTitle; /* make title as small as possible */ + short HaveFonts; /* set if fonts have been loaded */ + short FirstTime; /* first time we've read .twmrc */ + short CaseSensitive; /* be case-sensitive when sorting names */ + short WarpUnmapped; /* allow warping to unmapped windows */ + + FuncKey FuncKeyRoot; +} ScreenInfo; + +extern int MultiScreen; +extern int NumScreens; +extern ScreenInfo **ScreenList; +extern ScreenInfo *Scr; +extern int FirstScreen; + +#define PPOS_OFF 0 +#define PPOS_ON 1 +#define PPOS_NON_ZERO 2 +/* may eventually want an option for having the PPosition be the initial + location for the drag lines */ + +#endif /* _SCREEN_ */ diff --git a/app/twm/src/session.c b/app/twm/src/session.c new file mode 100644 index 000000000..7c4ce9978 --- /dev/null +++ b/app/twm/src/session.c @@ -0,0 +1,1084 @@ +/* $Xorg: session.c,v 1.5 2001/02/09 02:05:37 xorgcvs Exp $ */ +/* $XdotOrg: app/twm/src/session.c,v 1.3 2005/07/16 22:07:13 alanc Exp $ */ +/****************************************************************************** + +Copyright 1994, 1998 The Open Group + +Permission to use, copy, modify, distribute, and sell this software and its +documentation for any purpose is hereby granted without fee, provided that +the above copyright notice appear in all copies and that both that +copyright notice and this permission notice appear in supporting +documentation. + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the name of The Open Group shall not be +used in advertising or otherwise to promote the sale, use or other dealings +in this Software without prior written authorization from The Open Group. + +Author: Ralph Mor, X Consortium +******************************************************************************/ +/* $XFree86: xc/programs/twm/session.c,v 3.8 2001/12/14 20:01:10 dawes Exp $ */ + +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif + +#include + +#ifndef X_NOT_POSIX +#ifdef _POSIX_SOURCE +#include +#else +#define _POSIX_SOURCE +#include +#undef _POSIX_SOURCE +#endif +#endif /* X_NOT_POSIX */ +#ifndef PATH_MAX +#include +#ifndef PATH_MAX +#ifdef MAXPATHLEN +#define PATH_MAX MAXPATHLEN +#else +#define PATH_MAX 1024 +#endif +#endif +#endif /* PATH_MAX */ +#ifdef HAS_MKSTEMP +#include +#endif + +#include +#include +#include +#include +#include "twm.h" +#include "screen.h" +#include "session.h" + +SmcConn smcConn = NULL; +XtInputId iceInputId; +char *twm_clientId; +TWMWinConfigEntry *winConfigHead = NULL; +Bool gotFirstSave = 0; +Bool sent_save_done = 0; + +#define SAVEFILE_VERSION 2 + +#ifndef HAS_MKSTEMP +static char *unique_filename ( char *path, char *prefix ); +#else +static char *unique_filename ( char *path, char *prefix, int *pFd ); +#endif + + +char * +GetClientID (window) + +Window window; + +{ + char *client_id = NULL; + Window client_leader; + XTextProperty tp; + Atom actual_type; + int actual_format; + unsigned long nitems; + unsigned long bytes_after; + unsigned char *prop = NULL; + + if (XGetWindowProperty (dpy, window, _XA_WM_CLIENT_LEADER, + 0L, 1L, False, AnyPropertyType, &actual_type, &actual_format, + &nitems, &bytes_after, &prop) == Success) + { + if (actual_type == XA_WINDOW && actual_format == 32 && + nitems == 1 && bytes_after == 0) + { + client_leader = *((Window *) prop); + + if (XGetTextProperty (dpy, client_leader, &tp, _XA_SM_CLIENT_ID)) + { + if (tp.encoding == XA_STRING && + tp.format == 8 && tp.nitems != 0) + client_id = (char *) tp.value; + } + } + + if (prop) + XFree (prop); + } + + return client_id; +} + + + +char * +GetWindowRole (window) + +Window window; + +{ + XTextProperty tp; + + if (XGetTextProperty (dpy, window, &tp, _XA_WM_WINDOW_ROLE)) + { + if (tp.encoding == XA_STRING && tp.format == 8 && tp.nitems != 0) + return ((char *) tp.value); + } + + return NULL; +} + + + +int +write_byte (FILE *file, unsigned char b) +{ + if (fwrite ((char *) &b, 1, 1, file) != 1) + return 0; + return 1; +} + + +int +write_ushort (FILE *file, unsigned short s) +{ + unsigned char file_short[2]; + + file_short[0] = (s & (unsigned)0xff00) >> 8; + file_short[1] = s & 0xff; + if (fwrite ((char *) file_short, (int) sizeof (file_short), 1, file) != 1) + return 0; + return 1; +} + + +int +write_short (FILE *file, short s) +{ + unsigned char file_short[2]; + + file_short[0] = (s & (unsigned)0xff00) >> 8; + file_short[1] = s & 0xff; + if (fwrite ((char *) file_short, (int) sizeof (file_short), 1, file) != 1) + return 0; + return 1; +} + + +int +write_counted_string (file, string) + +FILE *file; +char *string; + +{ + if (string) + { + unsigned char count = strlen (string); + + if (write_byte (file, count) == 0) + return 0; + if (fwrite (string, (int) sizeof (char), (int) count, file) != count) + return 0; + } + else + { + if (write_byte (file, 0) == 0) + return 0; + } + + return 1; +} + + + +int +read_byte (file, bp) + +FILE *file; +unsigned char *bp; + +{ + if (fread ((char *) bp, 1, 1, file) != 1) + return 0; + return 1; +} + + +int +read_ushort (file, shortp) + +FILE *file; +unsigned short *shortp; + +{ + unsigned char file_short[2]; + + if (fread ((char *) file_short, (int) sizeof (file_short), 1, file) != 1) + return 0; + *shortp = file_short[0] * 256 + file_short[1]; + return 1; +} + + +int +read_short (file, shortp) + +FILE *file; +short *shortp; + +{ + unsigned char file_short[2]; + + if (fread ((char *) file_short, (int) sizeof (file_short), 1, file) != 1) + return 0; + *shortp = file_short[0] * 256 + file_short[1]; + return 1; +} + + +int +read_counted_string (file, stringp) + +FILE *file; +char **stringp; + +{ + unsigned char len; + char *data; + + if (read_byte (file, &len) == 0) + return 0; + if (len == 0) { + data = 0; + } else { + data = malloc ((unsigned) len + 1); + if (!data) + return 0; + if (fread (data, (int) sizeof (char), (int) len, file) != len) { + free (data); + return 0; + } + data[len] = '\0'; + } + *stringp = data; + return 1; +} + + + +/* + * An entry in the saved window config file looks like this: + * + * FIELD BYTES + * ----- ---- + * SM_CLIENT_ID ID len 1 (may be 0) + * SM_CLIENT_ID LIST of bytes (may be NULL) + * + * WM_WINDOW_ROLE length 1 (may be 0) + * WM_WINDOW_ROLE LIST of bytes (may be NULL) + * + * if no WM_WINDOW_ROLE (length = 0) + * + * WM_CLASS "res name" length 1 + * WM_CLASS "res name" LIST of bytes + * WM_CLASS "res class" length 1 + * WM_CLASS "res class" LIST of bytes + * WM_NAME length 1 (0 if name changed) + * WM_NAME LIST of bytes + * WM_COMMAND arg count 1 (0 if no SM_CLIENT_ID) + * For each arg in WM_COMMAND + * arg length 1 + * arg LIST of bytes + * + * Iconified bool 1 + * Icon info present bool 1 + * + * if icon info present + * icon x 2 + * icon y 2 + * + * Geom x 2 + * Geom y 2 + * Geom width 2 + * Geom height 2 + * + * Width ever changed by user 1 + * Height ever changed by user 1 + */ + +int +WriteWinConfigEntry (configFile, theWindow, clientId, windowRole) + +FILE *configFile; +TwmWindow *theWindow; +char *clientId; +char *windowRole; + +{ + char **wm_command; + int wm_command_count, i; + + if (!write_counted_string (configFile, clientId)) + return 0; + + if (!write_counted_string (configFile, windowRole)) + return 0; + + if (!windowRole) + { + if (!write_counted_string (configFile, theWindow->class.res_name)) + return 0; + if (!write_counted_string (configFile, theWindow->class.res_class)) + return 0; + if (theWindow->nameChanged) + { + /* + * If WM_NAME changed on this window, we can't use it as + * a criteria for looking up window configurations. See the + * longer explanation in the GetWindowConfig() function below. + */ + + if (!write_counted_string (configFile, NULL)) + return 0; + } + else + { + if (!write_counted_string (configFile, theWindow->name)) + return 0; + } + + wm_command = NULL; + wm_command_count = 0; + XGetCommand (dpy, theWindow->w, &wm_command, &wm_command_count); + + if (clientId || !wm_command || wm_command_count == 0) + { + if (!write_byte (configFile, 0)) + return 0; + } + else + { + if (!write_byte (configFile, (char) wm_command_count)) + return 0; + for (i = 0; i < wm_command_count; i++) + if (!write_counted_string (configFile, wm_command[i])) + return 0; + XFreeStringList (wm_command); + } + } + + if (!write_byte (configFile, theWindow->icon ? 1 : 0)) /* iconified */ + return 0; + + if (!write_byte (configFile, theWindow->icon_w ? 1 : 0)) /* icon exists */ + return 0; + + if (theWindow->icon_w) + { + int icon_x, icon_y; + + XGetGeometry (dpy, theWindow->icon_w, &JunkRoot, &icon_x, + &icon_y, &JunkWidth, &JunkHeight, &JunkBW, &JunkDepth); + + if (!write_short (configFile, (short) icon_x)) + return 0; + if (!write_short (configFile, (short) icon_y)) + return 0; + } + + if (!write_short (configFile, (short) theWindow->frame_x)) + return 0; + if (!write_short (configFile, (short) theWindow->frame_y)) + return 0; + if (!write_ushort (configFile, (unsigned short) theWindow->attr.width)) + return 0; + if (!write_ushort (configFile, (unsigned short) theWindow->attr.height)) + return 0; + + if (!write_byte (configFile, theWindow->widthEverChangedByUser ? 1 : 0)) + return 0; + + if (!write_byte (configFile, theWindow->heightEverChangedByUser ? 1 : 0)) + return 0; + + return 1; +} + + +int +ReadWinConfigEntry (FILE *configFile, unsigned short version, + TWMWinConfigEntry **pentry) +{ + TWMWinConfigEntry *entry; + unsigned char byte; + int i; + + *pentry = entry = (TWMWinConfigEntry *) malloc ( + sizeof (TWMWinConfigEntry)); + if (!*pentry) + return 0; + + entry->tag = 0; + entry->client_id = NULL; + entry->window_role = NULL; + entry->class.res_name = NULL; + entry->class.res_class = NULL; + entry->wm_name = NULL; + entry->wm_command = NULL; + entry->wm_command_count = 0; + + if (!read_counted_string (configFile, &entry->client_id)) + goto give_up; + + if (!read_counted_string (configFile, &entry->window_role)) + goto give_up; + + if (!entry->window_role) + { + if (!read_counted_string (configFile, &entry->class.res_name)) + goto give_up; + if (!read_counted_string (configFile, &entry->class.res_class)) + goto give_up; + if (!read_counted_string (configFile, &entry->wm_name)) + goto give_up; + + if (!read_byte (configFile, &byte)) + goto give_up; + entry->wm_command_count = byte; + + if (entry->wm_command_count == 0) + entry->wm_command = NULL; + else + { + entry->wm_command = (char **) malloc (entry->wm_command_count * + sizeof (char *)); + + if (!entry->wm_command) + goto give_up; + + for (i = 0; i < entry->wm_command_count; i++) + if (!read_counted_string (configFile, &entry->wm_command[i])) + goto give_up; + } + } + + if (!read_byte (configFile, &byte)) + goto give_up; + entry->iconified = byte; + + if (!read_byte (configFile, &byte)) + goto give_up; + entry->icon_info_present = byte; + + if (entry->icon_info_present) + { + if (!read_short (configFile, (short *) &entry->icon_x)) + goto give_up; + if (!read_short (configFile, (short *) &entry->icon_y)) + goto give_up; + } + + if (!read_short (configFile, (short *) &entry->x)) + goto give_up; + if (!read_short (configFile, (short *) &entry->y)) + goto give_up; + if (!read_ushort (configFile, &entry->width)) + goto give_up; + if (!read_ushort (configFile, &entry->height)) + goto give_up; + + if (version > 1) + { + if (!read_byte (configFile, &byte)) + goto give_up; + entry->width_ever_changed_by_user = byte; + + if (!read_byte (configFile, &byte)) + goto give_up; + entry->height_ever_changed_by_user = byte; + } + else + { + entry->width_ever_changed_by_user = False; + entry->height_ever_changed_by_user = False; + } + + return 1; + +give_up: + + if (entry->client_id) + free (entry->client_id); + if (entry->window_role) + free (entry->window_role); + if (entry->class.res_name) + free (entry->class.res_name); + if (entry->class.res_class) + free (entry->class.res_class); + if (entry->wm_name) + free (entry->wm_name); + if (entry->wm_command_count && entry->wm_command) + { + for (i = 0; i < entry->wm_command_count; i++) + if (entry->wm_command[i]) + free (entry->wm_command[i]); + } + if (entry->wm_command) + free ((char *) entry->wm_command); + + free ((char *) entry); + *pentry = NULL; + + return 0; +} + + +void +ReadWinConfigFile (filename) + +char *filename; + +{ + FILE *configFile; + TWMWinConfigEntry *entry; + int done = 0; + unsigned short version; + + configFile = fopen (filename, "rb"); + if (!configFile) + return; + + if (!read_ushort (configFile, &version) || + version > SAVEFILE_VERSION) + { + done = 1; + } + + while (!done) + { + if (ReadWinConfigEntry (configFile, version, &entry)) + { + entry->next = winConfigHead; + winConfigHead = entry; + } + else + done = 1; + } + + fclose (configFile); +} + + + +int +GetWindowConfig (theWindow, x, y, width, height, + iconified, icon_info_present, icon_x, icon_y, + width_ever_changed_by_user, height_ever_changed_by_user) + +TwmWindow *theWindow; +short *x, *y; +unsigned short *width, *height; +Bool *iconified; +Bool *icon_info_present; +short *icon_x, *icon_y; +Bool *width_ever_changed_by_user; +Bool *height_ever_changed_by_user; + +{ + char *clientId, *windowRole; + TWMWinConfigEntry *ptr; + int found = 0; + + ptr = winConfigHead; + + if (!ptr) + return 0; + + clientId = GetClientID (theWindow->w); + windowRole = GetWindowRole (theWindow->w); + + while (ptr && !found) + { + int client_id_match = (!clientId && !ptr->client_id) || + (clientId && ptr->client_id && + strcmp (clientId, ptr->client_id) == 0); + + if (!ptr->tag && client_id_match) + { + if (windowRole || ptr->window_role) + { + found = (windowRole && ptr->window_role && + strcmp (windowRole, ptr->window_role) == 0); + } + else + { + /* + * Compare WM_CLASS + only compare WM_NAME if the + * WM_NAME in the saved file is non-NULL. If the + * WM_NAME in the saved file is NULL, this means that + * the client changed the value of WM_NAME during the + * session, and we can not use it as a criteria for + * our search. For example, with xmh, at save time + * the window name might be "xmh: folderY". However, + * if xmh does not properly restore state when it is + * restarted, the initial window name might be + * "xmh: folderX". This would cause the window manager + * to fail in finding the saved window configuration. + * The best we can do is ignore WM_NAME if its value + * changed in the previous session. + */ + + if (strcmp (theWindow->class.res_name, + ptr->class.res_name) == 0 && + strcmp (theWindow->class.res_class, + ptr->class.res_class) == 0 && + (ptr->wm_name == NULL || + strcmp (theWindow->name, ptr->wm_name) == 0)) + { + if (clientId) + { + /* + * If a client ID was present, we should not check + * WM_COMMAND because Xt will put a -xtsessionID arg + * on the command line. + */ + + found = 1; + } + else + { + /* + * For non-XSMP clients, also check WM_COMMAND. + */ + + char **wm_command = NULL; + int wm_command_count = 0, i; + + XGetCommand (dpy, theWindow->w, + &wm_command, &wm_command_count); + + if (wm_command_count == ptr->wm_command_count) + { + for (i = 0; i < wm_command_count; i++) + if (strcmp (wm_command[i], + ptr->wm_command[i]) != 0) + break; + + if (i == wm_command_count) + found = 1; + } + } + } + } + } + + if (!found) + ptr = ptr->next; + } + + if (found) + { + *x = ptr->x; + *y = ptr->y; + *width = ptr->width; + *height = ptr->height; + *iconified = ptr->iconified; + *icon_info_present = ptr->icon_info_present; + *width_ever_changed_by_user = ptr->width_ever_changed_by_user; + *height_ever_changed_by_user = ptr->height_ever_changed_by_user; + + if (*icon_info_present) + { + *icon_x = ptr->icon_x; + *icon_y = ptr->icon_y; + } + ptr->tag = 1; + } + else + *iconified = 0; + + if (clientId) + XFree (clientId); + + if (windowRole) + XFree (windowRole); + + return found; +} + + + +#ifndef HAS_MKSTEMP +static char * +unique_filename (path, prefix) +char *path; +char *prefix; +#else +static char * +unique_filename (path, prefix, pFd) +char *path; +char *prefix; +int *pFd; +#endif + +{ +#ifndef HAS_MKSTEMP +#ifndef X_NOT_POSIX + return ((char *) tempnam (path, prefix)); +#else + char tempFile[PATH_MAX]; + char *tmp; + + sprintf (tempFile, "%s/%sXXXXXX", path, prefix); + tmp = (char *) mktemp (tempFile); + if (tmp) + { + char *ptr = (char *) malloc (strlen (tmp) + 1); + strcpy (ptr, tmp); + return (ptr); + } + else + return (NULL); +#endif +#else + char tempFile[PATH_MAX]; + char *ptr; + + sprintf (tempFile, "%s/%sXXXXXX", path, prefix); + ptr = (char *)malloc(strlen(tempFile) + 1); + if (ptr != NULL) + { + strcpy(ptr, tempFile); + *pFd = mkstemp(ptr); + } + return ptr; +#endif +} + + + +void +SaveYourselfPhase2CB (smcConn, clientData) + +SmcConn smcConn; +SmPointer clientData; + +{ + int scrnum; + ScreenInfo *theScreen; + TwmWindow *theWindow; + char *clientId, *windowRole; + FILE *configFile = NULL; + char *path; + char *filename = NULL; + Bool success = False; + SmProp prop1, prop2, prop3, *props[3]; + SmPropValue prop1val, prop2val, prop3val; + char discardCommand[80]; + int numVals, i; + static int first_time = 1; +#ifdef HAS_MKSTEMP + int fd; +#endif + + if (first_time) + { + char userId[20]; + char hint = SmRestartIfRunning; + + prop1.name = SmProgram; + prop1.type = SmARRAY8; + prop1.num_vals = 1; + prop1.vals = &prop1val; + prop1val.value = Argv[0]; + prop1val.length = strlen (Argv[0]); + + sprintf (userId, "%ld", (long)getuid()); + prop2.name = SmUserID; + prop2.type = SmARRAY8; + prop2.num_vals = 1; + prop2.vals = &prop2val; + prop2val.value = (SmPointer) userId; + prop2val.length = strlen (userId); + + prop3.name = SmRestartStyleHint; + prop3.type = SmCARD8; + prop3.num_vals = 1; + prop3.vals = &prop3val; + prop3val.value = (SmPointer) &hint; + prop3val.length = 1; + + props[0] = &prop1; + props[1] = &prop2; + props[2] = &prop3; + + SmcSetProperties (smcConn, 3, props); + + first_time = 0; + } + + path = getenv ("SM_SAVE_DIR"); + if (!path) + { + path = getenv ("HOME"); + if (!path) + path = "."; + } +#ifndef HAS_MKSTEMP + if ((filename = unique_filename (path, ".twm")) == NULL) + goto bad; + + if (!(configFile = fopen (filename, "wb"))) + goto bad; +#else + if ((filename = unique_filename (path, ".twm", &fd)) == NULL) + goto bad; + + if (!(configFile = fdopen(fd, "wb"))) + goto bad; +#endif + + if (!write_ushort (configFile, SAVEFILE_VERSION)) + goto bad; + + success = True; + + for (scrnum = 0; scrnum < NumScreens && success; scrnum++) + { + if (ScreenList[scrnum] != NULL) + { + theScreen = ScreenList[scrnum]; + theWindow = theScreen->TwmRoot.next; + + while (theWindow && success) + { + clientId = GetClientID (theWindow->w); + windowRole = GetWindowRole (theWindow->w); + + if (!WriteWinConfigEntry (configFile, theWindow, + clientId, windowRole)) + success = False; + + if (clientId) + XFree (clientId); + + if (windowRole) + XFree (windowRole); + + theWindow = theWindow->next; + } + } + } + + prop1.name = SmRestartCommand; + prop1.type = SmLISTofARRAY8; + + prop1.vals = (SmPropValue *) malloc ( + (Argc + 4) * sizeof (SmPropValue)); + + if (!prop1.vals) + { + success = False; + goto bad; + } + + numVals = 0; + + for (i = 0; i < Argc; i++) + { + if (strcmp (Argv[i], "-clientId") == 0 || + strcmp (Argv[i], "-restore") == 0) + { + i++; + } + else + { + prop1.vals[numVals].value = (SmPointer) Argv[i]; + prop1.vals[numVals++].length = strlen (Argv[i]); + } + } + + prop1.vals[numVals].value = (SmPointer) "-clientId"; + prop1.vals[numVals++].length = 9; + + prop1.vals[numVals].value = (SmPointer) twm_clientId; + prop1.vals[numVals++].length = strlen (twm_clientId); + + prop1.vals[numVals].value = (SmPointer) "-restore"; + prop1.vals[numVals++].length = 8; + + prop1.vals[numVals].value = (SmPointer) filename; + prop1.vals[numVals++].length = strlen (filename); + + prop1.num_vals = numVals; + + sprintf (discardCommand, "rm %s", filename); + prop2.name = SmDiscardCommand; + prop2.type = SmARRAY8; + prop2.num_vals = 1; + prop2.vals = &prop2val; + prop2val.value = (SmPointer) discardCommand; + prop2val.length = strlen (discardCommand); + + props[0] = &prop1; + props[1] = &prop2; + + SmcSetProperties (smcConn, 2, props); + free ((char *) prop1.vals); + + bad: + SmcSaveYourselfDone (smcConn, success); + sent_save_done = 1; + + if (configFile) + fclose (configFile); + + if (filename) + free (filename); +} + + + +void +SaveYourselfCB (smcConn, clientData, saveType, shutdown, interactStyle, fast) + +SmcConn smcConn; +SmPointer clientData; +int saveType; +Bool shutdown; +int interactStyle; +Bool fast; + +{ + if (!SmcRequestSaveYourselfPhase2 (smcConn, SaveYourselfPhase2CB, NULL)) + { + SmcSaveYourselfDone (smcConn, False); + sent_save_done = 1; + } + else + sent_save_done = 0; +} + + + +void +DieCB (smcConn, clientData) + +SmcConn smcConn; +SmPointer clientData; + +{ + SmcCloseConnection (smcConn, 0, NULL); + XtRemoveInput (iceInputId); + Done(NULL, NULL); +} + + + +void +SaveCompleteCB (smcConn, clientData) + +SmcConn smcConn; +SmPointer clientData; + +{ + ; +} + + + +void +ShutdownCancelledCB (smcConn, clientData) + +SmcConn smcConn; +SmPointer clientData; + +{ + if (!sent_save_done) + { + SmcSaveYourselfDone (smcConn, False); + sent_save_done = 1; + } +} + + + +void +ProcessIceMsgProc (client_data, source, id) + +XtPointer client_data; +int *source; +XtInputId *id; + +{ + IceConn ice_conn = (IceConn) client_data; + + IceProcessMessages (ice_conn, NULL, NULL); +} + + + +void +ConnectToSessionManager (previous_id) + +char *previous_id; + +{ + char errorMsg[256]; + unsigned long mask; + SmcCallbacks callbacks; + IceConn iceConn; + + mask = SmcSaveYourselfProcMask | SmcDieProcMask | + SmcSaveCompleteProcMask | SmcShutdownCancelledProcMask; + + callbacks.save_yourself.callback = SaveYourselfCB; + callbacks.save_yourself.client_data = (SmPointer) NULL; + + callbacks.die.callback = DieCB; + callbacks.die.client_data = (SmPointer) NULL; + + callbacks.save_complete.callback = SaveCompleteCB; + callbacks.save_complete.client_data = (SmPointer) NULL; + + callbacks.shutdown_cancelled.callback = ShutdownCancelledCB; + callbacks.shutdown_cancelled.client_data = (SmPointer) NULL; + + smcConn = SmcOpenConnection ( + NULL, /* use SESSION_MANAGER env */ + (SmPointer) appContext, + SmProtoMajor, + SmProtoMinor, + mask, + &callbacks, + previous_id, + &twm_clientId, + 256, errorMsg); + + if (smcConn == NULL) + return; + + iceConn = SmcGetIceConnection (smcConn); + + iceInputId = XtAppAddInput ( + appContext, + IceConnectionNumber (iceConn), + (XtPointer) XtInputReadMask, + ProcessIceMsgProc, + (XtPointer) iceConn); +} + + + diff --git a/app/twm/src/session.h b/app/twm/src/session.h new file mode 100644 index 000000000..cc59a7db0 --- /dev/null +++ b/app/twm/src/session.h @@ -0,0 +1,55 @@ +/* $XFree86: xc/programs/twm/session.h,v 1.1 1999/02/20 14:55:52 hohndel Exp $ */ +/* + * Copyright (C) 1998 The XFree86 Project, Inc. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to + * deal in the Software without restriction, including without limitation the + * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + * sell copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * XFREE86 PROJECT BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * + * Except as contained in this notice, the name of the XFree86 Project shall + * not be used in advertising or otherwise to promote the sale, use or other + * dealings in this Software without prior written authorization from the + * XFree86 Project. + */ +#ifndef _SESSION_H +#define _SESSION_H +#include + +extern void ConnectToSessionManager ( char *previous_id ); +extern void DieCB ( SmcConn smcConn, SmPointer clientData ); +extern char * GetClientID ( Window window ); +extern int GetWindowConfig ( TwmWindow *theWindow, short *x, short *y, unsigned short *width, unsigned short *height, Bool *iconified, Bool *icon_info_present, short *icon_x, short *icon_y, Bool *width_ever_changed_by_user, Bool *height_ever_changed_by_user ); +extern char * GetWindowRole ( Window window ); +extern void ProcessIceMsgProc ( XtPointer client_data, int *source, XtInputId *id ); +extern int ReadWinConfigEntry ( FILE *configFile, unsigned short version, TWMWinConfigEntry **pentry ); +extern void ReadWinConfigFile ( char *filename ); +extern int read_byte ( FILE *file, unsigned char *bp ); +extern int read_counted_string ( FILE *file, char **stringp ); +extern int read_short ( FILE *file, short *shortp ); +extern int read_ushort ( FILE *file, unsigned short *shortp ); +extern void SaveCompleteCB ( SmcConn smcConn, SmPointer clientData ); +extern void SaveYourselfCB ( SmcConn smcConn, SmPointer clientData, int saveType, Bool shutdown, int interactStyle, Bool fast ); +extern void SaveYourselfPhase2CB ( SmcConn smcConn, SmPointer clientData ); +extern void ShutdownCancelledCB ( SmcConn smcConn, SmPointer clientData ); +extern int WriteWinConfigEntry ( FILE *configFile, TwmWindow *theWindow, char *clientId, char *windowRole ); +extern int write_byte ( FILE *file, unsigned char b ); +extern int write_counted_string ( FILE *file, char *string ); +extern int write_short ( FILE *file, short s ); +extern int write_ushort ( FILE *file, unsigned short s ); + +extern SmcConn smcConn; + +#endif diff --git a/app/twm/src/siconify.bm b/app/twm/src/siconify.bm new file mode 100644 index 000000000..d6402b6d6 --- /dev/null +++ b/app/twm/src/siconify.bm @@ -0,0 +1,5 @@ +#define siconify_width 11 +#define siconify_height 11 +static unsigned char siconify_bits[] = { + 0xff, 0x07, 0x01, 0x04, 0x0d, 0x05, 0x9d, 0x05, 0xb9, 0x04, 0x51, 0x04, + 0xe9, 0x04, 0xcd, 0x05, 0x85, 0x05, 0x01, 0x04, 0xff, 0x07}; diff --git a/app/twm/src/system.twmrc b/app/twm/src/system.twmrc new file mode 100644 index 000000000..740a1e925 --- /dev/null +++ b/app/twm/src/system.twmrc @@ -0,0 +1,94 @@ +# +# $Xorg: system.twmrc,v 1.3 2000/08/17 19:54:08 cpqbld Exp $ +# +# Default twm configuration file; needs to be kept small to conserve string +# space in systems whose compilers don't handle medium-sized strings. +# +# Sites should tailor this file, providing any extra title buttons, menus, etc. +# that may be appropriate for their environment. For example, if most of the +# users were accustomed to uwm, the defaults could be set up not to decorate +# any windows and to use meta-keys. +# +# $XFree86: xc/programs/twm/system.twmrc,v 1.4 2001/01/17 23:45:08 dawes Exp $ +# + +NoGrabServer +RestartPreviousState +DecorateTransients +TitleFont "-adobe-helvetica-bold-r-normal--*-120-*-*-*-*-*-*" +ResizeFont "-adobe-helvetica-bold-r-normal--*-120-*-*-*-*-*-*" +MenuFont "-adobe-helvetica-bold-r-normal--*-120-*-*-*-*-*-*" +IconFont "-adobe-helvetica-bold-r-normal--*-100-*-*-*-*-*-*" +IconManagerFont "-adobe-helvetica-bold-r-normal--*-100-*-*-*" +#ClientBorderWidth + +Color +{ + BorderColor "slategrey" + DefaultBackground "rgb:2/a/9" + DefaultForeground "gray85" + TitleBackground "rgb:2/a/9" + TitleForeground "gray85" + MenuBackground "rgb:2/a/9" + MenuForeground "gray85" + MenuBorderColor "slategrey" + MenuTitleBackground "gray70" + MenuTitleForeground "rgb:2/a/9" + IconBackground "rgb:2/a/9" + IconForeground "gray85" + IconBorderColor "gray85" + IconManagerBackground "rgb:2/a/9" + IconManagerForeground "gray85" +} + +# +# Define some useful functions for motion-based actions. +# +MoveDelta 3 +Function "move-or-lower" { f.move f.deltastop f.lower } +Function "move-or-raise" { f.move f.deltastop f.raise } +Function "move-or-iconify" { f.move f.deltastop f.iconify } + +# +# Set some useful bindings. Sort of uwm-ish, sort of simple-button-ish +# +Button1 = : root : f.menu "defops" + +Button1 = m : window|icon : f.function "move-or-lower" +Button2 = m : window|icon : f.iconify +Button3 = m : window|icon : f.function "move-or-raise" + +Button1 = : title : f.function "move-or-raise" +Button2 = : title : f.raiselower + +Button1 = : icon : f.function "move-or-iconify" +Button2 = : icon : f.iconify + +Button1 = : iconmgr : f.iconify +Button2 = : iconmgr : f.iconify + +# +# And a menus with the usual things +# +menu "defops" +{ +"Twm" f.title +"Iconify" f.iconify +"Resize" f.resize +"Move" f.move +"Raise" f.raise +"Lower" f.lower +"" f.nop +"Focus" f.focus +"Unfocus" f.unfocus +"Show Iconmgr" f.showiconmgr +"Hide Iconmgr" f.hideiconmgr +"" f.nop +"Xterm" f.exec "exec xterm &" +"" f.nop +"Kill" f.destroy +"Delete" f.delete +"" f.nop +"Restart" f.restart +"Exit" f.quit +} diff --git a/app/twm/src/twm.c b/app/twm/src/twm.c new file mode 100644 index 000000000..f0f645ef8 --- /dev/null +++ b/app/twm/src/twm.c @@ -0,0 +1,976 @@ +/*****************************************************************************/ +/* + +Copyright 1989, 1998 The Open Group +Copyright 2005 Hitachi, Ltd. + +Permission to use, copy, modify, distribute, and sell this software and its +documentation for any purpose is hereby granted without fee, provided that +the above copyright notice appear in all copies and that both that +copyright notice and this permission notice appear in supporting +documentation. + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the name of The Open Group shall not be +used in advertising or otherwise to promote the sale, use or other dealings +in this Software without prior written authorization from The Open Group. + +*/ +/** Copyright 1988 by Evans & Sutherland Computer Corporation, **/ +/** Salt Lake City, Utah **/ +/** Cambridge, Massachusetts **/ +/** **/ +/** All Rights Reserved **/ +/** **/ +/** Permission to use, copy, modify, and distribute this software and **/ +/** its documentation for any purpose and without fee is hereby **/ +/** granted, provided that the above copyright notice appear in all **/ +/** copies and that both that copyright notice and this permis- **/ +/** sion notice appear in supporting documentation, and that the **/ +/** name of Evans & Sutherland not be used in advertising **/ +/** in publicity pertaining to distribution of the software without **/ +/** specific, written prior permission. **/ +/** **/ +/** EVANS & SUTHERLAND DISCLAIMs ALL WARRANTIES WITH REGARD **/ +/** TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANT- **/ +/** ABILITY AND FITNESS, IN NO EVENT SHALL EVANS & SUTHERLAND **/ +/** BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAM- **/ +/** AGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA **/ +/** OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER **/ +/** TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE **/ +/** OR PERFORMANCE OF THIS SOFTWARE. **/ +/*****************************************************************************/ + + +/*********************************************************************** + * + * $Xorg: twm.c,v 1.5 2001/02/09 02:05:37 xorgcvs Exp $ + * + * twm - "Tom's Window Manager" + * + * 27-Oct-1987 Thomas E. LaStrange File created + * 10-Oct-1990 David M. Sternlicht Storing saved colors on root + * 19-Feb-2005 Julien Lafon Handle print screens for unified Xserver + ***********************************************************************/ +/* $XFree86: xc/programs/twm/twm.c,v 3.13 2003/04/21 08:15:10 herrb Exp $ */ + +#include +#include +#include +#include "twm.h" +#include "iconmgr.h" +#include "add_window.h" +#include "gc.h" +#include "parse.h" +#include "version.h" +#include "menus.h" +#include "events.h" +#include "util.h" +#include "gram.h" +#include "screen.h" +#include "parse.h" +#include "session.h" +#include +#include +#include +#include +#include +#include +#ifdef XPRINT +#include +#endif /* XPRINT */ + +XtAppContext appContext; /* Xt application context */ +XtSignalId si; + +Display *dpy = NULL; /* which display are we talking to */ +Window ResizeWindow; /* the window we are resizing */ + +int MultiScreen = TRUE; /* try for more than one screen? */ +int NoPrintscreens = False; /* ignore special handling of print screens? */ +int NumScreens; /* number of screens in ScreenList */ +int HasShape; /* server supports shape extension? */ +int ShapeEventBase, ShapeErrorBase; +int HasSync; /* server supports SYNC extension? */ +int SyncEventBase, SyncErrorBase; +ScreenInfo **ScreenList; /* structures for each screen */ +ScreenInfo *Scr = NULL; /* the cur and prev screens */ +int PreviousScreen; /* last screen that we were on */ +int FirstScreen; /* TRUE ==> first screen of display */ +Bool PrintErrorMessages = False; /* controls error messages */ +static int RedirectError; /* TRUE ==> another window manager running */ +static int TwmErrorHandler ( Display *dpy, XErrorEvent *event ); /* for settting RedirectError */ +static int CatchRedirectError ( Display *dpy, XErrorEvent *event ); /* for everything else */ +static SIGNAL_T sigHandler(int); +char Info[INFO_LINES][INFO_SIZE]; /* info strings to print */ +int InfoLines; +char *InitFile = NULL; + +Cursor UpperLeftCursor; /* upper Left corner cursor */ +Cursor RightButt; +Cursor MiddleButt; +Cursor LeftButt; + +XContext TwmContext; /* context for twm windows */ +XContext MenuContext; /* context for all menu windows */ +XContext IconManagerContext; /* context for all window list windows */ +XContext ScreenContext; /* context to get screen data */ +XContext ColormapContext; /* context for colormap operations */ + +XClassHint NoClass; /* for applications with no class */ + +XGCValues Gcv; + +char *Home; /* the HOME environment variable */ +int HomeLen; /* length of Home */ +int ParseError; /* error parsing the .twmrc file */ + +int HandlingEvents = FALSE; /* are we handling events yet? */ + +Window JunkRoot; /* junk window */ +Window JunkChild; /* junk window */ +int JunkX; /* junk variable */ +int JunkY; /* junk variable */ +unsigned int JunkWidth, JunkHeight, JunkBW, JunkDepth, JunkMask; + +char *ProgramName; +int Argc; +char **Argv; + +Bool RestartPreviousState = False; /* try to restart in previous state */ + +unsigned long black, white; + +Atom TwmAtoms[11]; + +Bool use_fontset; /* use XFontSet-related functions or not */ + +/* don't change the order of these strings */ +static char* atom_names[11] = { + "_MIT_PRIORITY_COLORS", + "WM_CHANGE_STATE", + "WM_STATE", + "WM_COLORMAP_WINDOWS", + "WM_PROTOCOLS", + "WM_TAKE_FOCUS", + "WM_SAVE_YOURSELF", + "WM_DELETE_WINDOW", + "SM_CLIENT_ID", + "WM_CLIENT_LEADER", + "WM_WINDOW_ROLE" +}; + +#ifdef XPRINT +/* |hasExtension()| and |IsPrintScreen()| have been stolen from + * xc/programs/xdpyinfo/xdpyinfo.c */ +static +Bool hasExtension(Display *dpy, char *extname) +{ + int num_extensions, + i; + char **extensions; + extensions = XListExtensions(dpy, &num_extensions); + for (i = 0; i < num_extensions && + (strcmp(extensions[i], extname) != 0); i++); + XFreeExtensionList(extensions); + return i != num_extensions; +} + +static +Bool IsPrintScreen(Screen *s) +{ + Display *dpy = XDisplayOfScreen(s); + int i; + + /* Check whether this is a screen of a print DDX */ + if (hasExtension(dpy, XP_PRINTNAME)) { + Screen **pscreens; + int pscrcount; + + pscreens = XpQueryScreens(dpy, &pscrcount); + for( i = 0 ; (i < pscrcount) && pscreens ; i++ ) { + if (s == pscreens[i]) { + return True; + } + } + XFree(pscreens); + } + return False; +} +#endif /* XPRINT */ + +/*********************************************************************** + * + * Procedure: + * main - start of twm + * + *********************************************************************** + */ + +int +main(int argc, char *argv[]) +{ + Window root, parent, *children; + unsigned int nchildren; + int i, j; + char *display_name = NULL; + unsigned long valuemask; /* mask for create windows */ + XSetWindowAttributes attributes; /* attributes for create windows */ + int numManaged, firstscrn, lastscrn, scrnum; + int zero = 0; + char *restore_filename = NULL; + char *client_id = NULL; + char *loc; + + ProgramName = argv[0]; + Argc = argc; + Argv = argv; + + for (i = 1; i < argc; i++) { + if (argv[i][0] == '-') { + switch (argv[i][1]) { + case 'd': /* -display dpy */ + if (strcmp(&argv[i][1], "display")) goto usage; + if (++i >= argc) goto usage; + display_name = argv[i]; + continue; + case 's': /* -single */ + MultiScreen = FALSE; + continue; +#ifdef XPRINT + case 'n': /* -noprint */ + if (strcmp(&argv[i][1], "noprint")) goto usage; + NoPrintscreens = True; + continue; +#endif /* XPRINT */ + case 'f': /* -file twmrcfilename */ + if (++i >= argc) goto usage; + InitFile = argv[i]; + continue; + case 'v': /* -verbose */ + PrintErrorMessages = True; + continue; + case 'c': /* -clientId */ + if (strcmp(&argv[i][1], "clientId")) goto usage; + if (++i >= argc) goto usage; + client_id = argv[i]; + continue; + case 'r': /* -restore */ + if (strcmp(&argv[i][1], "restore")) goto usage; + if (++i >= argc) goto usage; + restore_filename = argv[i]; + continue; + case 'q': /* -quiet */ + PrintErrorMessages = False; + continue; + } + } + usage: + fprintf (stderr, + "usage: %s [-display dpy] [-f file] [-s] [-q] [-v]" +#ifdef XPRINT + " [-noprint]" +#endif /* XPRINT */ + " [-clientId id] [-restore file]\n", + ProgramName); + exit (1); + } + + loc = setlocale(LC_ALL, ""); + if (!loc || !strcmp(loc, "C") || !strcmp(loc, "POSIX") || + !XSupportsLocale()) { + use_fontset = False; + } else { + use_fontset = True; + } + +#define newhandler(sig) \ + if (signal (sig, SIG_IGN) != SIG_IGN) (void) signal (sig, sigHandler) + + + newhandler (SIGINT); + newhandler (SIGHUP); + newhandler (SIGQUIT); + newhandler (SIGTERM); + +#undef newhandler + + Home = getenv("HOME"); + if (Home != NULL) { + char *temp_p; + + /* + * Make a copy of Home because the string returned by getenv() can be + * overwritten by some POSIX.1 and ANSI-C implementations of getenv() + * when further calls to getenv() are made + */ + + temp_p = strdup(Home); + Home = temp_p; + } + + if (Home == NULL) + Home = "./"; + + HomeLen = strlen(Home); + + NoClass.res_name = NoName; + NoClass.res_class = NoName; + + XtToolkitInitialize (); + appContext = XtCreateApplicationContext (); + + si = XtAppAddSignal(appContext, Done, NULL); + + if (!(dpy = XtOpenDisplay (appContext, display_name, "twm", "twm", + NULL, 0, &zero, NULL))) { + fprintf (stderr, "%s: unable to open display \"%s\"\n", + ProgramName, XDisplayName(display_name)); + exit (1); + } + + if (fcntl(ConnectionNumber(dpy), F_SETFD, 1) == -1) { + fprintf (stderr, + "%s: unable to mark display connection as close-on-exec\n", + ProgramName); + exit (1); + } + + if (restore_filename) + ReadWinConfigFile (restore_filename); + + HasShape = XShapeQueryExtension (dpy, &ShapeEventBase, &ShapeErrorBase); + HasSync = XSyncQueryExtension(dpy, &SyncEventBase, &SyncErrorBase); + TwmContext = XUniqueContext(); + MenuContext = XUniqueContext(); + IconManagerContext = XUniqueContext(); + ScreenContext = XUniqueContext(); + ColormapContext = XUniqueContext(); + + (void) XInternAtoms(dpy, atom_names, sizeof TwmAtoms / sizeof TwmAtoms[0], + False, TwmAtoms); + + /* Set up the per-screen global information. */ + + NumScreens = ScreenCount(dpy); + + if (MultiScreen) + { + firstscrn = 0; + lastscrn = NumScreens - 1; + } + else + { + firstscrn = lastscrn = DefaultScreen(dpy); + } + + InfoLines = 0; + + /* for simplicity, always allocate NumScreens ScreenInfo struct pointers */ + ScreenList = (ScreenInfo **) calloc (NumScreens, sizeof (ScreenInfo *)); + if (ScreenList == NULL) + { + fprintf (stderr, "%s: Unable to allocate memory for screen list, exiting.\n", + ProgramName); + exit (1); + } + numManaged = 0; + PreviousScreen = DefaultScreen(dpy); + FirstScreen = TRUE; + for (scrnum = firstscrn ; scrnum <= lastscrn; scrnum++) + { +#ifdef XPRINT + /* Ignore print screens to avoid that users accidentally warp on a + * print screen (which are not visible on video displays) */ + if ((!NoPrintscreens) && IsPrintScreen(XScreenOfDisplay(dpy, scrnum))) + { + fprintf (stderr, "%s: skipping print screen %d\n", + ProgramName, scrnum); + continue; + } +#endif /* XPRINT */ + + /* Make sure property priority colors is empty */ + XChangeProperty (dpy, RootWindow(dpy, scrnum), _XA_MIT_PRIORITY_COLORS, + XA_CARDINAL, 32, PropModeReplace, NULL, 0); + RedirectError = FALSE; + XSetErrorHandler(CatchRedirectError); + XSelectInput(dpy, RootWindow (dpy, scrnum), + ColormapChangeMask | EnterWindowMask | PropertyChangeMask | + SubstructureRedirectMask | KeyPressMask | + ButtonPressMask | ButtonReleaseMask); + XSync(dpy, 0); + XSetErrorHandler(TwmErrorHandler); + + if (RedirectError) + { + fprintf (stderr, "%s: another window manager is already running.", + ProgramName); + if (MultiScreen && NumScreens > 0) + fprintf(stderr, " on screen %d?\n", scrnum); + else + fprintf(stderr, "?\n"); + continue; + } + + numManaged ++; + + /* Note: ScreenInfo struct is calloc'ed to initialize to zero. */ + Scr = ScreenList[scrnum] = + (ScreenInfo *) calloc(1, sizeof(ScreenInfo)); + if (Scr == NULL) + { + fprintf (stderr, "%s: unable to allocate memory for ScreenInfo structure for screen %d.\n", + ProgramName, scrnum); + continue; + } + + /* initialize list pointers, remember to put an initialization + * in InitVariables also + */ + Scr->BorderColorL = NULL; + Scr->IconBorderColorL = NULL; + Scr->BorderTileForegroundL = NULL; + Scr->BorderTileBackgroundL = NULL; + Scr->TitleForegroundL = NULL; + Scr->TitleBackgroundL = NULL; + Scr->IconForegroundL = NULL; + Scr->IconBackgroundL = NULL; + Scr->NoTitle = NULL; + Scr->MakeTitle = NULL; + Scr->AutoRaise = NULL; + Scr->IconNames = NULL; + Scr->NoHighlight = NULL; + Scr->NoStackModeL = NULL; + Scr->NoTitleHighlight = NULL; + Scr->DontIconify = NULL; + Scr->IconMgrNoShow = NULL; + Scr->IconMgrShow = NULL; + Scr->IconifyByUn = NULL; + Scr->IconManagerFL = NULL; + Scr->IconManagerBL = NULL; + Scr->IconMgrs = NULL; + Scr->StartIconified = NULL; + Scr->SqueezeTitleL = NULL; + Scr->DontSqueezeTitleL = NULL; + Scr->WindowRingL = NULL; + Scr->WarpCursorL = NULL; + /* remember to put an initialization in InitVariables also + */ + + Scr->screen = scrnum; + Scr->d_depth = DefaultDepth(dpy, scrnum); + Scr->d_visual = DefaultVisual(dpy, scrnum); + Scr->Root = RootWindow(dpy, scrnum); + XSaveContext (dpy, Scr->Root, ScreenContext, (caddr_t) Scr); + + Scr->TwmRoot.cmaps.number_cwins = 1; + Scr->TwmRoot.cmaps.cwins = + (ColormapWindow **) malloc(sizeof(ColormapWindow *)); + Scr->TwmRoot.cmaps.cwins[0] = + CreateColormapWindow(Scr->Root, True, False); + Scr->TwmRoot.cmaps.cwins[0]->visibility = VisibilityPartiallyObscured; + + Scr->cmapInfo.cmaps = NULL; + Scr->cmapInfo.maxCmaps = + MaxCmapsOfScreen(ScreenOfDisplay(dpy, Scr->screen)); + Scr->cmapInfo.root_pushes = 0; + InstallWindowColormaps(0, &Scr->TwmRoot); + + Scr->StdCmapInfo.head = Scr->StdCmapInfo.tail = + Scr->StdCmapInfo.mru = NULL; + Scr->StdCmapInfo.mruindex = 0; + LocateStandardColormaps(); + + Scr->TBInfo.nleft = Scr->TBInfo.nright = 0; + Scr->TBInfo.head = NULL; + Scr->TBInfo.border = 1; + Scr->TBInfo.width = 0; + Scr->TBInfo.leftx = 0; + Scr->TBInfo.titlex = 0; + + Scr->MyDisplayWidth = DisplayWidth(dpy, scrnum); + Scr->MyDisplayHeight = DisplayHeight(dpy, scrnum); + Scr->MaxWindowWidth = 32767 - Scr->MyDisplayWidth; + Scr->MaxWindowHeight = 32767 - Scr->MyDisplayHeight; + + Scr->XORvalue = (((unsigned long) 1) << Scr->d_depth) - 1; + + if (DisplayCells(dpy, scrnum) < 3) + Scr->Monochrome = MONOCHROME; + else if (DefaultVisual(dpy, scrnum)->class == GrayScale) + Scr->Monochrome = GRAYSCALE; + else + Scr->Monochrome = COLOR; + + /* setup default colors */ + Scr->FirstTime = TRUE; + GetColor(Scr->Monochrome, &black, "black"); + Scr->Black = black; + GetColor(Scr->Monochrome, &white, "white"); + Scr->White = white; + + if (FirstScreen) + { + SetFocus ((TwmWindow *)NULL, CurrentTime); + + /* define cursors */ + + NewFontCursor(&UpperLeftCursor, "top_left_corner"); + NewFontCursor(&RightButt, "rightbutton"); + NewFontCursor(&LeftButt, "leftbutton"); + NewFontCursor(&MiddleButt, "middlebutton"); + } + + Scr->iconmgr.x = 0; + Scr->iconmgr.y = 0; + Scr->iconmgr.width = 150; + Scr->iconmgr.height = 5; + Scr->iconmgr.next = NULL; + Scr->iconmgr.prev = NULL; + Scr->iconmgr.lasti = &(Scr->iconmgr); + Scr->iconmgr.first = NULL; + Scr->iconmgr.last = NULL; + Scr->iconmgr.active = NULL; + Scr->iconmgr.scr = Scr; + Scr->iconmgr.columns = 1; + Scr->iconmgr.count = 0; + Scr->iconmgr.name = "TWM"; + Scr->iconmgr.icon_name = "Icons"; + + Scr->IconDirectory = NULL; + + Scr->siconifyPm = None; + Scr->pullPm = None; + Scr->hilitePm = None; + Scr->tbpm.xlogo = None; + Scr->tbpm.resize = None; + Scr->tbpm.question = None; + Scr->tbpm.menu = None; + Scr->tbpm.delete = None; + + InitVariables(); + InitMenus(); + + /* Parse it once for each screen. */ + ParseTwmrc(InitFile); + assign_var_savecolor(); /* storeing pixels for twmrc "entities" */ + if (Scr->SqueezeTitle == -1) Scr->SqueezeTitle = FALSE; + if (!Scr->HaveFonts) CreateFonts(); + CreateGCs(); + MakeMenus(); + + Scr->TitleBarFont.y += Scr->FramePadding; + Scr->TitleHeight = Scr->TitleBarFont.height + Scr->FramePadding * 2; + /* make title height be odd so buttons look nice and centered */ + if (!(Scr->TitleHeight & 1)) Scr->TitleHeight++; + + InitTitlebarButtons (); /* menus are now loaded! */ + + XGrabServer(dpy); + XSync(dpy, 0); + + JunkX = 0; + JunkY = 0; + + XQueryTree(dpy, Scr->Root, &root, &parent, &children, &nchildren); + CreateIconManagers(); + if (!Scr->NoIconManagers) + Scr->iconmgr.twm_win->icon = TRUE; + + /* + * weed out icon windows + */ + for (i = 0; i < nchildren; i++) { + if (children[i]) { + XWMHints *wmhintsp = XGetWMHints (dpy, children[i]); + + if (wmhintsp) { + if (wmhintsp->flags & IconWindowHint) { + for (j = 0; j < nchildren; j++) { + if (children[j] == wmhintsp->icon_window) { + children[j] = None; + break; + } + } + } + XFree ((char *) wmhintsp); + } + } + } + + /* + * map all of the non-override windows + */ + for (i = 0; i < nchildren; i++) + { + if (children[i] && MappedNotOverride(children[i])) + { + XUnmapWindow(dpy, children[i]); + SimulateMapRequest(children[i]); + } + } + + if (Scr->ShowIconManager && !Scr->NoIconManagers) + { + Scr->iconmgr.twm_win->icon = FALSE; + if (Scr->iconmgr.count) + { + SetMapStateProp (Scr->iconmgr.twm_win, NormalState); + XMapWindow(dpy, Scr->iconmgr.w); + XMapWindow(dpy, Scr->iconmgr.twm_win->frame); + } + } + + + attributes.border_pixel = Scr->DefaultC.fore; + attributes.background_pixel = Scr->DefaultC.back; + attributes.event_mask = (ExposureMask | ButtonPressMask | + KeyPressMask | ButtonReleaseMask); + attributes.backing_store = NotUseful; + attributes.cursor = XCreateFontCursor (dpy, XC_hand2); + valuemask = (CWBorderPixel | CWBackPixel | CWEventMask | + CWBackingStore | CWCursor); + Scr->InfoWindow = XCreateWindow (dpy, Scr->Root, 0, 0, + (unsigned int) 5, (unsigned int) 5, + (unsigned int) BW, 0, + (unsigned int) CopyFromParent, + (Visual *) CopyFromParent, + valuemask, &attributes); + + Scr->SizeStringWidth = MyFont_TextWidth (&Scr->SizeFont, + " 8888 x 8888 ", 13); + valuemask = (CWBorderPixel | CWBackPixel | CWBitGravity); + attributes.bit_gravity = NorthWestGravity; + Scr->SizeWindow = XCreateWindow (dpy, Scr->Root, 0, 0, + (unsigned int) Scr->SizeStringWidth, + (unsigned int) (Scr->SizeFont.height + + SIZE_VINDENT*2), + (unsigned int) BW, 0, + (unsigned int) CopyFromParent, + (Visual *) CopyFromParent, + valuemask, &attributes); + + XUngrabServer(dpy); + + FirstScreen = FALSE; + Scr->FirstTime = FALSE; + } /* for */ + + if (numManaged == 0) { + if (MultiScreen && NumScreens > 0) + fprintf (stderr, "%s: unable to find any unmanaged %sscreens.\n", + ProgramName, NoPrintscreens?"":"video "); + exit (1); + } + + (void) ConnectToSessionManager (client_id); + + RestartPreviousState = False; + HandlingEvents = TRUE; + InitEvents(); + HandleEvents(); + exit(0); +} + +/** + * initialize twm variables + */ +void +InitVariables() +{ + FreeList(&Scr->BorderColorL); + FreeList(&Scr->IconBorderColorL); + FreeList(&Scr->BorderTileForegroundL); + FreeList(&Scr->BorderTileBackgroundL); + FreeList(&Scr->TitleForegroundL); + FreeList(&Scr->TitleBackgroundL); + FreeList(&Scr->IconForegroundL); + FreeList(&Scr->IconBackgroundL); + FreeList(&Scr->IconManagerFL); + FreeList(&Scr->IconManagerBL); + FreeList(&Scr->IconMgrs); + FreeList(&Scr->NoTitle); + FreeList(&Scr->MakeTitle); + FreeList(&Scr->AutoRaise); + FreeList(&Scr->IconNames); + FreeList(&Scr->NoHighlight); + FreeList(&Scr->NoStackModeL); + FreeList(&Scr->NoTitleHighlight); + FreeList(&Scr->DontIconify); + FreeList(&Scr->IconMgrNoShow); + FreeList(&Scr->IconMgrShow); + FreeList(&Scr->IconifyByUn); + FreeList(&Scr->StartIconified); + FreeList(&Scr->IconManagerHighlightL); + FreeList(&Scr->SqueezeTitleL); + FreeList(&Scr->DontSqueezeTitleL); + FreeList(&Scr->WindowRingL); + FreeList(&Scr->WarpCursorL); + + NewFontCursor(&Scr->FrameCursor, "top_left_arrow"); + NewFontCursor(&Scr->TitleCursor, "top_left_arrow"); + NewFontCursor(&Scr->IconCursor, "top_left_arrow"); + NewFontCursor(&Scr->IconMgrCursor, "top_left_arrow"); + NewFontCursor(&Scr->MoveCursor, "fleur"); + NewFontCursor(&Scr->ResizeCursor, "fleur"); + NewFontCursor(&Scr->MenuCursor, "sb_left_arrow"); + NewFontCursor(&Scr->ButtonCursor, "hand2"); + NewFontCursor(&Scr->WaitCursor, "watch"); + NewFontCursor(&Scr->SelectCursor, "dot"); + NewFontCursor(&Scr->DestroyCursor, "pirate"); + + Scr->Ring = NULL; + Scr->RingLeader = NULL; + + Scr->DefaultC.fore = black; + Scr->DefaultC.back = white; + Scr->BorderColor = black; + Scr->BorderTileC.fore = black; + Scr->BorderTileC.back = white; + Scr->TitleC.fore = black; + Scr->TitleC.back = white; + Scr->MenuC.fore = black; + Scr->MenuC.back = white; + Scr->MenuTitleC.fore = black; + Scr->MenuTitleC.back = white; + Scr->MenuShadowColor = black; + Scr->MenuBorderColor = black; + Scr->IconC.fore = black; + Scr->IconC.back = white; + Scr->IconBorderColor = black; + Scr->PointerForeground.pixel = black; + XQueryColor(dpy, Scr->TwmRoot.cmaps.cwins[0]->colormap->c, + &Scr->PointerForeground); + Scr->PointerBackground.pixel = white; + XQueryColor(dpy, Scr->TwmRoot.cmaps.cwins[0]->colormap->c, + &Scr->PointerBackground); + Scr->IconManagerC.fore = black; + Scr->IconManagerC.back = white; + Scr->IconManagerHighlight = black; + + Scr->FramePadding = 2; /* values that look "nice" on */ + Scr->TitlePadding = 8; /* 75 and 100dpi displays */ + Scr->ButtonIndent = 1; + Scr->SizeStringOffset = 0; + Scr->BorderWidth = BW; + Scr->IconBorderWidth = BW; + Scr->MenuBorderWidth = BW; + Scr->UnknownWidth = 0; + Scr->UnknownHeight = 0; + Scr->NumAutoRaises = 0; + Scr->NoDefaults = FALSE; + Scr->UsePPosition = PPOS_OFF; + Scr->FocusRoot = TRUE; + Scr->Focus = NULL; + Scr->WarpCursor = FALSE; + Scr->ForceIcon = FALSE; + Scr->NoGrabServer = FALSE; + Scr->NoRaiseMove = FALSE; + Scr->NoRaiseResize = FALSE; + Scr->NoRaiseDeicon = FALSE; + Scr->NoRaiseWarp = FALSE; + Scr->DontMoveOff = FALSE; + Scr->DoZoom = FALSE; + Scr->TitleFocus = TRUE; + Scr->NoTitlebar = FALSE; + Scr->DecorateTransients = FALSE; + Scr->IconifyByUnmapping = FALSE; + Scr->ShowIconManager = FALSE; + Scr->IconManagerDontShow =FALSE; + Scr->BackingStore = TRUE; + Scr->SaveUnder = TRUE; + Scr->RandomPlacement = FALSE; + Scr->OpaqueMove = FALSE; + Scr->Highlight = TRUE; + Scr->StackMode = TRUE; + Scr->TitleHighlight = TRUE; + Scr->MoveDelta = 1; /* so that f.deltastop will work */ + Scr->ZoomCount = 8; + Scr->SortIconMgr = FALSE; + Scr->Shadow = TRUE; + Scr->InterpolateMenuColors = FALSE; + Scr->NoIconManagers = FALSE; + Scr->ClientBorderWidth = FALSE; + Scr->SqueezeTitle = -1; + Scr->FirstRegion = NULL; + Scr->LastRegion = NULL; + Scr->FirstTime = TRUE; + Scr->HaveFonts = FALSE; /* i.e. not loaded yet */ + Scr->CaseSensitive = TRUE; + Scr->WarpUnmapped = FALSE; + + /* setup default fonts; overridden by defaults from system.twmrc */ +#define DEFAULT_NICE_FONT "variable" +#define DEFAULT_FAST_FONT "fixed" + + Scr->TitleBarFont.font = NULL; + Scr->TitleBarFont.fontset = NULL; + Scr->TitleBarFont.name = DEFAULT_NICE_FONT; + Scr->MenuFont.font = NULL; + Scr->MenuFont.fontset = NULL; + Scr->MenuFont.name = DEFAULT_NICE_FONT; + Scr->IconFont.font = NULL; + Scr->IconFont.fontset = NULL; + Scr->IconFont.name = DEFAULT_NICE_FONT; + Scr->SizeFont.font = NULL; + Scr->SizeFont.fontset = NULL; + Scr->SizeFont.name = DEFAULT_FAST_FONT; + Scr->IconManagerFont.font = NULL; + Scr->IconManagerFont.fontset = NULL; + Scr->IconManagerFont.name = DEFAULT_NICE_FONT; + Scr->DefaultFont.font = NULL; + Scr->DefaultFont.fontset = NULL; + Scr->DefaultFont.name = DEFAULT_FAST_FONT; + +} + +void +CreateFonts () +{ + GetFont(&Scr->TitleBarFont); + GetFont(&Scr->MenuFont); + GetFont(&Scr->IconFont); + GetFont(&Scr->SizeFont); + GetFont(&Scr->IconManagerFont); + GetFont(&Scr->DefaultFont); + Scr->HaveFonts = TRUE; +} + +void +RestoreWithdrawnLocation (TwmWindow *tmp) +{ + int gravx, gravy; + unsigned int bw, mask; + XWindowChanges xwc; + + if (XGetGeometry (dpy, tmp->w, &JunkRoot, &xwc.x, &xwc.y, + &JunkWidth, &JunkHeight, &bw, &JunkDepth)) { + + GetGravityOffsets (tmp, &gravx, &gravy); + if (gravy < 0) xwc.y -= tmp->title_height; + + if (bw != tmp->old_bw) { + int xoff, yoff; + + if (!Scr->ClientBorderWidth) { + xoff = gravx; + yoff = gravy; + } else { + xoff = 0; + yoff = 0; + } + + xwc.x -= (xoff + 1) * tmp->old_bw; + xwc.y -= (yoff + 1) * tmp->old_bw; + } + if (!Scr->ClientBorderWidth) { + xwc.x += gravx * tmp->frame_bw; + xwc.y += gravy * tmp->frame_bw; + } + + mask = (CWX | CWY); + if (bw != tmp->old_bw) { + xwc.border_width = tmp->old_bw; + mask |= CWBorderWidth; + } + + XConfigureWindow (dpy, tmp->w, mask, &xwc); + + if (tmp->wmhints && (tmp->wmhints->flags & IconWindowHint)) { + XUnmapWindow (dpy, tmp->wmhints->icon_window); + } + + } +} + + +void +Reborder (Time time) +{ + TwmWindow *tmp; /* temp twm window structure */ + int scrnum; + + /* put a border back around all windows */ + + XGrabServer (dpy); + for (scrnum = 0; scrnum < NumScreens; scrnum++) + { + if ((Scr = ScreenList[scrnum]) == NULL) + continue; + + InstallWindowColormaps (0, &Scr->TwmRoot); /* force reinstall */ + for (tmp = Scr->TwmRoot.next; tmp != NULL; tmp = tmp->next) + { + RestoreWithdrawnLocation (tmp); + XMapWindow (dpy, tmp->w); + } + } + + XUngrabServer (dpy); + SetFocus ((TwmWindow*)NULL, time); +} + +static SIGNAL_T +sigHandler(int sig) +{ + XtNoticeSignal(si); + SIGNAL_RETURN; +} + +/** + * cleanup and exit twm + */ +void +Done(XtPointer client_data, XtSignalId *si) +{ + if (dpy) + { + Reborder(CurrentTime); + XCloseDisplay(dpy); + } + exit(0); +} + + +/* + * Error Handlers. If a client dies, we'll get a BadWindow error (except for + * GetGeometry which returns BadDrawable) for most operations that we do before + * manipulating the client's window. + */ + +Bool ErrorOccurred = False; +XErrorEvent LastErrorEvent; + +static int +TwmErrorHandler(Display *dpy, XErrorEvent *event) +{ + LastErrorEvent = *event; + ErrorOccurred = True; + + if (PrintErrorMessages && /* don't be too obnoxious */ + event->error_code != BadWindow && /* watch for dead puppies */ + (event->request_code != X_GetGeometry && /* of all styles */ + event->error_code != BadDrawable)) + XmuPrintDefaultErrorMessage (dpy, event, stderr); + return 0; +} + + +static int +CatchRedirectError(Display *dpy, XErrorEvent *event) +{ + RedirectError = TRUE; + LastErrorEvent = *event; + ErrorOccurred = True; + return 0; +} diff --git a/app/twm/src/twm.h b/app/twm/src/twm.h new file mode 100644 index 000000000..a697d8233 --- /dev/null +++ b/app/twm/src/twm.h @@ -0,0 +1,436 @@ +/*****************************************************************************/ +/** Copyright 1988 by Evans & Sutherland Computer Corporation, **/ +/** Salt Lake City, Utah **/ +/** **/ +/** All Rights Reserved **/ +/** **/ +/** Permission to use, copy, modify, and distribute this software and **/ +/** its documentation for any purpose and without fee is hereby **/ +/** granted, provided that the above copyright notice appear in all **/ +/** copies and that both that copyright notice and this permis- **/ +/** sion notice appear in supporting documentation, and that the **/ +/** names of Evans & Sutherland not be used in advertising **/ +/** in publicity pertaining to distribution of the software without **/ +/** specific, written prior permission. **/ +/** **/ +/** EVANS & SUTHERLAND AND DISCLAIMS ALL WARRANTIES WITH REGARD **/ +/** TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANT- **/ +/** ABILITY AND FITNESS, IN NO EVENT SHALL EVANS & SUTHERLAND **/ +/** BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES **/ +/** OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA **/ +/** OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER **/ +/** TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE **/ +/** OR PERFORMANCE OF THIS SOFTWARE. **/ +/*****************************************************************************/ +/* + +Portions Copyright 1989, 1998 The Open Group + +Permission to use, copy, modify, distribute, and sell this software and its +documentation for any purpose is hereby granted without fee, provided that +the above copyright notice appear in all copies and that both that +copyright notice and this permission notice appear in supporting +documentation. + +The above copyright notice and this permission notice shall be included +in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR +OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the name of The Open Group shall +not be used in advertising or otherwise to promote the sale, use or +other dealings in this Software without prior written authorization +from The Open Group. + +*/ + + +/*********************************************************************** + * + * $Xorg: twm.h,v 1.4 2001/02/09 02:05:37 xorgcvs Exp $ + * + * twm include file + * + * 28-Oct-87 Thomas E. LaStrange File created + * 10-Oct-90 David M. Sternlicht Storeing saved colors on root + ***********************************************************************/ +/* $XFree86: xc/programs/twm/twm.h,v 3.12 2001/12/14 20:01:10 dawes Exp $ */ + +#ifndef _TWM_ +#define _TWM_ + +#include +#include +#include +#include +#include +#include +#include + +#ifndef WithdrawnState +#define WithdrawnState 0 +#endif + +#define PIXEL_ALREADY_TYPEDEFED /* for Xmu/Drawing.h */ + +#ifdef SIGNALRETURNSINT +#define SIGNAL_T int +#define SIGNAL_RETURN return 0 +#else +#define SIGNAL_T void +#define SIGNAL_RETURN return +#endif + +typedef SIGNAL_T (*SigProc)(int); /* type of function returned by signal() */ + +#define BW 2 /* border width */ +#define BW2 4 /* border width * 2 */ + +#ifndef TRUE +#define TRUE 1 +#define FALSE 0 +#endif + +#define NULLSTR ((char *) NULL) + +#define MAX_BUTTONS 5 /* max mouse buttons supported */ + +/* info stings defines */ +#define INFO_LINES 30 +#define INFO_SIZE 200 + +/* contexts for button presses */ +#define C_NO_CONTEXT -1 +#define C_WINDOW 0 +#define C_TITLE 1 +#define C_ICON 2 +#define C_ROOT 3 +#define C_FRAME 4 +#define C_ICONMGR 5 +#define C_NAME 6 +#define C_IDENTIFY 7 +#define NUM_CONTEXTS 8 + +#define C_WINDOW_BIT (1 << C_WINDOW) +#define C_TITLE_BIT (1 << C_TITLE) +#define C_ICON_BIT (1 << C_ICON) +#define C_ROOT_BIT (1 << C_ROOT) +#define C_FRAME_BIT (1 << C_FRAME) +#define C_ICONMGR_BIT (1 << C_ICONMGR) +#define C_NAME_BIT (1 << C_NAME) + +#define C_ALL_BITS (C_WINDOW_BIT | C_TITLE_BIT | C_ICON_BIT |\ + C_ROOT_BIT | C_FRAME_BIT | C_ICONMGR_BIT) + +/* modifiers for button presses */ +#define MOD_SIZE ((ShiftMask | ControlMask | Mod1Mask \ + | Mod2Mask | Mod3Mask | Mod4Mask | Mod5Mask) + 1) + +#define TITLE_BAR_SPACE 1 /* 2 pixel space bordering chars */ +#define TITLE_BAR_FONT_HEIGHT 15 /* max of 15 pixel high chars */ +#define TITLE_BAR_HEIGHT (TITLE_BAR_FONT_HEIGHT+(2*TITLE_BAR_SPACE)) + +/* defines for zooming/unzooming */ +#define ZOOM_NONE 0 + +#define FB(fix_fore, fix_back)\ + Gcv.foreground = fix_fore;\ + Gcv.background = fix_back;\ + XChangeGC(dpy, Scr->NormalGC, GCForeground|GCBackground,&Gcv) + +typedef struct MyFont +{ + char *name; /* name of the font */ + XFontStruct *font; /* font structure */ + XFontSet fontset; /* fontset structure */ + int height; /* height of the font */ + int y; /* Y coordinate to draw characters */ + int ascent; + int descent; +} MyFont; + +typedef struct ColorPair +{ + Pixel fore, back; +} ColorPair; + +typedef struct _TitleButton { + struct _TitleButton *next; /* next link in chain */ + char *name; /* bitmap name in case of deferal */ + Pixmap bitmap; /* image to display in button */ + int srcx, srcy; /* from where to start copying */ + unsigned int width, height; /* size of pixmap */ + int dstx, dsty; /* to where to start copying */ + int func; /* function to execute */ + char *action; /* optional action arg */ + struct MenuRoot *menuroot; /* menu to pop on F_MENU */ + Bool rightside; /* t: on right, f: on left */ +} TitleButton; + +typedef struct _TBWindow { + Window window; /* which window in this frame */ + TitleButton *info; /* description of this window */ +} TBWindow; + +typedef struct _SqueezeInfo { + int justify; /* left, center, right */ + int num; /* signed pixel count or numerator */ + int denom; /* 0 for pix count or denominator */ +} SqueezeInfo; + +#define J_LEFT 1 +#define J_CENTER 2 +#define J_RIGHT 3 + +/* Colormap window entry for each window in WM_COLORMAP_WINDOWS + * ICCCM property. + */ +typedef struct TwmColormap +{ + Colormap c; /* Colormap id */ + int state; /* install(ability) state */ + unsigned long install_req; /* request number which installed it */ + Window w; /* window causing load of color table */ + int refcnt; +} TwmColormap; + +#define CM_INSTALLABLE 1 +#define CM_INSTALLED 2 +#define CM_INSTALL 4 + +typedef struct ColormapWindow +{ + Window w; /* Window id */ + TwmColormap *colormap; /* Colormap for this window */ + int visibility; /* Visibility of this window */ + int refcnt; +} ColormapWindow; + +typedef struct Colormaps +{ + ColormapWindow **cwins; /* current list of colormap windows */ + int number_cwins; /* number of elements in current list */ + char *scoreboard; /* conflicts between installable colortables */ +} Colormaps; + +#define ColormapsScoreboardLength(cm) ((cm)->number_cwins * \ + ((cm)->number_cwins - 1) / 2) + +/* for each window that is on the display, one of these structures + * is allocated and linked into a list + */ +typedef struct TwmWindow +{ + struct TwmWindow *next; /* next twm window */ + struct TwmWindow *prev; /* previous twm window */ + Window w; /* the child window */ + int old_bw; /* border width before reparenting */ + Window frame; /* the frame window */ + Window title_w; /* the title bar window */ + Window hilite_w; /* the hilite window */ + Pixmap gray; + Window icon_w; /* the icon window */ + Window icon_bm_w; /* the icon bitmap window */ + int frame_x; /* x position of frame */ + int frame_y; /* y position of frame */ + int frame_width; /* width of frame */ + int frame_height; /* height of frame */ + int frame_bw; /* borderwidth of frame */ + int title_x; + int title_y; + int icon_x; /* icon text x coordinate */ + int icon_y; /* icon text y coordiante */ + int icon_w_width; /* width of the icon window */ + int icon_w_height; /* height of the icon window */ + int icon_width; /* width of the icon bitmap */ + int icon_height; /* height of the icon bitmap */ + int title_height; /* height of the title bar */ + int title_width; /* width of the title bar */ + char *full_name; /* full name of the window */ + char *name; /* name of the window */ + char *icon_name; /* name of the icon */ + int name_width; /* width of name text */ + int highlightx; /* start of highlight window */ + int rightx; /* start of right buttons */ + XWindowAttributes attr; /* the child window attributes */ + XSizeHints hints; /* normal hints */ + XWMHints *wmhints; /* WM hints */ + Window group; /* group ID */ + XClassHint class; + struct WList *list; + /*********************************************************************** + * color definitions per window + **********************************************************************/ + Pixel border; /* border color */ + Pixel icon_border; /* border color */ + ColorPair border_tile; + ColorPair title; + ColorPair iconc; + short iconified; /* has the window ever been iconified? */ + short icon; /* is the window an icon now ? */ + short icon_on; /* is the icon visible */ + short mapped; /* is the window mapped ? */ + short auto_raise; /* should we auto-raise this window ? */ + short forced; /* has had an icon forced upon it */ + short icon_not_ours; /* icon pixmap or window supplied to us */ + short icon_moved; /* user explicitly moved the icon */ + short highlight; /* should highlight this window */ + short stackmode; /* honor stackmode requests */ + short iconify_by_unmapping; /* unmap window to iconify it */ + short iconmgr; /* this is an icon manager window */ + short transient; /* this is a transient window */ + Window transientfor; /* window contained in XA_XM_TRANSIENT_FOR */ + short titlehighlight; /* should I highlight the title bar */ + struct IconMgr *iconmgrp; /* pointer to it if this is an icon manager */ + int save_frame_x; /* x position of frame */ + int save_frame_y; /* y position of frame */ + int save_frame_width; /* width of frame */ + int save_frame_height; /* height of frame */ + short zoomed; /* is the window zoomed? */ + short wShaped; /* this window has a bounding shape */ + unsigned long protocols; /* which protocols this window handles */ + Colormaps cmaps; /* colormaps for this application */ + TBWindow *titlebuttons; + SqueezeInfo *squeeze_info; /* should the title be squeezed? */ + struct { + struct TwmWindow *next, *prev; + Bool cursor_valid; + int curs_x, curs_y; + } ring; + + Bool nameChanged; /* did WM_NAME ever change? */ + + /* did the user ever change the width/height? {yes, no, or unknown} */ + + Bool widthEverChangedByUser; + Bool heightEverChangedByUser; + +} TwmWindow; + + +typedef struct TWMWinConfigEntry +{ + struct TWMWinConfigEntry *next; + int tag; + char *client_id; + char *window_role; + XClassHint class; + char *wm_name; + int wm_command_count; + char **wm_command; + short x, y; + unsigned short width, height; + short icon_x, icon_y; + Bool iconified; + Bool icon_info_present; + Bool width_ever_changed_by_user; + Bool height_ever_changed_by_user; +} TWMWinConfigEntry; + + +#define DoesWmTakeFocus (1L << 0) +#define DoesWmSaveYourself (1L << 1) +#define DoesWmDeleteWindow (1L << 2) + +#define TBPM_DOT ":dot" /* name of titlebar pixmap for dot */ +#define TBPM_ICONIFY ":iconify" /* same image as dot */ +#define TBPM_RESIZE ":resize" /* name of titlebar pixmap for resize button */ +#define TBPM_XLOGO ":xlogo" /* name of titlebar pixmap for xlogo */ +#define TBPM_DELETE ":delete" /* same image as xlogo */ +#define TBPM_MENU ":menu" /* name of titlebar pixmap for menus */ +#define TBPM_QUESTION ":question" /* name of unknown titlebar pixmap */ + +#include +#include +extern void InitVariables ( void ); +extern void CreateFonts ( void ); +extern void RestoreWithdrawnLocation ( TwmWindow *tmp ); +extern void Reborder( Time time); +extern void Done( XtPointer, XtSignalId * ); +extern void ComputeCommonTitleOffsets ( void ); +extern void ComputeTitleLocation ( TwmWindow *tmp ); +extern void ComputeWindowTitleOffsets ( TwmWindow *tmp_win, int width, Bool squeeze ); +extern char *ProgramName; +extern Display *dpy; +extern XtAppContext appContext; +extern Window ResizeWindow; /* the window we are resizing */ +extern int HasShape; /* this server supports Shape extension */ +extern int HasSync; /* this server supports SYNC extension */ + +extern int PreviousScreen; + +extern Cursor UpperLeftCursor; +extern Cursor RightButt; +extern Cursor MiddleButt; +extern Cursor LeftButt; + +extern XClassHint NoClass; + +extern XContext TwmContext; +extern XContext MenuContext; +extern XContext IconManagerContext; +extern XContext ScreenContext; +extern XContext ColormapContext; + +extern char *Home; +extern int HomeLen; +extern int ParseError; + +extern int HandlingEvents; + +extern Window JunkRoot; +extern Window JunkChild; +extern int JunkX; +extern int JunkY; +extern unsigned int JunkWidth, JunkHeight, JunkBW, JunkDepth, JunkMask; +extern XGCValues Gcv; +extern int InfoLines; +extern char Info[][INFO_SIZE]; +extern int Argc; +extern char **Argv; +extern void NewFontCursor ( Cursor *cp, char *str ); +extern void NewBitmapCursor ( Cursor *cp, char *source, char *mask ); +extern Pixmap CreateMenuIcon ( int height, unsigned int *widthp, unsigned int *heightp ); + +extern Bool ErrorOccurred; +extern XErrorEvent LastErrorEvent; + +#define ResetError() (ErrorOccurred = False) + +extern Bool RestartPreviousState; +extern Bool GetWMState ( Window w, int *statep, Window *iwp ); + +extern void twmrc_error_prefix ( void ); + +extern int yyparse ( void ); +extern int yylex ( void ); +extern void yyerror ( char *s ); +extern int doinput ( char *buf, int size ); +extern void RemoveDQuote ( char *str ); + +extern Atom TwmAtoms[]; + +extern Bool use_fontset; + +extern int ShapeEventBase; +extern int ShapeErrorBase; + +#define _XA_MIT_PRIORITY_COLORS TwmAtoms[0] +#define _XA_WM_CHANGE_STATE TwmAtoms[1] +#define _XA_WM_STATE TwmAtoms[2] +#define _XA_WM_COLORMAP_WINDOWS TwmAtoms[3] +#define _XA_WM_PROTOCOLS TwmAtoms[4] +#define _XA_WM_TAKE_FOCUS TwmAtoms[5] +#define _XA_WM_SAVE_YOURSELF TwmAtoms[6] +#define _XA_WM_DELETE_WINDOW TwmAtoms[7] +#define _XA_SM_CLIENT_ID TwmAtoms[8] +#define _XA_WM_CLIENT_LEADER TwmAtoms[9] +#define _XA_WM_WINDOW_ROLE TwmAtoms[10] + +#endif /* _TWM_ */ diff --git a/app/twm/src/util.c b/app/twm/src/util.c new file mode 100644 index 000000000..1e8784767 --- /dev/null +++ b/app/twm/src/util.c @@ -0,0 +1,1072 @@ +/*****************************************************************************/ +/* + +Copyright 1989, 1998 The Open Group + +Permission to use, copy, modify, distribute, and sell this software and its +documentation for any purpose is hereby granted without fee, provided that +the above copyright notice appear in all copies and that both that +copyright notice and this permission notice appear in supporting +documentation. + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the name of The Open Group shall not be +used in advertising or otherwise to promote the sale, use or other dealings +in this Software without prior written authorization from The Open Group. + +*/ +/** Copyright 1988 by Evans & Sutherland Computer Corporation, **/ +/** Salt Lake City, Utah **/ +/** Cambridge, Massachusetts **/ +/** **/ +/** All Rights Reserved **/ +/** **/ +/** Permission to use, copy, modify, and distribute this software and **/ +/** its documentation for any purpose and without fee is hereby **/ +/** granted, provided that the above copyright notice appear in all **/ +/** copies and that both that copyright notice and this permis- **/ +/** sion notice appear in supporting documentation, and that the **/ +/** name of Evans & Sutherland not be used in advertising **/ +/** in publicity pertaining to distribution of the software without **/ +/** specific, written prior permission. **/ +/** **/ +/** EVANS & SUTHERLAND DISCLAIMs ALL WARRANTIES WITH REGARD **/ +/** TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANT- **/ +/** ABILITY AND FITNESS, IN NO EVENT SHALL EVANS & SUTHERLAND **/ +/** BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAM- **/ +/** AGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA **/ +/** OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER **/ +/** TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE **/ +/** OR PERFORMANCE OF THIS SOFTWARE. **/ +/*****************************************************************************/ +/* $XFree86: xc/programs/twm/util.c,v 1.12 2002/09/19 13:22:05 tsi Exp $ */ + + +/*********************************************************************** + * + * $Xorg: util.c,v 1.5 2001/02/09 02:05:37 xorgcvs Exp $ + * + * utility routines for twm + * + * 28-Oct-87 Thomas E. LaStrange File created + * + ***********************************************************************/ + +#include "twm.h" +#include "util.h" +#include "gram.h" +#include "screen.h" +#include +#include +#include +#include +#include + +static Pixmap CreateXLogoPixmap ( unsigned int *widthp, + unsigned int *heightp ); +static Pixmap CreateResizePixmap ( unsigned int *widthp, + unsigned int *heightp ); +static Pixmap CreateDotPixmap ( unsigned int *widthp, + unsigned int *heightp ); +static Pixmap CreateQuestionPixmap ( unsigned int *widthp, + unsigned int *heightp ); +static Pixmap CreateMenuPixmap ( unsigned int *widthp, + unsigned int *heightp ); + +int HotX, HotY; + +/** + * move a window outline + * + * \param root window we are outlining + * \param x,y upper left coordinate + * \param width,height size of the rectangle + * \param bw border width of the frame + * \param th title height + */ +void MoveOutline(Window root, int x, int y, int width, int height, int bw, int th) +{ + static int lastx = 0; + static int lasty = 0; + static int lastWidth = 0; + static int lastHeight = 0; + static int lastBW = 0; + static int lastTH = 0; + int xl, xr, yt, yb, xinnerl, xinnerr, yinnert, yinnerb; + int xthird, ythird; + XSegment outline[18]; + register XSegment *r; + + if (x == lastx && y == lasty && width == lastWidth && height == lastHeight + && lastBW == bw && th == lastTH) + return; + + r = outline; + +#define DRAWIT() \ + if (lastWidth || lastHeight) \ + { \ + xl = lastx; \ + xr = lastx + lastWidth - 1; \ + yt = lasty; \ + yb = lasty + lastHeight - 1; \ + xinnerl = xl + lastBW; \ + xinnerr = xr - lastBW; \ + yinnert = yt + lastTH + lastBW; \ + yinnerb = yb - lastBW; \ + xthird = (xinnerr - xinnerl) / 3; \ + ythird = (yinnerb - yinnert) / 3; \ + \ + r->x1 = xl; \ + r->y1 = yt; \ + r->x2 = xr; \ + r->y2 = yt; \ + r++; \ + \ + r->x1 = xl; \ + r->y1 = yb; \ + r->x2 = xr; \ + r->y2 = yb; \ + r++; \ + \ + r->x1 = xl; \ + r->y1 = yt; \ + r->x2 = xl; \ + r->y2 = yb; \ + r++; \ + \ + r->x1 = xr; \ + r->y1 = yt; \ + r->x2 = xr; \ + r->y2 = yb; \ + r++; \ + \ + r->x1 = xinnerl + xthird; \ + r->y1 = yinnert; \ + r->x2 = r->x1; \ + r->y2 = yinnerb; \ + r++; \ + \ + r->x1 = xinnerl + (2 * xthird); \ + r->y1 = yinnert; \ + r->x2 = r->x1; \ + r->y2 = yinnerb; \ + r++; \ + \ + r->x1 = xinnerl; \ + r->y1 = yinnert + ythird; \ + r->x2 = xinnerr; \ + r->y2 = r->y1; \ + r++; \ + \ + r->x1 = xinnerl; \ + r->y1 = yinnert + (2 * ythird); \ + r->x2 = xinnerr; \ + r->y2 = r->y1; \ + r++; \ + \ + if (lastTH != 0) { \ + r->x1 = xl; \ + r->y1 = yt + lastTH; \ + r->x2 = xr; \ + r->y2 = r->y1; \ + r++; \ + } \ + } + + /* undraw the old one, if any */ + DRAWIT (); + + lastx = x; + lasty = y; + lastWidth = width; + lastHeight = height; + lastBW = bw; + lastTH = th; + + /* draw the new one, if any */ + DRAWIT (); + +#undef DRAWIT + + + if (r != outline) + { + XDrawSegments(dpy, root, Scr->DrawGC, outline, r - outline); + } +} + +/** + * zoom in or out of an icon + * + * \param wf window to zoom from + * \param wt window to zoom to + */ +void +Zoom(Window wf, Window wt) +{ + int fx, fy, tx, ty; /* from, to */ + unsigned int fw, fh, tw, th; /* from, to */ + long dx, dy, dw, dh; + long z; + int j; + + if (!Scr->DoZoom || Scr->ZoomCount < 1) return; + + if (wf == None || wt == None) return; + + XGetGeometry (dpy, wf, &JunkRoot, &fx, &fy, &fw, &fh, &JunkBW, &JunkDepth); + XGetGeometry (dpy, wt, &JunkRoot, &tx, &ty, &tw, &th, &JunkBW, &JunkDepth); + + dx = ((long) (tx - fx)); /* going from -> to */ + dy = ((long) (ty - fy)); /* going from -> to */ + dw = ((long) (tw - fw)); /* going from -> to */ + dh = ((long) (th - fh)); /* going from -> to */ + z = (long) (Scr->ZoomCount + 1); + + for (j = 0; j < 2; j++) { + long i; + + XDrawRectangle (dpy, Scr->Root, Scr->DrawGC, fx, fy, fw, fh); + for (i = 1; i < z; i++) { + int x = fx + (int) ((dx * i) / z); + int y = fy + (int) ((dy * i) / z); + unsigned width = (unsigned) (((long) fw) + (dw * i) / z); + unsigned height = (unsigned) (((long) fh) + (dh * i) / z); + + XDrawRectangle (dpy, Scr->Root, Scr->DrawGC, + x, y, width, height); + } + XDrawRectangle (dpy, Scr->Root, Scr->DrawGC, tx, ty, tw, th); + } +} + +/** + * expand the tilde character to HOME if it is the first + * character of the filename + * + * \return a pointer to the new name + * + * \param name the filename to expand + */ +char * +ExpandFilename(char *name) +{ + char *newname; + + if (name[0] != '~') return name; + + newname = (char *) malloc (HomeLen + strlen(name) + 2); + if (!newname) { + fprintf (stderr, + "%s: unable to allocate %ld bytes to expand filename %s/%s\n", + ProgramName, HomeLen + (unsigned long)strlen(name) + 2, + Home, &name[1]); + } else { + (void) sprintf (newname, "%s/%s", Home, &name[1]); + } + + return newname; +} + +/** + * read in the bitmap file for the unknown icon + * + * \param name the filename to read + */ +void +GetUnknownIcon(char *name) +{ + if ((Scr->UnknownPm = GetBitmap(name)) != None) + { + XGetGeometry(dpy, Scr->UnknownPm, &JunkRoot, &JunkX, &JunkY, + (unsigned int *)&Scr->UnknownWidth, (unsigned int *)&Scr->UnknownHeight, &JunkBW, &JunkDepth); + } +} + +/** + * FindBitmap - read in a bitmap file and return size + * + * \return pixmap associated with bitmap + * + * \param name filename to read + * \param[out] widthp pointer to width of bitmap + * \param[out] heightp pointer to height of bitmap + */ +Pixmap +FindBitmap (char *name, unsigned *widthp, unsigned *heightp) +{ + char *bigname; + Pixmap pm; + + if (!name) return None; + + /* + * Names of the form :name refer to hardcoded images that are scaled to + * look nice in title buttons. Eventually, it would be nice to put in a + * menu symbol as well.... + */ + if (name[0] == ':') { + int i; + static struct { + char *name; + Pixmap (*proc)(unsigned int *, unsigned int *); + } pmtab[] = { + { TBPM_DOT, CreateDotPixmap }, + { TBPM_ICONIFY, CreateDotPixmap }, + { TBPM_RESIZE, CreateResizePixmap }, + { TBPM_XLOGO, CreateXLogoPixmap }, + { TBPM_DELETE, CreateXLogoPixmap }, + { TBPM_MENU, CreateMenuPixmap }, + { TBPM_QUESTION, CreateQuestionPixmap }, + }; + + for (i = 0; i < (sizeof pmtab)/(sizeof pmtab[0]); i++) { + if (XmuCompareISOLatin1 (pmtab[i].name, name) == 0) + return (*pmtab[i].proc) (widthp, heightp); + } + fprintf (stderr, "%s: no such built-in bitmap \"%s\"\n", + ProgramName, name); + return None; + } + + /* + * Generate a full pathname if any special prefix characters (such as ~) + * are used. If the bigname is different from name, bigname will need to + * be freed. + */ + bigname = ExpandFilename (name); + if (!bigname) return None; + + /* + * look along bitmapFilePath resource same as toolkit clients + */ + pm = XmuLocateBitmapFile (ScreenOfDisplay(dpy, Scr->screen), bigname, NULL, + 0, (int *)widthp, (int *)heightp, &HotX, &HotY); + if (pm == None && Scr->IconDirectory && bigname[0] != '/') { + if (bigname != name) free (bigname); + /* + * Attempt to find icon in old IconDirectory (now obsolete) + */ + bigname = (char *) malloc (strlen(name) + strlen(Scr->IconDirectory) + + 2); + if (!bigname) { + fprintf (stderr, + "%s: unable to allocate memory for \"%s/%s\"\n", + ProgramName, Scr->IconDirectory, name); + return None; + } + (void) sprintf (bigname, "%s/%s", Scr->IconDirectory, name); + if (XReadBitmapFile (dpy, Scr->Root, bigname, widthp, heightp, &pm, + &HotX, &HotY) != BitmapSuccess) { + pm = None; + } + } + if (bigname != name) free (bigname); + if (pm == None) { + fprintf (stderr, "%s: unable to find bitmap \"%s\"\n", + ProgramName, name); + } + + return pm; +} + +Pixmap +GetBitmap (char *name) +{ + return FindBitmap (name, &JunkWidth, &JunkHeight); +} + +void +InsertRGBColormap (Atom a, XStandardColormap *maps, int nmaps, Bool replace) +{ + StdCmap *sc = NULL; + + if (replace) { /* locate existing entry */ + for (sc = Scr->StdCmapInfo.head; sc; sc = sc->next) { + if (sc->atom == a) break; + } + } + + if (!sc) { /* no existing, allocate new */ + sc = (StdCmap *) malloc (sizeof (StdCmap)); + if (!sc) { + fprintf (stderr, "%s: unable to allocate %ld bytes for StdCmap\n", + ProgramName, (unsigned long)sizeof (StdCmap)); + return; + } + } + + if (replace) { /* just update contents */ + if (sc->maps) XFree ((char *) maps); + if (sc == Scr->StdCmapInfo.mru) Scr->StdCmapInfo.mru = NULL; + } else { /* else appending */ + sc->next = NULL; + sc->atom = a; + if (Scr->StdCmapInfo.tail) { + Scr->StdCmapInfo.tail->next = sc; + } else { + Scr->StdCmapInfo.head = sc; + } + Scr->StdCmapInfo.tail = sc; + } + sc->nmaps = nmaps; + sc->maps = maps; + + return; +} + +void +RemoveRGBColormap (Atom a) +{ + StdCmap *sc, *prev; + + prev = NULL; + for (sc = Scr->StdCmapInfo.head; sc; sc = sc->next) { + if (sc->atom == a) break; + prev = sc; + } + if (sc) { /* found one */ + if (sc->maps) XFree ((char *) sc->maps); + if (prev) prev->next = sc->next; + if (Scr->StdCmapInfo.head == sc) Scr->StdCmapInfo.head = sc->next; + if (Scr->StdCmapInfo.tail == sc) Scr->StdCmapInfo.tail = prev; + if (Scr->StdCmapInfo.mru == sc) Scr->StdCmapInfo.mru = NULL; + } + return; +} + +void +LocateStandardColormaps() +{ + Atom *atoms; + int natoms; + int i; + + atoms = XListProperties (dpy, Scr->Root, &natoms); + for (i = 0; i < natoms; i++) { + XStandardColormap *maps = NULL; + int nmaps; + + if (XGetRGBColormaps (dpy, Scr->Root, &maps, &nmaps, atoms[i])) { + /* if got one, then append to current list */ + InsertRGBColormap (atoms[i], maps, nmaps, False); + } + } + if (atoms) XFree ((char *) atoms); + return; +} + +void +GetColor(int kind, Pixel *what, char *name) +{ + XColor color, junkcolor; + Status stat = 0; + Colormap cmap = Scr->TwmRoot.cmaps.cwins[0]->colormap->c; + +#ifndef TOM + if (!Scr->FirstTime) + return; +#endif + + if (Scr->Monochrome != kind) + return; + + if (!XAllocNamedColor (dpy, cmap, name, &color, &junkcolor)) + { + /* if we could not allocate the color, let's see if this is a + * standard colormap + */ + XStandardColormap *stdcmap = NULL; + + /* parse the named color */ + if (name[0] != '#') + stat = XParseColor (dpy, cmap, name, &color); + if (!stat) + { + fprintf (stderr, "%s: invalid color name \"%s\"\n", + ProgramName, name); + return; + } + + /* + * look through the list of standard colormaps (check cache first) + */ + if (Scr->StdCmapInfo.mru && Scr->StdCmapInfo.mru->maps && + (Scr->StdCmapInfo.mru->maps[Scr->StdCmapInfo.mruindex].colormap == + cmap)) { + stdcmap = &(Scr->StdCmapInfo.mru->maps[Scr->StdCmapInfo.mruindex]); + } else { + StdCmap *sc; + + for (sc = Scr->StdCmapInfo.head; sc; sc = sc->next) { + int i; + + for (i = 0; i < sc->nmaps; i++) { + if (sc->maps[i].colormap == cmap) { + Scr->StdCmapInfo.mru = sc; + Scr->StdCmapInfo.mruindex = i; + stdcmap = &(sc->maps[i]); + goto gotit; + } + } + } + } + + gotit: + if (stdcmap) { + color.pixel = (stdcmap->base_pixel + + ((Pixel)(((float)color.red / 65535.0) * + stdcmap->red_max + 0.5) * + stdcmap->red_mult) + + ((Pixel)(((float)color.green /65535.0) * + stdcmap->green_max + 0.5) * + stdcmap->green_mult) + + ((Pixel)(((float)color.blue / 65535.0) * + stdcmap->blue_max + 0.5) * + stdcmap->blue_mult)); + } else { + fprintf (stderr, "%s: unable to allocate color \"%s\"\n", + ProgramName, name); + return; + } + } + + *what = color.pixel; +} + +void +GetColorValue(int kind, XColor *what, char *name) +{ + XColor junkcolor; + Colormap cmap = Scr->TwmRoot.cmaps.cwins[0]->colormap->c; + +#ifndef TOM + if (!Scr->FirstTime) + return; +#endif + + if (Scr->Monochrome != kind) + return; + + if (!XLookupColor (dpy, cmap, name, what, &junkcolor)) + { + fprintf (stderr, "%s: invalid color name \"%s\"\n", + ProgramName, name); + } + else + { + what->pixel = AllPlanes; + } +} + +/* + * The following functions are sensible to 'use_fontset'. + * When 'use_fontset' is True, + * - XFontSet-related internationalized functions are used + * so as multibyte languages can be displayed. + * When 'use_fontset' is False, + * - XFontStruct-related conventional functions are used + * so as 8-bit characters can be displayed even when + * locale is not set properly. + */ +void +GetFont(MyFont *font) +{ + char *deffontname = "fixed"; + char **missing_charset_list_return; + int missing_charset_count_return; + char *def_string_return; + XFontSetExtents *font_extents; + XFontStruct **xfonts; + char **font_names; + register int i; + int ascent; + int descent; + int fnum; + char *basename2; + + if (use_fontset) { + if (font->fontset != NULL){ + XFreeFontSet(dpy, font->fontset); + } + + basename2 = (char *)malloc(strlen(font->name) + 3); + if (basename2) sprintf(basename2, "%s,*", font->name); + else basename2 = font->name; + if( (font->fontset = XCreateFontSet(dpy, basename2, + &missing_charset_list_return, + &missing_charset_count_return, + &def_string_return)) == NULL) { + fprintf (stderr, "%s: unable to open fontset \"%s\"\n", + ProgramName, font->name); + exit(1); + } + if (basename2 != font->name) free(basename2); + for(i=0; ifontset); + fnum = XFontsOfFontSet(font->fontset, &xfonts, &font_names); + for( i = 0, ascent = 0, descent = 0; iascent) ascent = (*xfonts)->ascent; + if (descent < (*xfonts)->descent) descent = (*xfonts)->descent; + xfonts++; + } + font->height = font_extents->max_logical_extent.height; + font->y = ascent; + font->ascent = ascent; + font->descent = descent; + return; + } + + if (font->font != NULL) + XFreeFont(dpy, font->font); + + if ((font->font = XLoadQueryFont(dpy, font->name)) == NULL) + { + if (Scr->DefaultFont.name) { + deffontname = Scr->DefaultFont.name; + } + if ((font->font = XLoadQueryFont(dpy, deffontname)) == NULL) + { + fprintf (stderr, "%s: unable to open fonts \"%s\" or \"%s\"\n", + ProgramName, font->name, deffontname); + exit(1); + } + + } + font->height = font->font->ascent + font->font->descent; + font->y = font->font->ascent; + font->ascent = font->font->ascent; + font->descent = font->font->descent; +} + +int +MyFont_TextWidth(MyFont *font, char *string, int len) +{ + XRectangle ink_rect; + XRectangle logical_rect; + + if (use_fontset) { + XmbTextExtents(font->fontset, string, len, + &ink_rect, &logical_rect); + return logical_rect.width; + } + return XTextWidth(font->font, string, len); +} + +void +MyFont_DrawImageString(Display *dpy, Drawable d, MyFont *font, GC gc, + int x, int y, char *string, int len) +{ + if (use_fontset) { + XmbDrawImageString(dpy, d, font->fontset, gc, x, y, string, len); + return; + } + XDrawImageString (dpy, d, gc, x, y, string, len); +} + +void +MyFont_DrawString(Display *dpy, Drawable d, MyFont *font, GC gc, + int x, int y, char *string, int len) +{ + if (use_fontset) { + XmbDrawString(dpy, d, font->fontset, gc, x, y, string, len); + return; + } + XDrawString (dpy, d, gc, x, y, string, len); +} + +void +MyFont_ChangeGC(unsigned long fix_fore, unsigned long fix_back, + MyFont *fix_font) +{ + Gcv.foreground = fix_fore; + Gcv.background = fix_back; + if (use_fontset) { + XChangeGC(dpy, Scr->NormalGC, GCForeground|GCBackground, &Gcv); + return; + } + Gcv.font = fix_font->font->fid; + XChangeGC(dpy, Scr->NormalGC, GCFont|GCForeground|GCBackground,&Gcv); +} + +/* + * The following functions are internationalized substitutions + * for XFetchName and XGetIconName using XGetWMName and + * XGetWMIconName. + * + * Please note that the third arguments have to be freed using free(), + * not XFree(). + */ +Status +I18N_FetchName(Display *dpy, Window w, char **winname) +{ + int status; + XTextProperty text_prop; + char **list; + int num; + + status = XGetWMName(dpy, w, &text_prop); + if (!status || !text_prop.value || !text_prop.nitems) { + *winname = NULL; + return 0; + } + status = XmbTextPropertyToTextList(dpy, &text_prop, &list, &num); + if (status < Success || !num || !*list) { + *winname = NULL; + return 0; + } + XFree(text_prop.value); + *winname = (char *)strdup(*list); + XFreeStringList(list); + return 1; +} + +Status +I18N_GetIconName(Display *dpy, Window w, char **iconname) +{ + int status; + XTextProperty text_prop; + char **list; + int num; + + status = XGetWMIconName(dpy, w, &text_prop); + if (!status || !text_prop.value || !text_prop.nitems) return 0; + status = XmbTextPropertyToTextList(dpy, &text_prop, &list, &num); + if (status < Success || !num || !*list) return 0; + XFree(text_prop.value); + *iconname = (char *)strdup(*list); + XFreeStringList(list); + return 1; +} + +/** + * separate routine to set focus to make things more understandable + * and easier to debug + */ +void +SetFocus (TwmWindow *tmp_win, Time time) +{ + Window w = (tmp_win ? tmp_win->w : PointerRoot); + +#ifdef TRACE + if (tmp_win) { + printf ("Focusing on window \"%s\"\n", tmp_win->full_name); + } else { + printf ("Unfocusing; Scr->Focus was \"%s\"\n", + Scr->Focus ? Scr->Focus->full_name : "(nil)"); + } +#endif + + XSetInputFocus (dpy, w, RevertToPointerRoot, time); +} + + +#ifdef NOPUTENV +/** + * define our own putenv() if the system doesn't have one. + * putenv(s): place s (a string of the form "NAME=value") in + * the environment; replacing any existing NAME. s is placed in + * environment, so if you change s, the environment changes (like + * putenv on a sun). Binding removed if you putenv something else + * called NAME. + */ +int +putenv(char *s) +{ + char *v; + int varlen, idx; + extern char **environ; + char **newenv; + static int virgin = 1; /* true while "environ" is a virgin */ + + v = index(s, '='); + if(v == 0) + return 0; /* punt if it's not of the right form */ + varlen = (v + 1) - s; + + for (idx = 0; environ[idx] != 0; idx++) { + if (strncmp(environ[idx], s, varlen) == 0) { + if(v[1] != 0) { /* true if there's a value */ + environ[idx] = s; + return 0; + } else { + do { + environ[idx] = environ[idx+1]; + } while(environ[++idx] != 0); + return 0; + } + } + } + + /* add to environment (unless no value; then just return) */ + if(v[1] == 0) + return 0; + if(virgin) { + register i; + + newenv = (char **) malloc((unsigned) ((idx + 2) * sizeof(char*))); + if(newenv == 0) + return -1; + for(i = idx-1; i >= 0; --i) + newenv[i] = environ[i]; + virgin = 0; /* you're not a virgin anymore, sweety */ + } else { + newenv = (char **) realloc((char *) environ, + (unsigned) ((idx + 2) * sizeof(char*))); + if (newenv == 0) + return -1; + } + + environ = newenv; + environ[idx] = s; + environ[idx+1] = 0; + + return 0; +} +#endif /* NOPUTENV */ + + +static Pixmap +CreateXLogoPixmap (unsigned *widthp, unsigned *heightp) +{ + int h = Scr->TBInfo.width - Scr->TBInfo.border * 2; + if (h < 0) h = 0; + + *widthp = *heightp = (unsigned int) h; + if (Scr->tbpm.xlogo == None) { + GC gc, gcBack; + + Scr->tbpm.xlogo = XCreatePixmap (dpy, Scr->Root, h, h, 1); + gc = XCreateGC (dpy, Scr->tbpm.xlogo, 0L, NULL); + XSetForeground (dpy, gc, 0); + XFillRectangle (dpy, Scr->tbpm.xlogo, gc, 0, 0, h, h); + XSetForeground (dpy, gc, 1); + gcBack = XCreateGC (dpy, Scr->tbpm.xlogo, 0L, NULL); + XSetForeground (dpy, gcBack, 0); + + /* + * draw the logo large so that it gets as dense as possible; then white + * out the edges so that they look crisp + */ + XmuDrawLogo (dpy, Scr->tbpm.xlogo, gc, gcBack, -1, -1, h + 2, h + 2); + XDrawRectangle (dpy, Scr->tbpm.xlogo, gcBack, 0, 0, h - 1, h - 1); + + /* + * done drawing + */ + XFreeGC (dpy, gc); + XFreeGC (dpy, gcBack); + } + return Scr->tbpm.xlogo; +} + + +static Pixmap +CreateResizePixmap (unsigned *widthp, unsigned *heightp) +{ + int h = Scr->TBInfo.width - Scr->TBInfo.border * 2; + if (h < 1) h = 1; + + *widthp = *heightp = (unsigned int) h; + if (Scr->tbpm.resize == None) { + XPoint points[3]; + GC gc; + int w; + int lw; + + /* + * create the pixmap + */ + Scr->tbpm.resize = XCreatePixmap (dpy, Scr->Root, h, h, 1); + gc = XCreateGC (dpy, Scr->tbpm.resize, 0L, NULL); + XSetForeground (dpy, gc, 0); + XFillRectangle (dpy, Scr->tbpm.resize, gc, 0, 0, h, h); + XSetForeground (dpy, gc, 1); + lw = h / 16; + if (lw == 1) + lw = 0; + XSetLineAttributes (dpy, gc, lw, LineSolid, CapButt, JoinMiter); + + /* + * draw the resize button, + */ + w = (h * 2) / 3; + points[0].x = w; + points[0].y = 0; + points[1].x = w; + points[1].y = w; + points[2].x = 0; + points[2].y = w; + XDrawLines (dpy, Scr->tbpm.resize, gc, points, 3, CoordModeOrigin); + w = w / 2; + points[0].x = w; + points[0].y = 0; + points[1].x = w; + points[1].y = w; + points[2].x = 0; + points[2].y = w; + XDrawLines (dpy, Scr->tbpm.resize, gc, points, 3, CoordModeOrigin); + + /* + * done drawing + */ + XFreeGC(dpy, gc); + } + return Scr->tbpm.resize; +} + + +static Pixmap +CreateDotPixmap (unsigned *widthp, unsigned *heightp) +{ + int h = Scr->TBInfo.width - Scr->TBInfo.border * 2; + + h = h * 3 / 4; + if (h < 1) h = 1; + if (!(h & 1)) + h--; + *widthp = *heightp = (unsigned int) h; + if (Scr->tbpm.delete == None) { + GC gc; + Pixmap pix; + + pix = Scr->tbpm.delete = XCreatePixmap (dpy, Scr->Root, h, h, 1); + gc = XCreateGC (dpy, pix, 0L, NULL); + XSetLineAttributes (dpy, gc, h, LineSolid, CapRound, JoinRound); + XSetForeground (dpy, gc, 0L); + XFillRectangle (dpy, pix, gc, 0, 0, h, h); + XSetForeground (dpy, gc, 1L); + XDrawLine (dpy, pix, gc, h/2, h/2, h/2, h/2); + XFreeGC (dpy, gc); + } + return Scr->tbpm.delete; +} + +#define questionmark_width 8 +#define questionmark_height 8 +static char questionmark_bits[] = { + 0x38, 0x7c, 0x64, 0x30, 0x18, 0x00, 0x18, 0x18}; + +static Pixmap +CreateQuestionPixmap (unsigned *widthp, unsigned *heightp) +{ + *widthp = questionmark_width; + *heightp = questionmark_height; + if (Scr->tbpm.question == None) { + Scr->tbpm.question = XCreateBitmapFromData (dpy, Scr->Root, + questionmark_bits, + questionmark_width, + questionmark_height); + } + /* + * this must succeed or else we are in deep trouble elsewhere + */ + return Scr->tbpm.question; +} + + +static Pixmap +CreateMenuPixmap (unsigned *widthp, unsigned *heightp) +{ + return CreateMenuIcon (Scr->TBInfo.width - Scr->TBInfo.border * 2, + widthp,heightp); +} + +Pixmap +CreateMenuIcon (int height, unsigned *widthp, unsigned *heightp) +{ + int h, w; + int ih, iw; + int ix, iy; + int mh, mw; + int tw, th; + int lw, lh; + int lx, ly; + int lines, dly; + int off; + int bw; + + h = height; + w = h * 7 / 8; + if (h < 1) + h = 1; + if (w < 1) + w = 1; + *widthp = w; + *heightp = h; + if (Scr->tbpm.menu == None) { + Pixmap pix; + GC gc; + + pix = Scr->tbpm.menu = XCreatePixmap (dpy, Scr->Root, w, h, 1); + gc = XCreateGC (dpy, pix, 0L, NULL); + XSetForeground (dpy, gc, 0L); + XFillRectangle (dpy, pix, gc, 0, 0, w, h); + XSetForeground (dpy, gc, 1L); + ix = 1; + iy = 1; + ih = h - iy * 2; + iw = w - ix * 2; + off = ih / 8; + mh = ih - off; + mw = iw - off; + bw = mh / 16; + if (bw == 0 && mw > 2) + bw = 1; + tw = mw - bw * 2; + th = mh - bw * 2; + XFillRectangle (dpy, pix, gc, ix, iy, mw, mh); + XFillRectangle (dpy, pix, gc, ix + iw - mw, iy + ih - mh, mw, mh); + XSetForeground (dpy, gc, 0L); + XFillRectangle (dpy, pix, gc, ix+bw, iy+bw, tw, th); + XSetForeground (dpy, gc, 1L); + lw = tw / 2; + if ((tw & 1) ^ (lw & 1)) + lw++; + lx = ix + bw + (tw - lw) / 2; + + lh = th / 2 - bw; + if ((lh & 1) ^ ((th - bw) & 1)) + lh++; + ly = iy + bw + (th - bw - lh) / 2; + + lines = 3; + if ((lh & 1) && lh < 6) + { + lines--; + } + dly = lh / (lines - 1); + while (lines--) + { + XFillRectangle (dpy, pix, gc, lx, ly, lw, bw); + ly += dly; + } + XFreeGC (dpy, gc); + } + return Scr->tbpm.menu; +} + +void +Bell(int type, int percent, Window win) +{ +#ifdef XKB + XkbStdBell(dpy, win, percent, type); +#else + XBell(dpy, percent); +#endif + return; +} diff --git a/app/twm/src/util.h b/app/twm/src/util.h new file mode 100644 index 000000000..4cbd0915f --- /dev/null +++ b/app/twm/src/util.h @@ -0,0 +1,115 @@ +/*****************************************************************************/ +/* + +Copyright 1989, 1998 The Open Group + +Permission to use, copy, modify, distribute, and sell this software and its +documentation for any purpose is hereby granted without fee, provided that +the above copyright notice appear in all copies and that both that +copyright notice and this permission notice appear in supporting +documentation. + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the name of The Open Group shall not be +used in advertising or otherwise to promote the sale, use or other dealings +in this Software without prior written authorization from The Open Group. + +*/ +/** Copyright 1988 by Evans & Sutherland Computer Corporation, **/ +/** Salt Lake City, Utah **/ +/** Cambridge, Massachusetts **/ +/** **/ +/** All Rights Reserved **/ +/** **/ +/** Permission to use, copy, modify, and distribute this software and **/ +/** its documentation for any purpose and without fee is hereby **/ +/** granted, provided that the above copyright notice appear in all **/ +/** copies and that both that copyright notice and this permis- **/ +/** sion notice appear in supporting documentation, and that the **/ +/** name of Evans & Sutherland not be used in advertising **/ +/** in publicity pertaining to distribution of the software without **/ +/** specific, written prior permission. **/ +/** **/ +/** EVANS & SUTHERLAND DISCLAIMs ALL WARRANTIES WITH REGARD **/ +/** TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANT- **/ +/** ABILITY AND FITNESS, IN NO EVENT SHALL EVANS & SUTHERLAND **/ +/** BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAM- **/ +/** AGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA **/ +/** OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER **/ +/** TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE **/ +/** OR PERFORMANCE OF THIS SOFTWARE. **/ +/*****************************************************************************/ +/* $XFree86: xc/programs/twm/util.h,v 1.6 2001/01/17 23:45:08 dawes Exp $ */ + + +/*********************************************************************** + * + * $Xorg: util.h,v 1.4 2001/02/09 02:05:37 xorgcvs Exp $ + * + * utility routines header file + * + * 28-Oct-87 Thomas E. LaStrange File created + * + ***********************************************************************/ + +#ifndef _UTIL_ +#define _UTIL_ + +extern void MoveOutline ( Window root, int x, int y, int width, int height, + int bw, int th ); +extern void Zoom ( Window wf, Window wt ); +extern char * ExpandFilename ( char *name ); +extern void GetUnknownIcon ( char *name ); +extern Pixmap FindBitmap ( char *name, unsigned int *widthp, + unsigned int *heightp ); +extern Pixmap GetBitmap ( char *name ); +extern void InsertRGBColormap ( Atom a, XStandardColormap *maps, int nmaps, + Bool replace ); +extern void RemoveRGBColormap ( Atom a ); +extern void LocateStandardColormaps ( void ); +extern void GetColor ( int kind, Pixel *what, char *name ); +extern void GetColorValue ( int kind, XColor *what, char *name ); +extern void GetFont ( MyFont *font ); +extern int MyFont_TextWidth( MyFont *font, char *string, int len); +extern void MyFont_DrawImageString( Display *dpy, Drawable d, MyFont *font, + GC gc, int x, int y, char * string, + int len); +extern void MyFont_DrawString( Display *dpy, Drawable d, MyFont *font, + GC gc, int x, int y, char * string, int len); +extern void MyFont_ChangeGC( unsigned long fix_fore, unsigned long fix_back, + MyFont *fix_font); +extern Status I18N_FetchName( Display *dpy, Window win, char **winname); +extern Status I18N_GetIconName( Display *dpy, Window win, char **iconname); +extern void SetFocus ( TwmWindow *tmp_win, Time time ); +extern void Bell ( int type, int percent, Window win ); + +extern int HotX, HotY; + +#define WM_BELL 0 +#define MINOR_ERROR_BELL 1 +#define MAJOR_ERROR_BELL 2 +#define INFO_BELL 3 +#define NUM_BELLS 4 + +#define QUIET_BELL -100 +#define MODERATE_BELL 0 +#define LOUD_BELL 100 + +#ifdef XKB +#include +#else +#define XkbBI_Info 0 +#define XkbBI_MinorError 1 +#define XkbBI_MajorError 2 +#endif + +#endif /* _UTIL_ */ diff --git a/app/twm/src/version.c b/app/twm/src/version.c new file mode 100644 index 000000000..ecd0d71d3 --- /dev/null +++ b/app/twm/src/version.c @@ -0,0 +1,54 @@ +/*****************************************************************************/ +/* + +Copyright 1989, 1998 The Open Group + +Permission to use, copy, modify, distribute, and sell this software and its +documentation for any purpose is hereby granted without fee, provided that +the above copyright notice appear in all copies and that both that +copyright notice and this permission notice appear in supporting +documentation. + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the name of The Open Group shall not be +used in advertising or otherwise to promote the sale, use or other dealings +in this Software without prior written authorization from The Open Group. + +*/ +/** Copyright 1988 by Evans & Sutherland Computer Corporation, **/ +/** Salt Lake City, Utah **/ +/** Cambridge, Massachusetts **/ +/** **/ +/** All Rights Reserved **/ +/** **/ +/** Permission to use, copy, modify, and distribute this software and **/ +/** its documentation for any purpose and without fee is hereby **/ +/** granted, provided that the above copyright notice appear in all **/ +/** copies and that both that copyright notice and this permis- **/ +/** sion notice appear in supporting documentation, and that the **/ +/** name of Evans & Sutherland not be used in advertising **/ +/** in publicity pertaining to distribution of the software without **/ +/** specific, written prior permission. **/ +/** **/ +/** EVANS & SUTHERLAND DISCLAIMs ALL WARRANTIES WITH REGARD **/ +/** TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANT- **/ +/** ABILITY AND FITNESS, IN NO EVENT SHALL EVANS & SUTHERLAND **/ +/** BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAM- **/ +/** AGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA **/ +/** OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER **/ +/** TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE **/ +/** OR PERFORMANCE OF THIS SOFTWARE. **/ +/*****************************************************************************/ + +/* $Xorg: version.c,v 1.4 2001/02/09 02:05:37 xorgcvs Exp $ */ +char *Version = XVENDORNAME", "XORG_RELEASE; + diff --git a/app/twm/src/version.h b/app/twm/src/version.h new file mode 100644 index 000000000..d23219067 --- /dev/null +++ b/app/twm/src/version.h @@ -0,0 +1,67 @@ +/*****************************************************************************/ +/* + +Copyright 1989, 1998 The Open Group + +Permission to use, copy, modify, distribute, and sell this software and its +documentation for any purpose is hereby granted without fee, provided that +the above copyright notice appear in all copies and that both that +copyright notice and this permission notice appear in supporting +documentation. + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the name of The Open Group shall not be +used in advertising or otherwise to promote the sale, use or other dealings +in this Software without prior written authorization from The Open Group. + +*/ +/** Copyright 1988 by Evans & Sutherland Computer Corporation, **/ +/** Salt Lake City, Utah **/ +/** Cambridge, Massachusetts **/ +/** **/ +/** All Rights Reserved **/ +/** **/ +/** Permission to use, copy, modify, and distribute this software and **/ +/** its documentation for any purpose and without fee is hereby **/ +/** granted, provided that the above copyright notice appear in all **/ +/** copies and that both that copyright notice and this permis- **/ +/** sion notice appear in supporting documentation, and that the **/ +/** name of Evans & Sutherland not be used in advertising **/ +/** in publicity pertaining to distribution of the software without **/ +/** specific, written prior permission. **/ +/** **/ +/** EVANS & SUTHERLAND DISCLAIMs ALL WARRANTIES WITH REGARD **/ +/** TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANT- **/ +/** ABILITY AND FITNESS, IN NO EVENT SHALL EVANS & SUTHERLAND **/ +/** BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAM- **/ +/** AGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA **/ +/** OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER **/ +/** TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE **/ +/** OR PERFORMANCE OF THIS SOFTWARE. **/ +/*****************************************************************************/ + +/********************************************************************** + * + * $Xorg: version.h,v 1.4 2001/02/09 02:05:37 xorgcvs Exp $ + * + * TWM version externs + * + * 8-Apr-88 Tom LaStrange Initial Version. + * + **********************************************************************/ + +#ifndef _VERSION_ +#define _VERSION_ + +extern char *Version; + +#endif /* _VERSION_ */ diff --git a/app/xf86dga/AUTHORS b/app/xf86dga/AUTHORS new file mode 100644 index 000000000..e69de29bb diff --git a/app/xf86dga/COPYING b/app/xf86dga/COPYING new file mode 100644 index 000000000..7f33cbfd2 --- /dev/null +++ b/app/xf86dga/COPYING @@ -0,0 +1,12 @@ +This is a stub file. This package has not yet had its complete licensing +information compiled. Please see the individual source files for details on +your rights to use and modify this software. + +Please submit updated COPYING files to the Xorg bugzilla: + +https://bugs.freedesktop.org/enter_bug.cgi?product=xorg + +All licensing questions regarding this software should be directed at the +Xorg mailing list: + +http://lists.freedesktop.org/mailman/listinfo/xorg diff --git a/app/xf86dga/ChangeLog b/app/xf86dga/ChangeLog new file mode 100644 index 000000000..47eb06962 --- /dev/null +++ b/app/xf86dga/ChangeLog @@ -0,0 +1,40 @@ +2006-06-20 Matthieu Herrb + + * dga.c: + Check setuid() return value. Bugzilla #7116. + +2005-12-20 Kevin E. Martin + + * configure.ac: + Update package version for X11R7 release. + +2005-12-14 Kevin E. Martin + + * configure.ac: + Update package version number for final X11R7 release candidate. + +2005-12-06 Kevin E. Martin + + * Makefile.am: + Change *man_SOURCES ==> *man_PRE to fix autotools warnings. + +2005-12-03 Kevin E. Martin + + * configure.ac: + Update package version number for X11R7 RC3 release. + +2005-11-09 Kevin E. Martin + + * configure.ac: + Update package version number for X11R7 RC2 release. + +2005-11-01 Kevin E. Martin + + * configure.ac: + Update pkgcheck depedencies to work with separate build roots. + +2005-10-18 Kevin E. Martin + + * configure.ac: + Update package version number for RC1 release. + diff --git a/app/xf86dga/INSTALL b/app/xf86dga/INSTALL new file mode 100644 index 000000000..e69de29bb diff --git a/app/xf86dga/Makefile.am b/app/xf86dga/Makefile.am new file mode 100644 index 000000000..479ae686c --- /dev/null +++ b/app/xf86dga/Makefile.am @@ -0,0 +1,63 @@ +# +# Copyright 2005 Red Hat, Inc. +# +# Permission to use, copy, modify, distribute, and sell this software and its +# documentation for any purpose is hereby granted without fee, provided that +# the above copyright notice appear in all copies and that both that +# copyright notice and this permission notice appear in supporting +# documentation, and that the name of Red Hat not be used in +# advertising or publicity pertaining to distribution of the software without +# specific, written prior permission. Red Hat makes no +# representations about the suitability of this software for any purpose. It +# is provided "as is" without express or implied warranty. +# +# RED HAT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, +# INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO +# EVENT SHALL RED HAT BE LIABLE FOR ANY SPECIAL, INDIRECT OR +# CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, +# DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER +# TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +# PERFORMANCE OF THIS SOFTWARE. + +bin_PROGRAMS = dga + +dga_CFLAGS = $(XF86DGA_CFLAGS) +dga_LDADD = $(XF86DGA_LIBS) + +dga_SOURCES = \ + dga.c + +appman_PRE = \ + dga.man + + +appmandir = $(APP_MAN_DIR) + +appman_DATA = $(appman_PRE:man=@APP_MAN_SUFFIX@) + +EXTRA_DIST = $(appman_PRE) +CLEANFILES = $(appman_DATA) + +SED = sed + +# Strings to replace in man pages +XORGRELSTRING = @PACKAGE_STRING@ + XORGMANNAME = X Version 11 + +MAN_SUBSTS = \ + -e 's|__vendorversion__|"$(XORGRELSTRING)" "$(XORGMANNAME)"|' \ + -e 's|__xorgversion__|"$(XORGRELSTRING)" "$(XORGMANNAME)"|' \ + -e 's|__xservername__|Xorg|g' \ + -e 's|__xconfigfile__|xorg.conf|g' \ + -e 's|__projectroot__|$(prefix)|g' \ + -e 's|__apploaddir__|$(appdefaultdir)|' \ + -e 's|__appmansuffix__|$(APP_MAN_SUFFIX)|g' \ + -e 's|__libmansuffix__|$(LIB_MAN_SUFFIX)|g' \ + -e 's|__adminmansuffix__|$(ADMIN_MAN_SUFFIX)|g' \ + -e 's|__miscmansuffix__|$(MISC_MAN_SUFFIX)|g' \ + -e 's|__filemansuffix__|$(FILE_MAN_SUFFIX)|g' + +SUFFIXES = .$(APP_MAN_SUFFIX) .man + +.man.$(APP_MAN_SUFFIX): + sed $(MAN_SUBSTS) < $< > $@ diff --git a/app/xf86dga/Makefile.in b/app/xf86dga/Makefile.in new file mode 100644 index 000000000..c800d4d49 --- /dev/null +++ b/app/xf86dga/Makefile.in @@ -0,0 +1,655 @@ +# Makefile.in generated by automake 1.9.6 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005 Free Software Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +# +# Copyright 2005 Red Hat, Inc. +# +# Permission to use, copy, modify, distribute, and sell this software and its +# documentation for any purpose is hereby granted without fee, provided that +# the above copyright notice appear in all copies and that both that +# copyright notice and this permission notice appear in supporting +# documentation, and that the name of Red Hat not be used in +# advertising or publicity pertaining to distribution of the software without +# specific, written prior permission. Red Hat makes no +# representations about the suitability of this software for any purpose. It +# is provided "as is" without express or implied warranty. +# +# RED HAT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, +# INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO +# EVENT SHALL RED HAT BE LIABLE FOR ANY SPECIAL, INDIRECT OR +# CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, +# DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER +# TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +# PERFORMANCE OF THIS SOFTWARE. + + +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +top_builddir = . +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +INSTALL = @INSTALL@ +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +bin_PROGRAMS = dga$(EXEEXT) +DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \ + $(srcdir)/Makefile.in $(srcdir)/config.h.in \ + $(top_srcdir)/configure AUTHORS COPYING ChangeLog INSTALL NEWS \ + compile config.guess config.sub depcomp install-sh missing +subdir = . +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ + configure.lineno configure.status.lineno +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = config.h +CONFIG_CLEAN_FILES = +am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(appmandir)" +binPROGRAMS_INSTALL = $(INSTALL_PROGRAM) +PROGRAMS = $(bin_PROGRAMS) +am_dga_OBJECTS = dga-dga.$(OBJEXT) +dga_OBJECTS = $(am_dga_OBJECTS) +am__DEPENDENCIES_1 = +dga_DEPENDENCIES = $(am__DEPENDENCIES_1) +DEFAULT_INCLUDES = -I. -I$(srcdir) -I. +depcomp = $(SHELL) $(top_srcdir)/depcomp +am__depfiles_maybe = depfiles +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +CCLD = $(CC) +LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ +SOURCES = $(dga_SOURCES) +DIST_SOURCES = $(dga_SOURCES) +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = `echo $$p | sed -e 's|^.*/||'`; +appmanDATA_INSTALL = $(INSTALL_DATA) +DATA = $(appman_DATA) +ETAGS = etags +CTAGS = ctags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +distdir = $(PACKAGE)-$(VERSION) +top_distdir = $(distdir) +am__remove_distdir = \ + { test ! -d $(distdir) \ + || { find $(distdir) -type d ! -perm -200 -exec chmod u+w {} ';' \ + && rm -fr $(distdir); }; } +DIST_ARCHIVES = $(distdir).tar.gz $(distdir).tar.bz2 +GZIP_ENV = --best +distuninstallcheck_listfiles = find . -type f -print +distcleancheck_listfiles = find . -type f -print +ACLOCAL = @ACLOCAL@ +ADMIN_MAN_DIR = @ADMIN_MAN_DIR@ +ADMIN_MAN_SUFFIX = @ADMIN_MAN_SUFFIX@ +AMDEP_FALSE = @AMDEP_FALSE@ +AMDEP_TRUE = @AMDEP_TRUE@ +AMTAR = @AMTAR@ +APP_MAN_DIR = @APP_MAN_DIR@ +APP_MAN_SUFFIX = @APP_MAN_SUFFIX@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPPFLAGS = @CPPFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DRIVER_MAN_DIR = @DRIVER_MAN_DIR@ +DRIVER_MAN_SUFFIX = @DRIVER_MAN_SUFFIX@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EXEEXT = @EXEEXT@ +FILE_MAN_DIR = @FILE_MAN_DIR@ +FILE_MAN_SUFFIX = @FILE_MAN_SUFFIX@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIB_MAN_DIR = @LIB_MAN_DIR@ +LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@ +LTLIBOBJS = @LTLIBOBJS@ +MAINT = @MAINT@ +MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@ +MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@ +MAKEINFO = @MAKEINFO@ +MISC_MAN_DIR = @MISC_MAN_DIR@ +MISC_MAN_SUFFIX = @MISC_MAN_SUFFIX@ +OBJEXT = @OBJEXT@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PKG_CONFIG = @PKG_CONFIG@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +VERSION = @VERSION@ +XF86DGA_CFLAGS = @XF86DGA_CFLAGS@ +XF86DGA_LIBS = @XF86DGA_LIBS@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_STRIP = @ac_ct_STRIP@ +ac_pt_PKG_CONFIG = @ac_pt_PKG_CONFIG@ +am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ +am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +datadir = @datadir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +dga_CFLAGS = $(XF86DGA_CFLAGS) +dga_LDADD = $(XF86DGA_LIBS) +dga_SOURCES = \ + dga.c + +appman_PRE = \ + dga.man + +appmandir = $(APP_MAN_DIR) +appman_DATA = $(appman_PRE:man=@APP_MAN_SUFFIX@) +EXTRA_DIST = $(appman_PRE) +CLEANFILES = $(appman_DATA) +SED = sed + +# Strings to replace in man pages +XORGRELSTRING = @PACKAGE_STRING@ +XORGMANNAME = X Version 11 +MAN_SUBSTS = \ + -e 's|__vendorversion__|"$(XORGRELSTRING)" "$(XORGMANNAME)"|' \ + -e 's|__xorgversion__|"$(XORGRELSTRING)" "$(XORGMANNAME)"|' \ + -e 's|__xservername__|Xorg|g' \ + -e 's|__xconfigfile__|xorg.conf|g' \ + -e 's|__projectroot__|$(prefix)|g' \ + -e 's|__apploaddir__|$(appdefaultdir)|' \ + -e 's|__appmansuffix__|$(APP_MAN_SUFFIX)|g' \ + -e 's|__libmansuffix__|$(LIB_MAN_SUFFIX)|g' \ + -e 's|__adminmansuffix__|$(ADMIN_MAN_SUFFIX)|g' \ + -e 's|__miscmansuffix__|$(MISC_MAN_SUFFIX)|g' \ + -e 's|__filemansuffix__|$(FILE_MAN_SUFFIX)|g' + +SUFFIXES = .$(APP_MAN_SUFFIX) .man +all: config.h + $(MAKE) $(AM_MAKEFLAGS) all-am + +.SUFFIXES: +.SUFFIXES: .$(APP_MAN_SUFFIX) .man .c .o .obj +am--refresh: + @: +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + echo ' cd $(srcdir) && $(AUTOMAKE) --gnu '; \ + cd $(srcdir) && $(AUTOMAKE) --gnu \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu Makefile'; \ + cd $(top_srcdir) && \ + $(AUTOMAKE) --gnu Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + echo ' $(SHELL) ./config.status'; \ + $(SHELL) ./config.status;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + $(SHELL) ./config.status --recheck + +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(srcdir) && $(AUTOCONF) +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) + +config.h: stamp-h1 + @if test ! -f $@; then \ + rm -f stamp-h1; \ + $(MAKE) stamp-h1; \ + else :; fi + +stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status + @rm -f stamp-h1 + cd $(top_builddir) && $(SHELL) ./config.status config.h +$(srcdir)/config.h.in: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(top_srcdir) && $(AUTOHEADER) + rm -f stamp-h1 + touch $@ + +distclean-hdr: + -rm -f config.h stamp-h1 +install-binPROGRAMS: $(bin_PROGRAMS) + @$(NORMAL_INSTALL) + test -z "$(bindir)" || $(mkdir_p) "$(DESTDIR)$(bindir)" + @list='$(bin_PROGRAMS)'; for p in $$list; do \ + p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ + if test -f $$p \ + ; then \ + f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \ + echo " $(INSTALL_PROGRAM_ENV) $(binPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(bindir)/$$f'"; \ + $(INSTALL_PROGRAM_ENV) $(binPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(bindir)/$$f" || exit 1; \ + else :; fi; \ + done + +uninstall-binPROGRAMS: + @$(NORMAL_UNINSTALL) + @list='$(bin_PROGRAMS)'; for p in $$list; do \ + f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \ + echo " rm -f '$(DESTDIR)$(bindir)/$$f'"; \ + rm -f "$(DESTDIR)$(bindir)/$$f"; \ + done + +clean-binPROGRAMS: + -test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS) +dga$(EXEEXT): $(dga_OBJECTS) $(dga_DEPENDENCIES) + @rm -f dga$(EXEEXT) + $(LINK) $(dga_LDFLAGS) $(dga_OBJECTS) $(dga_LDADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dga-dga.Po@am__quote@ + +.c.o: +@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c $< + +.c.obj: +@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` + +dga-dga.o: dga.c +@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(dga_CFLAGS) $(CFLAGS) -MT dga-dga.o -MD -MP -MF "$(DEPDIR)/dga-dga.Tpo" -c -o dga-dga.o `test -f 'dga.c' || echo '$(srcdir)/'`dga.c; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/dga-dga.Tpo" "$(DEPDIR)/dga-dga.Po"; else rm -f "$(DEPDIR)/dga-dga.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='dga.c' object='dga-dga.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(dga_CFLAGS) $(CFLAGS) -c -o dga-dga.o `test -f 'dga.c' || echo '$(srcdir)/'`dga.c + +dga-dga.obj: dga.c +@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(dga_CFLAGS) $(CFLAGS) -MT dga-dga.obj -MD -MP -MF "$(DEPDIR)/dga-dga.Tpo" -c -o dga-dga.obj `if test -f 'dga.c'; then $(CYGPATH_W) 'dga.c'; else $(CYGPATH_W) '$(srcdir)/dga.c'; fi`; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/dga-dga.Tpo" "$(DEPDIR)/dga-dga.Po"; else rm -f "$(DEPDIR)/dga-dga.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='dga.c' object='dga-dga.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(dga_CFLAGS) $(CFLAGS) -c -o dga-dga.obj `if test -f 'dga.c'; then $(CYGPATH_W) 'dga.c'; else $(CYGPATH_W) '$(srcdir)/dga.c'; fi` +uninstall-info-am: +install-appmanDATA: $(appman_DATA) + @$(NORMAL_INSTALL) + test -z "$(appmandir)" || $(mkdir_p) "$(DESTDIR)$(appmandir)" + @list='$(appman_DATA)'; for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + f=$(am__strip_dir) \ + echo " $(appmanDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(appmandir)/$$f'"; \ + $(appmanDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(appmandir)/$$f"; \ + done + +uninstall-appmanDATA: + @$(NORMAL_UNINSTALL) + @list='$(appman_DATA)'; for p in $$list; do \ + f=$(am__strip_dir) \ + echo " rm -f '$(DESTDIR)$(appmandir)/$$f'"; \ + rm -f "$(DESTDIR)$(appmandir)/$$f"; \ + done + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$tags $$unique; \ + fi +ctags: CTAGS +CTAGS: $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + test -z "$(CTAGS_ARGS)$$tags$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$tags $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && cd $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) $$here + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + $(am__remove_distdir) + mkdir $(distdir) + @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ + list='$(DISTFILES)'; for file in $$list; do \ + case $$file in \ + $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ + $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ + esac; \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test "$$dir" != "$$file" && test "$$dir" != "."; then \ + dir="/$$dir"; \ + $(mkdir_p) "$(distdir)$$dir"; \ + else \ + dir=''; \ + fi; \ + if test -d $$d/$$file; then \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ + fi; \ + cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ + else \ + test -f $(distdir)/$$file \ + || cp -p $$d/$$file $(distdir)/$$file \ + || exit 1; \ + fi; \ + done + -find $(distdir) -type d ! -perm -777 -exec chmod a+rwx {} \; -o \ + ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \ + ! -type d ! -perm -400 -exec chmod a+r {} \; -o \ + ! -type d ! -perm -444 -exec $(SHELL) $(install_sh) -c -m a+r {} {} \; \ + || chmod -R a+r $(distdir) +dist-gzip: distdir + tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz + $(am__remove_distdir) +dist-bzip2: distdir + tardir=$(distdir) && $(am__tar) | bzip2 -9 -c >$(distdir).tar.bz2 + $(am__remove_distdir) + +dist-tarZ: distdir + tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z + $(am__remove_distdir) + +dist-shar: distdir + shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz + $(am__remove_distdir) + +dist-zip: distdir + -rm -f $(distdir).zip + zip -rq $(distdir).zip $(distdir) + $(am__remove_distdir) + +dist dist-all: distdir + tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz + tardir=$(distdir) && $(am__tar) | bzip2 -9 -c >$(distdir).tar.bz2 + $(am__remove_distdir) + +# This target untars the dist file and tries a VPATH configuration. Then +# it guarantees that the distribution is self-contained by making another +# tarfile. +distcheck: dist + case '$(DIST_ARCHIVES)' in \ + *.tar.gz*) \ + GZIP=$(GZIP_ENV) gunzip -c $(distdir).tar.gz | $(am__untar) ;;\ + *.tar.bz2*) \ + bunzip2 -c $(distdir).tar.bz2 | $(am__untar) ;;\ + *.tar.Z*) \ + uncompress -c $(distdir).tar.Z | $(am__untar) ;;\ + *.shar.gz*) \ + GZIP=$(GZIP_ENV) gunzip -c $(distdir).shar.gz | unshar ;;\ + *.zip*) \ + unzip $(distdir).zip ;;\ + esac + chmod -R a-w $(distdir); chmod a+w $(distdir) + mkdir $(distdir)/_build + mkdir $(distdir)/_inst + chmod a-w $(distdir) + dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \ + && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ + && cd $(distdir)/_build \ + && ../configure --srcdir=.. --prefix="$$dc_install_base" \ + $(DISTCHECK_CONFIGURE_FLAGS) \ + && $(MAKE) $(AM_MAKEFLAGS) \ + && $(MAKE) $(AM_MAKEFLAGS) dvi \ + && $(MAKE) $(AM_MAKEFLAGS) check \ + && $(MAKE) $(AM_MAKEFLAGS) install \ + && $(MAKE) $(AM_MAKEFLAGS) installcheck \ + && $(MAKE) $(AM_MAKEFLAGS) uninstall \ + && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \ + distuninstallcheck \ + && chmod -R a-w "$$dc_install_base" \ + && ({ \ + (cd ../.. && umask 077 && mkdir "$$dc_destdir") \ + && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \ + && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \ + && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \ + distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \ + } || { rm -rf "$$dc_destdir"; exit 1; }) \ + && rm -rf "$$dc_destdir" \ + && $(MAKE) $(AM_MAKEFLAGS) dist \ + && rm -rf $(DIST_ARCHIVES) \ + && $(MAKE) $(AM_MAKEFLAGS) distcleancheck + $(am__remove_distdir) + @(echo "$(distdir) archives ready for distribution: "; \ + list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \ + sed -e '1{h;s/./=/g;p;x;}' -e '$${p;x;}' +distuninstallcheck: + @cd $(distuninstallcheck_dir) \ + && test `$(distuninstallcheck_listfiles) | wc -l` -le 1 \ + || { echo "ERROR: files left after uninstall:" ; \ + if test -n "$(DESTDIR)"; then \ + echo " (check DESTDIR support)"; \ + fi ; \ + $(distuninstallcheck_listfiles) ; \ + exit 1; } >&2 +distcleancheck: distclean + @if test '$(srcdir)' = . ; then \ + echo "ERROR: distcleancheck can only run from a VPATH build" ; \ + exit 1 ; \ + fi + @test `$(distcleancheck_listfiles) | wc -l` -eq 0 \ + || { echo "ERROR: files left in build directory after distclean:" ; \ + $(distcleancheck_listfiles) ; \ + exit 1; } >&2 +check-am: all-am +check: check-am +all-am: Makefile $(PROGRAMS) $(DATA) config.h +installdirs: + for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(appmandir)"; do \ + test -z "$$dir" || $(mkdir_p) "$$dir"; \ + done +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-binPROGRAMS clean-generic mostlyclean-am + +distclean: distclean-am + -rm -f $(am__CONFIG_DISTCLEAN_FILES) + -rm -rf ./$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-hdr distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +info: info-am + +info-am: + +install-data-am: install-appmanDATA + +install-exec-am: install-binPROGRAMS + +install-info: install-info-am + +install-man: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -f $(am__CONFIG_DISTCLEAN_FILES) + -rm -rf $(top_srcdir)/autom4te.cache + -rm -rf ./$(DEPDIR) + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-appmanDATA uninstall-binPROGRAMS \ + uninstall-info-am + +.PHONY: CTAGS GTAGS all all-am am--refresh check check-am clean \ + clean-binPROGRAMS clean-generic ctags dist dist-all dist-bzip2 \ + dist-gzip dist-shar dist-tarZ dist-zip distcheck distclean \ + distclean-compile distclean-generic distclean-hdr \ + distclean-tags distcleancheck distdir distuninstallcheck dvi \ + dvi-am html html-am info info-am install install-am \ + install-appmanDATA install-binPROGRAMS install-data \ + install-data-am install-exec install-exec-am install-info \ + install-info-am install-man install-strip installcheck \ + installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-compile \ + mostlyclean-generic pdf pdf-am ps ps-am tags uninstall \ + uninstall-am uninstall-appmanDATA uninstall-binPROGRAMS \ + uninstall-info-am + + +.man.$(APP_MAN_SUFFIX): + sed $(MAN_SUBSTS) < $< > $@ +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/app/xf86dga/NEWS b/app/xf86dga/NEWS new file mode 100644 index 000000000..e69de29bb diff --git a/app/xf86dga/README b/app/xf86dga/README new file mode 100644 index 000000000..e69de29bb diff --git a/app/xf86dga/aclocal.m4 b/app/xf86dga/aclocal.m4 new file mode 100644 index 000000000..8fa6fea6d --- /dev/null +++ b/app/xf86dga/aclocal.m4 @@ -0,0 +1,1450 @@ +# generated automatically by aclocal 1.9.6 -*- Autoconf -*- + +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, +# 2005 Free Software Foundation, Inc. +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +# pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*- +# +# Copyright © 2004 Scott James Remnant . +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +# PKG_PROG_PKG_CONFIG([MIN-VERSION]) +# ---------------------------------- +AC_DEFUN([PKG_PROG_PKG_CONFIG], +[m4_pattern_forbid([^_?PKG_[A-Z_]+$]) +m4_pattern_allow([^PKG_CONFIG(_PATH)?$]) +AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])dnl +if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then + AC_PATH_TOOL([PKG_CONFIG], [pkg-config]) +fi +if test -n "$PKG_CONFIG"; then + _pkg_min_version=m4_default([$1], [0.9.0]) + AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version]) + if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then + AC_MSG_RESULT([yes]) + else + AC_MSG_RESULT([no]) + PKG_CONFIG="" + fi + +fi[]dnl +])# PKG_PROG_PKG_CONFIG + +# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) +# +# Check to see whether a particular set of modules exists. Similar +# to PKG_CHECK_MODULES(), but does not set variables or print errors. +# +# +# Similar to PKG_CHECK_MODULES, make sure that the first instance of +# this or PKG_CHECK_MODULES is called, or make sure to call +# PKG_CHECK_EXISTS manually +# -------------------------------------------------------------- +AC_DEFUN([PKG_CHECK_EXISTS], +[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl +if test -n "$PKG_CONFIG" && \ + AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then + m4_ifval([$2], [$2], [:]) +m4_ifvaln([$3], [else + $3])dnl +fi]) + + +# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES]) +# --------------------------------------------- +m4_define([_PKG_CONFIG], +[if test -n "$PKG_CONFIG"; then + if test -n "$$1"; then + pkg_cv_[]$1="$$1" + else + PKG_CHECK_EXISTS([$3], + [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`], + [pkg_failed=yes]) + fi +else + pkg_failed=untried +fi[]dnl +])# _PKG_CONFIG + +# _PKG_SHORT_ERRORS_SUPPORTED +# ----------------------------- +AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED], +[AC_REQUIRE([PKG_PROG_PKG_CONFIG]) +if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then + _pkg_short_errors_supported=yes +else + _pkg_short_errors_supported=no +fi[]dnl +])# _PKG_SHORT_ERRORS_SUPPORTED + + +# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND], +# [ACTION-IF-NOT-FOUND]) +# +# +# Note that if there is a possibility the first call to +# PKG_CHECK_MODULES might not happen, you should be sure to include an +# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac +# +# +# -------------------------------------------------------------- +AC_DEFUN([PKG_CHECK_MODULES], +[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl +AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl +AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl + +pkg_failed=no +AC_MSG_CHECKING([for $1]) + +_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2]) +_PKG_CONFIG([$1][_LIBS], [libs], [$2]) + +m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS +and $1[]_LIBS to avoid the need to call pkg-config. +See the pkg-config man page for more details.]) + +if test $pkg_failed = yes; then + _PKG_SHORT_ERRORS_SUPPORTED + if test $_pkg_short_errors_supported = yes; then + $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "$2"` + else + $1[]_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "$2"` + fi + # Put the nasty error message in config.log where it belongs + echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD + + ifelse([$4], , [AC_MSG_ERROR(dnl +[Package requirements ($2) were not met: + +$$1_PKG_ERRORS + +Consider adjusting the PKG_CONFIG_PATH environment variable if you +installed software in a non-standard prefix. + +_PKG_TEXT +])], + [AC_MSG_RESULT([no]) + $4]) +elif test $pkg_failed = untried; then + ifelse([$4], , [AC_MSG_FAILURE(dnl +[The pkg-config script could not be found or is too old. Make sure it +is in your PATH or set the PKG_CONFIG environment variable to the full +path to pkg-config. + +_PKG_TEXT + +To get pkg-config, see .])], + [$4]) +else + $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS + $1[]_LIBS=$pkg_cv_[]$1[]_LIBS + AC_MSG_RESULT([yes]) + ifelse([$3], , :, [$3]) +fi[]dnl +])# PKG_CHECK_MODULES + +dnl +dnl Copyright 2005-2006 Sun Microsystems, Inc. All rights reserved. +dnl +dnl Permission is hereby granted, free of charge, to any person obtaining a +dnl copy of this software and associated documentation files (the +dnl "Software"), to deal in the Software without restriction, including +dnl without limitation the rights to use, copy, modify, merge, publish, +dnl distribute, and/or sell copies of the Software, and to permit persons +dnl to whom the Software is furnished to do so, provided that the above +dnl copyright notice(s) and this permission notice appear in all copies of +dnl the Software and that both the above copyright notice(s) and this +dnl permission notice appear in supporting documentation. +dnl +dnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +dnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +dnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT +dnl OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR +dnl HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL +dnl INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING +dnl FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, +dnl NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION +dnl WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +dnl +dnl Except as contained in this notice, the name of a copyright holder +dnl shall not be used in advertising or otherwise to promote the sale, use +dnl or other dealings in this Software without prior written authorization +dnl of the copyright holder. + +# XORG_MACROS_VERSION(required-version) +# ------------------------------------- +# Minimum version: 1.1.0 +# +# If you're using a macro added in Version 1.1 or newer, include this in +# your configure.ac with the minimum required version, such as: +# XORG_MACROS_VERSION(1.1) +# +# To force at least a version with this macro defined, also add: +# m4_ifndef([XORG_MACROS_VERSION], [AC_FATAL([must install xorg-macros 1.1 or later before running autoconf/autogen])]) +# +# +# See the "minimum version" comment for each macro you use to see what +# version you require. +AC_DEFUN([XORG_MACROS_VERSION],[ + [XORG_MACROS_needed_version=$1 + XORG_MACROS_needed_major=`echo $XORG_MACROS_needed_version | sed 's/\..*$//'` + XORG_MACROS_needed_minor=`echo $XORG_MACROS_needed_version | sed -e 's/^[0-9]*\.//' -e 's/\..*$//'`] + AC_MSG_CHECKING([if xorg-macros used to generate configure is at least ${XORG_MACROS_needed_major}.${XORG_MACROS_needed_minor}]) + [XORG_MACROS_version=1.1.1 + XORG_MACROS_major=`echo $XORG_MACROS_version | sed 's/\..*$//'` + XORG_MACROS_minor=`echo $XORG_MACROS_version | sed -e 's/^[0-9]*\.//' -e 's/\..*$//'`] + if test $XORG_MACROS_major -ne $XORG_MACROS_needed_major ; then + AC_MSG_ERROR([configure built with incompatible version of xorg-macros.m4 - requires version ${XORG_MACROS_major}.x]) + fi + if test $XORG_MACROS_minor -lt $XORG_MACROS_needed_minor ; then + AC_MSG_ERROR([configure built with too old of a version of xorg-macros.m4 - requires version ${XORG_MACROS_major}.${XORG_MACROS_minor}.0 or newer]) + fi + AC_MSG_RESULT([yes, $XORG_MACROS_version]) +]) # XORG_MACROS_VERSION + +# XORG_PROG_RAWCPP() +# ------------------ +# Minimum version: 1.0.0 +# +# Find cpp program and necessary flags for use in pre-processing text files +# such as man pages and config files +AC_DEFUN([XORG_PROG_RAWCPP],[ +AC_REQUIRE([AC_PROG_CPP]) +AC_PATH_PROGS(RAWCPP, [cpp], [${CPP}], + [$PATH:/bin:/usr/bin:/usr/lib:/usr/libexec:/usr/ccs/lib:/usr/ccs/lbin:/lib]) + +# Check for flag to avoid builtin definitions - assumes unix is predefined, +# which is not the best choice for supporting other OS'es, but covers most +# of the ones we need for now. +AC_MSG_CHECKING([if $RAWCPP requires -undef]) +AC_LANG_CONFTEST([Does cpp redefine unix ?]) +if test `${RAWCPP} < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then + AC_MSG_RESULT([no]) +else + if test `${RAWCPP} -undef < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then + RAWCPPFLAGS=-undef + AC_MSG_RESULT([yes]) + else + AC_MSG_ERROR([${RAWCPP} defines unix with or without -undef. I don't know what to do.]) + fi +fi +rm -f conftest.$ac_ext + +AC_MSG_CHECKING([if $RAWCPP requires -traditional]) +AC_LANG_CONFTEST([Does cpp preserve "whitespace"?]) +if test `${RAWCPP} < conftest.$ac_ext | grep -c 'preserve \"'` -eq 1 ; then + AC_MSG_RESULT([no]) +else + if test `${RAWCPP} -traditional < conftest.$ac_ext | grep -c 'preserve \"'` -eq 1 ; then + RAWCPPFLAGS="${RAWCPPFLAGS} -traditional" + AC_MSG_RESULT([yes]) + else + AC_MSG_ERROR([${RAWCPP} does not preserve whitespace with or without -traditional. I don't know what to do.]) + fi +fi +rm -f conftest.$ac_ext +AC_SUBST(RAWCPPFLAGS) +]) # XORG_PROG_RAWCPP + +# XORG_MANPAGE_SECTIONS() +# ----------------------- +# Minimum version: 1.0.0 +# +# Determine which sections man pages go in for the different man page types +# on this OS - replaces *ManSuffix settings in old Imake *.cf per-os files. +# Not sure if there's any better way than just hardcoding by OS name. +# Override default settings by setting environment variables + +AC_DEFUN([XORG_MANPAGE_SECTIONS],[ +AC_REQUIRE([AC_CANONICAL_HOST]) + +if test x$APP_MAN_SUFFIX = x ; then + APP_MAN_SUFFIX=1 +fi +if test x$APP_MAN_DIR = x ; then + APP_MAN_DIR='$(mandir)/man$(APP_MAN_SUFFIX)' +fi + +if test x$LIB_MAN_SUFFIX = x ; then + LIB_MAN_SUFFIX=3 +fi +if test x$LIB_MAN_DIR = x ; then + LIB_MAN_DIR='$(mandir)/man$(LIB_MAN_SUFFIX)' +fi + +if test x$FILE_MAN_SUFFIX = x ; then + case $host_os in + solaris*) FILE_MAN_SUFFIX=4 ;; + *) FILE_MAN_SUFFIX=5 ;; + esac +fi +if test x$FILE_MAN_DIR = x ; then + FILE_MAN_DIR='$(mandir)/man$(FILE_MAN_SUFFIX)' +fi + +if test x$MISC_MAN_SUFFIX = x ; then + case $host_os in + solaris*) MISC_MAN_SUFFIX=5 ;; + *) MISC_MAN_SUFFIX=7 ;; + esac +fi +if test x$MISC_MAN_DIR = x ; then + MISC_MAN_DIR='$(mandir)/man$(MISC_MAN_SUFFIX)' +fi + +if test x$DRIVER_MAN_SUFFIX = x ; then + case $host_os in + solaris*) DRIVER_MAN_SUFFIX=7 ;; + *) DRIVER_MAN_SUFFIX=4 ;; + esac +fi +if test x$DRIVER_MAN_DIR = x ; then + DRIVER_MAN_DIR='$(mandir)/man$(DRIVER_MAN_SUFFIX)' +fi + +if test x$ADMIN_MAN_SUFFIX = x ; then + case $host_os in + solaris*) ADMIN_MAN_SUFFIX=1m ;; + *) ADMIN_MAN_SUFFIX=8 ;; + esac +fi +if test x$ADMIN_MAN_DIR = x ; then + ADMIN_MAN_DIR='$(mandir)/man$(ADMIN_MAN_SUFFIX)' +fi + + +AC_SUBST([APP_MAN_SUFFIX]) +AC_SUBST([LIB_MAN_SUFFIX]) +AC_SUBST([FILE_MAN_SUFFIX]) +AC_SUBST([MISC_MAN_SUFFIX]) +AC_SUBST([DRIVER_MAN_SUFFIX]) +AC_SUBST([ADMIN_MAN_SUFFIX]) +AC_SUBST([APP_MAN_DIR]) +AC_SUBST([LIB_MAN_DIR]) +AC_SUBST([FILE_MAN_DIR]) +AC_SUBST([MISC_MAN_DIR]) +AC_SUBST([DRIVER_MAN_DIR]) +AC_SUBST([ADMIN_MAN_DIR]) +]) # XORG_MANPAGE_SECTIONS + +# XORG_CHECK_LINUXDOC +# ------------------- +# Minimum version: 1.0.0 +# +# Defines the variable MAKE_TEXT if the necessary tools and +# files are found. $(MAKE_TEXT) blah.sgml will then produce blah.txt. +# Whether or not the necessary tools and files are found can be checked +# with the AM_CONDITIONAL "BUILD_LINUXDOC" +AC_DEFUN([XORG_CHECK_LINUXDOC],[ +AC_CHECK_FILE( + [$prefix/share/X11/sgml/defs.ent], + [DEFS_ENT_PATH=$prefix/share/X11/sgml], + [DEFS_ENT_PATH=] +) + +AC_PATH_PROG(LINUXDOC, linuxdoc) +AC_PATH_PROG(PS2PDF, ps2pdf) + +AC_MSG_CHECKING([Whether to build documentation]) + +if test x$DEFS_ENT_PATH != x && test x$LINUXDOC != x ; then + BUILDDOC=yes +else + BUILDDOC=no +fi + +AM_CONDITIONAL(BUILD_LINUXDOC, [test x$BUILDDOC = xyes]) + +AC_MSG_RESULT([$BUILDDOC]) + +AC_MSG_CHECKING([Whether to build pdf documentation]) + +if test x$PS2PDF != x ; then + BUILDPDFDOC=yes +else + BUILDPDFDOC=no +fi + +AM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes]) + +AC_MSG_RESULT([$BUILDPDFDOC]) + +MAKE_TEXT="SGML_SEARCH_PATH=$DEFS_ENT_PATH GROFF_NO_SGR=y $LINUXDOC -B txt" +MAKE_PS="SGML_SEARCH_PATH=$DEFS_ENT_PATH $LINUXDOC -B latex --papersize=letter --output=ps" +MAKE_PDF="$PS2PDF" +MAKE_HTML="SGML_SEARCH_PATH=$DEFS_ENT_PATH $LINUXDOC -B html --split=0" + +AC_SUBST(MAKE_TEXT) +AC_SUBST(MAKE_PS) +AC_SUBST(MAKE_PDF) +AC_SUBST(MAKE_HTML) +]) # XORG_CHECK_LINUXDOC + +# XORG_CHECK_MALLOC_ZERO +# ---------------------- +# Minimum version: 1.0.0 +# +# Defines {MALLOC,XMALLOC,XTMALLOC}_ZERO_CFLAGS appropriately if +# malloc(0) returns NULL. Packages should add one of these cflags to +# their AM_CFLAGS (or other appropriate *_CFLAGS) to use them. +AC_DEFUN([XORG_CHECK_MALLOC_ZERO],[ +AC_ARG_ENABLE(malloc0returnsnull, + AC_HELP_STRING([--enable-malloc0returnsnull], + [malloc(0) returns NULL (default: auto)]), + [MALLOC_ZERO_RETURNS_NULL=$enableval], + [MALLOC_ZERO_RETURNS_NULL=auto]) + +AC_MSG_CHECKING([whether malloc(0) returns NULL]) +if test "x$MALLOC_ZERO_RETURNS_NULL" = xauto; then + AC_RUN_IFELSE([ +char *malloc(); +char *realloc(); +char *calloc(); +main() { + char *m0, *r0, *c0, *p; + m0 = malloc(0); + p = malloc(10); + r0 = realloc(p,0); + c0 = calloc(0); + exit(m0 == 0 || r0 == 0 || c0 == 0 ? 0 : 1); +}], + [MALLOC_ZERO_RETURNS_NULL=yes], + [MALLOC_ZERO_RETURNS_NULL=no]) +fi +AC_MSG_RESULT([$MALLOC_ZERO_RETURNS_NULL]) + +if test "x$MALLOC_ZERO_RETURNS_NULL" = xyes; then + MALLOC_ZERO_CFLAGS="-DMALLOC_0_RETURNS_NULL" + XMALLOC_ZERO_CFLAGS=$MALLOC_ZERO_CFLAGS + XTMALLOC_ZERO_CFLAGS="$MALLOC_ZERO_CFLAGS -DXTMALLOC_BC" +else + MALLOC_ZERO_CFLAGS="" + XMALLOC_ZERO_CFLAGS="" + XTMALLOC_ZERO_CFLAGS="" +fi + +AC_SUBST([MALLOC_ZERO_CFLAGS]) +AC_SUBST([XMALLOC_ZERO_CFLAGS]) +AC_SUBST([XTMALLOC_ZERO_CFLAGS]) +]) # XORG_CHECK_MALLOC_ZERO + +# XORG_WITH_LINT() +# ---------------- +# Minimum version: 1.1.0 +# +# Sets up flags for source checkers such as lint and sparse if --with-lint +# is specified. (Use --with-lint=sparse for sparse.) +# Sets $LINT to name of source checker passed with --with-lint (default: lint) +# Sets $LINT_FLAGS to flags to pass to source checker +# Sets LINT automake conditional if enabled (default: disabled) +# +AC_DEFUN([XORG_WITH_LINT],[ + +# Allow checking code with lint, sparse, etc. +AC_ARG_WITH(lint, [AC_HELP_STRING([--with-lint], + [Use a lint-style source code checker (default: disabled)])], + [use_lint=$withval], [use_lint=no]) +if test "x$use_lint" = "xyes" ; then + LINT="lint" +else + LINT="$use_lint" +fi +if test "x$LINT_FLAGS" = "x" -a "x$LINT" != "xno" ; then + case $LINT in + lint|*/lint) + case $host_os in + solaris*) + LINT_FLAGS="-u -b -h -erroff=E_INDISTING_FROM_TRUNC2" + ;; + esac + ;; + esac +fi + +AC_SUBST(LINT) +AC_SUBST(LINT_FLAGS) +AM_CONDITIONAL(LINT, [test x$LINT != xno]) + +]) # XORG_WITH_LINT + +# XORG_LINT_LIBRARY(LIBNAME) +# -------------------------- +# Minimum version: 1.1.0 +# +# Sets up flags for building lint libraries for checking programs that call +# functions in the library. +# Disabled by default, enable with --enable-lint-library +# Sets: +# @LINTLIB@ - name of lint library file to make +# MAKE_LINT_LIB - automake conditional +# + +AC_DEFUN([XORG_LINT_LIBRARY],[ +AC_REQUIRE([XORG_WITH_LINT]) +# Build lint "library" for more indepth checks of programs calling this library +AC_ARG_ENABLE(lint-library, [AC_HELP_STRING([--enable-lint-library], + [Create lint library (default: disabled)])], + [make_lint_lib=$enableval], [make_lint_lib=no]) +if test "x$make_lint_lib" != "xno" ; then + if test "x$LINT" = "xno" ; then + AC_MSG_ERROR([Cannot make lint library without --with-lint]) + fi + if test "x$make_lint_lib" = "xyes" ; then + LINTLIB=llib-l$1.ln + else + LINTLIB=$make_lint_lib + fi +fi +AC_SUBST(LINTLIB) +AM_CONDITIONAL(MAKE_LINT_LIB, [test x$make_lint_lib != xno]) + +]) # XORG_LINT_LIBRARY + +dnl Copyright 2005 Red Hat, Inc +dnl +dnl Permission to use, copy, modify, distribute, and sell this software and its +dnl documentation for any purpose is hereby granted without fee, provided that +dnl the above copyright notice appear in all copies and that both that +dnl copyright notice and this permission notice appear in supporting +dnl documentation. +dnl +dnl The above copyright notice and this permission notice shall be included +dnl in all copies or substantial portions of the Software. +dnl +dnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +dnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +dnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +dnl IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR +dnl OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +dnl ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +dnl OTHER DEALINGS IN THE SOFTWARE. +dnl +dnl Except as contained in this notice, the name of the copyright holders shall +dnl not be used in advertising or otherwise to promote the sale, use or +dnl other dealings in this Software without prior written authorization +dnl from the copyright holders. +dnl + +# XORG_RELEASE_VERSION +# -------------------- +# Adds --with/without-release-string and changes the PACKAGE and +# PACKAGE_TARNAME to use "$PACKAGE{_TARNAME}-$RELEASE_VERSION". If +# no option is given, PACKAGE and PACKAGE_TARNAME are unchanged. + +AC_DEFUN([XORG_RELEASE_VERSION],[ + AC_ARG_WITH(release-version, + AC_HELP_STRING([--with-release-version=STRING], + [Use release version string in package name]), + [RELEASE_VERSION="$withval"], + [RELEASE_VERSION=""]) + if test "x$RELEASE_VERSION" != "x"; then + PACKAGE="$PACKAGE-$RELEASE_VERSION" + PACKAGE_TARNAME="$PACKAGE_TARNAME-$RELEASE_VERSION" + AC_MSG_NOTICE([Building with package name set to $PACKAGE]) + fi +]) + +# Copyright (C) 2002, 2003, 2005 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_AUTOMAKE_VERSION(VERSION) +# ---------------------------- +# Automake X.Y traces this macro to ensure aclocal.m4 has been +# generated from the m4 files accompanying Automake X.Y. +AC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version="1.9"]) + +# AM_SET_CURRENT_AUTOMAKE_VERSION +# ------------------------------- +# Call AM_AUTOMAKE_VERSION so it can be traced. +# This function is AC_REQUIREd by AC_INIT_AUTOMAKE. +AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], + [AM_AUTOMAKE_VERSION([1.9.6])]) + +# AM_AUX_DIR_EXPAND -*- Autoconf -*- + +# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets +# $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to +# `$srcdir', `$srcdir/..', or `$srcdir/../..'. +# +# Of course, Automake must honor this variable whenever it calls a +# tool from the auxiliary directory. The problem is that $srcdir (and +# therefore $ac_aux_dir as well) can be either absolute or relative, +# depending on how configure is run. This is pretty annoying, since +# it makes $ac_aux_dir quite unusable in subdirectories: in the top +# source directory, any form will work fine, but in subdirectories a +# relative path needs to be adjusted first. +# +# $ac_aux_dir/missing +# fails when called from a subdirectory if $ac_aux_dir is relative +# $top_srcdir/$ac_aux_dir/missing +# fails if $ac_aux_dir is absolute, +# fails when called from a subdirectory in a VPATH build with +# a relative $ac_aux_dir +# +# The reason of the latter failure is that $top_srcdir and $ac_aux_dir +# are both prefixed by $srcdir. In an in-source build this is usually +# harmless because $srcdir is `.', but things will broke when you +# start a VPATH build or use an absolute $srcdir. +# +# So we could use something similar to $top_srcdir/$ac_aux_dir/missing, +# iff we strip the leading $srcdir from $ac_aux_dir. That would be: +# am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"` +# and then we would define $MISSING as +# MISSING="\${SHELL} $am_aux_dir/missing" +# This will work as long as MISSING is not called from configure, because +# unfortunately $(top_srcdir) has no meaning in configure. +# However there are other variables, like CC, which are often used in +# configure, and could therefore not use this "fixed" $ac_aux_dir. +# +# Another solution, used here, is to always expand $ac_aux_dir to an +# absolute PATH. The drawback is that using absolute paths prevent a +# configured tree to be moved without reconfiguration. + +AC_DEFUN([AM_AUX_DIR_EXPAND], +[dnl Rely on autoconf to set up CDPATH properly. +AC_PREREQ([2.50])dnl +# expand $ac_aux_dir to an absolute path +am_aux_dir=`cd $ac_aux_dir && pwd` +]) + +# AM_CONDITIONAL -*- Autoconf -*- + +# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005 +# Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 7 + +# AM_CONDITIONAL(NAME, SHELL-CONDITION) +# ------------------------------------- +# Define a conditional. +AC_DEFUN([AM_CONDITIONAL], +[AC_PREREQ(2.52)dnl + ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], + [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl +AC_SUBST([$1_TRUE]) +AC_SUBST([$1_FALSE]) +if $2; then + $1_TRUE= + $1_FALSE='#' +else + $1_TRUE='#' + $1_FALSE= +fi +AC_CONFIG_COMMANDS_PRE( +[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then + AC_MSG_ERROR([[conditional "$1" was never defined. +Usually this means the macro was only invoked conditionally.]]) +fi])]) + + +# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005 +# Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 8 + +# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be +# written in clear, in which case automake, when reading aclocal.m4, +# will think it sees a *use*, and therefore will trigger all it's +# C support machinery. Also note that it means that autoscan, seeing +# CC etc. in the Makefile, will ask for an AC_PROG_CC use... + + +# _AM_DEPENDENCIES(NAME) +# ---------------------- +# See how the compiler implements dependency checking. +# NAME is "CC", "CXX", "GCJ", or "OBJC". +# We try a few techniques and use that to set a single cache variable. +# +# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was +# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular +# dependency, and given that the user is not expected to run this macro, +# just rely on AC_PROG_CC. +AC_DEFUN([_AM_DEPENDENCIES], +[AC_REQUIRE([AM_SET_DEPDIR])dnl +AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl +AC_REQUIRE([AM_MAKE_INCLUDE])dnl +AC_REQUIRE([AM_DEP_TRACK])dnl + +ifelse([$1], CC, [depcc="$CC" am_compiler_list=], + [$1], CXX, [depcc="$CXX" am_compiler_list=], + [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'], + [$1], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'], + [depcc="$$1" am_compiler_list=]) + +AC_CACHE_CHECK([dependency style of $depcc], + [am_cv_$1_dependencies_compiler_type], +[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then + # We make a subdir and do the tests there. Otherwise we can end up + # making bogus files that we don't know about and never remove. For + # instance it was reported that on HP-UX the gcc test will end up + # making a dummy file named `D' -- because `-MD' means `put the output + # in D'. + mkdir conftest.dir + # Copy depcomp to subdir because otherwise we won't find it if we're + # using a relative directory. + cp "$am_depcomp" conftest.dir + cd conftest.dir + # We will build objects and dependencies in a subdirectory because + # it helps to detect inapplicable dependency modes. For instance + # both Tru64's cc and ICC support -MD to output dependencies as a + # side effect of compilation, but ICC will put the dependencies in + # the current directory while Tru64 will put them in the object + # directory. + mkdir sub + + am_cv_$1_dependencies_compiler_type=none + if test "$am_compiler_list" = ""; then + am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp` + fi + for depmode in $am_compiler_list; do + # Setup a source with many dependencies, because some compilers + # like to wrap large dependency lists on column 80 (with \), and + # we should not choose a depcomp mode which is confused by this. + # + # We need to recreate these files for each test, as the compiler may + # overwrite some of them when testing with obscure command lines. + # This happens at least with the AIX C compiler. + : > sub/conftest.c + for i in 1 2 3 4 5 6; do + echo '#include "conftst'$i'.h"' >> sub/conftest.c + # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with + # Solaris 8's {/usr,}/bin/sh. + touch sub/conftst$i.h + done + echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf + + case $depmode in + nosideeffect) + # after this tag, mechanisms are not by side-effect, so they'll + # only be used when explicitly requested + if test "x$enable_dependency_tracking" = xyes; then + continue + else + break + fi + ;; + none) break ;; + esac + # We check with `-c' and `-o' for the sake of the "dashmstdout" + # mode. It turns out that the SunPro C++ compiler does not properly + # handle `-M -o', and we need to detect this. + if depmode=$depmode \ + source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \ + depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ + $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \ + >/dev/null 2>conftest.err && + grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && + grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 && + ${MAKE-make} -s -f confmf > /dev/null 2>&1; then + # icc doesn't choke on unknown options, it will just issue warnings + # or remarks (even with -Werror). So we grep stderr for any message + # that says an option was ignored or not supported. + # When given -MP, icc 7.0 and 7.1 complain thusly: + # icc: Command line warning: ignoring option '-M'; no argument required + # The diagnosis changed in icc 8.0: + # icc: Command line remark: option '-MP' not supported + if (grep 'ignoring option' conftest.err || + grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else + am_cv_$1_dependencies_compiler_type=$depmode + break + fi + fi + done + + cd .. + rm -rf conftest.dir +else + am_cv_$1_dependencies_compiler_type=none +fi +]) +AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type]) +AM_CONDITIONAL([am__fastdep$1], [ + test "x$enable_dependency_tracking" != xno \ + && test "$am_cv_$1_dependencies_compiler_type" = gcc3]) +]) + + +# AM_SET_DEPDIR +# ------------- +# Choose a directory name for dependency files. +# This macro is AC_REQUIREd in _AM_DEPENDENCIES +AC_DEFUN([AM_SET_DEPDIR], +[AC_REQUIRE([AM_SET_LEADING_DOT])dnl +AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl +]) + + +# AM_DEP_TRACK +# ------------ +AC_DEFUN([AM_DEP_TRACK], +[AC_ARG_ENABLE(dependency-tracking, +[ --disable-dependency-tracking speeds up one-time build + --enable-dependency-tracking do not reject slow dependency extractors]) +if test "x$enable_dependency_tracking" != xno; then + am_depcomp="$ac_aux_dir/depcomp" + AMDEPBACKSLASH='\' +fi +AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) +AC_SUBST([AMDEPBACKSLASH]) +]) + +# Generate code to set up dependency tracking. -*- Autoconf -*- + +# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005 +# Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +#serial 3 + +# _AM_OUTPUT_DEPENDENCY_COMMANDS +# ------------------------------ +AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], +[for mf in $CONFIG_FILES; do + # Strip MF so we end up with the name of the file. + mf=`echo "$mf" | sed -e 's/:.*$//'` + # Check whether this is an Automake generated Makefile or not. + # We used to match only the files named `Makefile.in', but + # some people rename them; so instead we look at the file content. + # Grep'ing the first line is not enough: some people post-process + # each Makefile.in and add a new line on top of each file to say so. + # So let's grep whole file. + if grep '^#.*generated by automake' $mf > /dev/null 2>&1; then + dirpart=`AS_DIRNAME("$mf")` + else + continue + fi + # Extract the definition of DEPDIR, am__include, and am__quote + # from the Makefile without running `make'. + DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` + test -z "$DEPDIR" && continue + am__include=`sed -n 's/^am__include = //p' < "$mf"` + test -z "am__include" && continue + am__quote=`sed -n 's/^am__quote = //p' < "$mf"` + # When using ansi2knr, U may be empty or an underscore; expand it + U=`sed -n 's/^U = //p' < "$mf"` + # Find all dependency output files, they are included files with + # $(DEPDIR) in their names. We invoke sed twice because it is the + # simplest approach to changing $(DEPDIR) to its actual value in the + # expansion. + for file in `sed -n " + s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ + sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do + # Make sure the directory exists. + test -f "$dirpart/$file" && continue + fdir=`AS_DIRNAME(["$file"])` + AS_MKDIR_P([$dirpart/$fdir]) + # echo "creating $dirpart/$file" + echo '# dummy' > "$dirpart/$file" + done +done +])# _AM_OUTPUT_DEPENDENCY_COMMANDS + + +# AM_OUTPUT_DEPENDENCY_COMMANDS +# ----------------------------- +# This macro should only be invoked once -- use via AC_REQUIRE. +# +# This code is only required when automatic dependency tracking +# is enabled. FIXME. This creates each `.P' file that we will +# need in order to bootstrap the dependency handling code. +AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], +[AC_CONFIG_COMMANDS([depfiles], + [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS], + [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"]) +]) + +# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005 +# Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 8 + +# AM_CONFIG_HEADER is obsolete. It has been replaced by AC_CONFIG_HEADERS. +AU_DEFUN([AM_CONFIG_HEADER], [AC_CONFIG_HEADERS($@)]) + +# Do all the work for Automake. -*- Autoconf -*- + +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 +# Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 12 + +# This macro actually does too much. Some checks are only needed if +# your package does certain things. But this isn't really a big deal. + +# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) +# AM_INIT_AUTOMAKE([OPTIONS]) +# ----------------------------------------------- +# The call with PACKAGE and VERSION arguments is the old style +# call (pre autoconf-2.50), which is being phased out. PACKAGE +# and VERSION should now be passed to AC_INIT and removed from +# the call to AM_INIT_AUTOMAKE. +# We support both call styles for the transition. After +# the next Automake release, Autoconf can make the AC_INIT +# arguments mandatory, and then we can depend on a new Autoconf +# release and drop the old call support. +AC_DEFUN([AM_INIT_AUTOMAKE], +[AC_PREREQ([2.58])dnl +dnl Autoconf wants to disallow AM_ names. We explicitly allow +dnl the ones we care about. +m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl +AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl +AC_REQUIRE([AC_PROG_INSTALL])dnl +# test to see if srcdir already configured +if test "`cd $srcdir && pwd`" != "`pwd`" && + test -f $srcdir/config.status; then + AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) +fi + +# test whether we have cygpath +if test -z "$CYGPATH_W"; then + if (cygpath --version) >/dev/null 2>/dev/null; then + CYGPATH_W='cygpath -w' + else + CYGPATH_W=echo + fi +fi +AC_SUBST([CYGPATH_W]) + +# Define the identity of the package. +dnl Distinguish between old-style and new-style calls. +m4_ifval([$2], +[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl + AC_SUBST([PACKAGE], [$1])dnl + AC_SUBST([VERSION], [$2])], +[_AM_SET_OPTIONS([$1])dnl + AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl + AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl + +_AM_IF_OPTION([no-define],, +[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package]) + AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl + +# Some tools Automake needs. +AC_REQUIRE([AM_SANITY_CHECK])dnl +AC_REQUIRE([AC_ARG_PROGRAM])dnl +AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version}) +AM_MISSING_PROG(AUTOCONF, autoconf) +AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version}) +AM_MISSING_PROG(AUTOHEADER, autoheader) +AM_MISSING_PROG(MAKEINFO, makeinfo) +AM_PROG_INSTALL_SH +AM_PROG_INSTALL_STRIP +AC_REQUIRE([AM_PROG_MKDIR_P])dnl +# We need awk for the "check" target. The system "awk" is bad on +# some platforms. +AC_REQUIRE([AC_PROG_AWK])dnl +AC_REQUIRE([AC_PROG_MAKE_SET])dnl +AC_REQUIRE([AM_SET_LEADING_DOT])dnl +_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])], + [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], + [_AM_PROG_TAR([v7])])]) +_AM_IF_OPTION([no-dependencies],, +[AC_PROVIDE_IFELSE([AC_PROG_CC], + [_AM_DEPENDENCIES(CC)], + [define([AC_PROG_CC], + defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl +AC_PROVIDE_IFELSE([AC_PROG_CXX], + [_AM_DEPENDENCIES(CXX)], + [define([AC_PROG_CXX], + defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl +]) +]) + + +# When config.status generates a header, we must update the stamp-h file. +# This file resides in the same directory as the config header +# that is generated. The stamp files are numbered to have different names. + +# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the +# loop where config.status creates the headers, so we can generate +# our stamp files there. +AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], +[# Compute $1's index in $config_headers. +_am_stamp_count=1 +for _am_header in $config_headers :; do + case $_am_header in + $1 | $1:* ) + break ;; + * ) + _am_stamp_count=`expr $_am_stamp_count + 1` ;; + esac +done +echo "timestamp for $1" >`AS_DIRNAME([$1])`/stamp-h[]$_am_stamp_count]) + +# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_PROG_INSTALL_SH +# ------------------ +# Define $install_sh. +AC_DEFUN([AM_PROG_INSTALL_SH], +[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl +install_sh=${install_sh-"$am_aux_dir/install-sh"} +AC_SUBST(install_sh)]) + +# Copyright (C) 2003, 2005 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 2 + +# Check whether the underlying file-system supports filenames +# with a leading dot. For instance MS-DOS doesn't. +AC_DEFUN([AM_SET_LEADING_DOT], +[rm -rf .tst 2>/dev/null +mkdir .tst 2>/dev/null +if test -d .tst; then + am__leading_dot=. +else + am__leading_dot=_ +fi +rmdir .tst 2>/dev/null +AC_SUBST([am__leading_dot])]) + +# Add --enable-maintainer-mode option to configure. -*- Autoconf -*- +# From Jim Meyering + +# Copyright (C) 1996, 1998, 2000, 2001, 2002, 2003, 2004, 2005 +# Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 4 + +AC_DEFUN([AM_MAINTAINER_MODE], +[AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles]) + dnl maintainer-mode is disabled by default + AC_ARG_ENABLE(maintainer-mode, +[ --enable-maintainer-mode enable make rules and dependencies not useful + (and sometimes confusing) to the casual installer], + USE_MAINTAINER_MODE=$enableval, + USE_MAINTAINER_MODE=no) + AC_MSG_RESULT([$USE_MAINTAINER_MODE]) + AM_CONDITIONAL(MAINTAINER_MODE, [test $USE_MAINTAINER_MODE = yes]) + MAINT=$MAINTAINER_MODE_TRUE + AC_SUBST(MAINT)dnl +] +) + +AU_DEFUN([jm_MAINTAINER_MODE], [AM_MAINTAINER_MODE]) + +# Check to see how 'make' treats includes. -*- Autoconf -*- + +# Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 3 + +# AM_MAKE_INCLUDE() +# ----------------- +# Check to see how make treats includes. +AC_DEFUN([AM_MAKE_INCLUDE], +[am_make=${MAKE-make} +cat > confinc << 'END' +am__doit: + @echo done +.PHONY: am__doit +END +# If we don't find an include directive, just comment out the code. +AC_MSG_CHECKING([for style of include used by $am_make]) +am__include="#" +am__quote= +_am_result=none +# First try GNU make style include. +echo "include confinc" > confmf +# We grep out `Entering directory' and `Leaving directory' +# messages which can occur if `w' ends up in MAKEFLAGS. +# In particular we don't look at `^make:' because GNU make might +# be invoked under some other name (usually "gmake"), in which +# case it prints its new name instead of `make'. +if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then + am__include=include + am__quote= + _am_result=GNU +fi +# Now try BSD make style include. +if test "$am__include" = "#"; then + echo '.include "confinc"' > confmf + if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then + am__include=.include + am__quote="\"" + _am_result=BSD + fi +fi +AC_SUBST([am__include]) +AC_SUBST([am__quote]) +AC_MSG_RESULT([$_am_result]) +rm -f confinc confmf +]) + +# Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- + +# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2005 +# Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 4 + +# AM_MISSING_PROG(NAME, PROGRAM) +# ------------------------------ +AC_DEFUN([AM_MISSING_PROG], +[AC_REQUIRE([AM_MISSING_HAS_RUN]) +$1=${$1-"${am_missing_run}$2"} +AC_SUBST($1)]) + + +# AM_MISSING_HAS_RUN +# ------------------ +# Define MISSING if not defined so far and test if it supports --run. +# If it does, set am_missing_run to use it, otherwise, to nothing. +AC_DEFUN([AM_MISSING_HAS_RUN], +[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl +test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing" +# Use eval to expand $SHELL +if eval "$MISSING --run true"; then + am_missing_run="$MISSING --run " +else + am_missing_run= + AC_MSG_WARN([`missing' script is too old or missing]) +fi +]) + +# Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_PROG_MKDIR_P +# --------------- +# Check whether `mkdir -p' is supported, fallback to mkinstalldirs otherwise. +# +# Automake 1.8 used `mkdir -m 0755 -p --' to ensure that directories +# created by `make install' are always world readable, even if the +# installer happens to have an overly restrictive umask (e.g. 077). +# This was a mistake. There are at least two reasons why we must not +# use `-m 0755': +# - it causes special bits like SGID to be ignored, +# - it may be too restrictive (some setups expect 775 directories). +# +# Do not use -m 0755 and let people choose whatever they expect by +# setting umask. +# +# We cannot accept any implementation of `mkdir' that recognizes `-p'. +# Some implementations (such as Solaris 8's) are not thread-safe: if a +# parallel make tries to run `mkdir -p a/b' and `mkdir -p a/c' +# concurrently, both version can detect that a/ is missing, but only +# one can create it and the other will error out. Consequently we +# restrict ourselves to GNU make (using the --version option ensures +# this.) +AC_DEFUN([AM_PROG_MKDIR_P], +[if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then + # We used to keeping the `.' as first argument, in order to + # allow $(mkdir_p) to be used without argument. As in + # $(mkdir_p) $(somedir) + # where $(somedir) is conditionally defined. However this is wrong + # for two reasons: + # 1. if the package is installed by a user who cannot write `.' + # make install will fail, + # 2. the above comment should most certainly read + # $(mkdir_p) $(DESTDIR)$(somedir) + # so it does not work when $(somedir) is undefined and + # $(DESTDIR) is not. + # To support the latter case, we have to write + # test -z "$(somedir)" || $(mkdir_p) $(DESTDIR)$(somedir), + # so the `.' trick is pointless. + mkdir_p='mkdir -p --' +else + # On NextStep and OpenStep, the `mkdir' command does not + # recognize any option. It will interpret all options as + # directories to create, and then abort because `.' already + # exists. + for d in ./-p ./--version; + do + test -d $d && rmdir $d + done + # $(mkinstalldirs) is defined by Automake if mkinstalldirs exists. + if test -f "$ac_aux_dir/mkinstalldirs"; then + mkdir_p='$(mkinstalldirs)' + else + mkdir_p='$(install_sh) -d' + fi +fi +AC_SUBST([mkdir_p])]) + +# Helper functions for option handling. -*- Autoconf -*- + +# Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 3 + +# _AM_MANGLE_OPTION(NAME) +# ----------------------- +AC_DEFUN([_AM_MANGLE_OPTION], +[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) + +# _AM_SET_OPTION(NAME) +# ------------------------------ +# Set option NAME. Presently that only means defining a flag for this option. +AC_DEFUN([_AM_SET_OPTION], +[m4_define(_AM_MANGLE_OPTION([$1]), 1)]) + +# _AM_SET_OPTIONS(OPTIONS) +# ---------------------------------- +# OPTIONS is a space-separated list of Automake options. +AC_DEFUN([_AM_SET_OPTIONS], +[AC_FOREACH([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) + +# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET]) +# ------------------------------------------- +# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. +AC_DEFUN([_AM_IF_OPTION], +[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) + +# Check to make sure that the build environment is sane. -*- Autoconf -*- + +# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005 +# Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 4 + +# AM_SANITY_CHECK +# --------------- +AC_DEFUN([AM_SANITY_CHECK], +[AC_MSG_CHECKING([whether build environment is sane]) +# Just in case +sleep 1 +echo timestamp > conftest.file +# Do `set' in a subshell so we don't clobber the current shell's +# arguments. Must try -L first in case configure is actually a +# symlink; some systems play weird games with the mod time of symlinks +# (eg FreeBSD returns the mod time of the symlink's containing +# directory). +if ( + set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null` + if test "$[*]" = "X"; then + # -L didn't work. + set X `ls -t $srcdir/configure conftest.file` + fi + rm -f conftest.file + if test "$[*]" != "X $srcdir/configure conftest.file" \ + && test "$[*]" != "X conftest.file $srcdir/configure"; then + + # If neither matched, then we have a broken ls. This can happen + # if, for instance, CONFIG_SHELL is bash and it inherits a + # broken ls alias from the environment. This has actually + # happened. Such a system could not be considered "sane". + AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken +alias in your environment]) + fi + + test "$[2]" = conftest.file + ) +then + # Ok. + : +else + AC_MSG_ERROR([newly created file is older than distributed files! +Check your system clock]) +fi +AC_MSG_RESULT(yes)]) + +# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_PROG_INSTALL_STRIP +# --------------------- +# One issue with vendor `install' (even GNU) is that you can't +# specify the program used to strip binaries. This is especially +# annoying in cross-compiling environments, where the build's strip +# is unlikely to handle the host's binaries. +# Fortunately install-sh will honor a STRIPPROG variable, so we +# always use install-sh in `make install-strip', and initialize +# STRIPPROG with the value of the STRIP variable (set by the user). +AC_DEFUN([AM_PROG_INSTALL_STRIP], +[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl +# Installed binaries are usually stripped using `strip' when the user +# run `make install-strip'. However `strip' might not be the right +# tool to use in cross-compilation environments, therefore Automake +# will honor the `STRIP' environment variable to overrule this program. +dnl Don't test for $cross_compiling = yes, because it might be `maybe'. +if test "$cross_compiling" != no; then + AC_CHECK_TOOL([STRIP], [strip], :) +fi +INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s" +AC_SUBST([INSTALL_STRIP_PROGRAM])]) + +# Check how to create a tarball. -*- Autoconf -*- + +# Copyright (C) 2004, 2005 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 2 + +# _AM_PROG_TAR(FORMAT) +# -------------------- +# Check how to create a tarball in format FORMAT. +# FORMAT should be one of `v7', `ustar', or `pax'. +# +# Substitute a variable $(am__tar) that is a command +# writing to stdout a FORMAT-tarball containing the directory +# $tardir. +# tardir=directory && $(am__tar) > result.tar +# +# Substitute a variable $(am__untar) that extract such +# a tarball read from stdin. +# $(am__untar) < result.tar +AC_DEFUN([_AM_PROG_TAR], +[# Always define AMTAR for backward compatibility. +AM_MISSING_PROG([AMTAR], [tar]) +m4_if([$1], [v7], + [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'], + [m4_case([$1], [ustar],, [pax],, + [m4_fatal([Unknown tar format])]) +AC_MSG_CHECKING([how to create a $1 tar archive]) +# Loop over all known methods to create a tar archive until one works. +_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none' +_am_tools=${am_cv_prog_tar_$1-$_am_tools} +# Do not fold the above two line into one, because Tru64 sh and +# Solaris sh will not grok spaces in the rhs of `-'. +for _am_tool in $_am_tools +do + case $_am_tool in + gnutar) + for _am_tar in tar gnutar gtar; + do + AM_RUN_LOG([$_am_tar --version]) && break + done + am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"' + am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"' + am__untar="$_am_tar -xf -" + ;; + plaintar) + # Must skip GNU tar: if it does not support --format= it doesn't create + # ustar tarball either. + (tar --version) >/dev/null 2>&1 && continue + am__tar='tar chf - "$$tardir"' + am__tar_='tar chf - "$tardir"' + am__untar='tar xf -' + ;; + pax) + am__tar='pax -L -x $1 -w "$$tardir"' + am__tar_='pax -L -x $1 -w "$tardir"' + am__untar='pax -r' + ;; + cpio) + am__tar='find "$$tardir" -print | cpio -o -H $1 -L' + am__tar_='find "$tardir" -print | cpio -o -H $1 -L' + am__untar='cpio -i -H $1 -d' + ;; + none) + am__tar=false + am__tar_=false + am__untar=false + ;; + esac + + # If the value was cached, stop now. We just wanted to have am__tar + # and am__untar set. + test -n "${am_cv_prog_tar_$1}" && break + + # tar/untar a dummy directory, and stop if the command works + rm -rf conftest.dir + mkdir conftest.dir + echo GrepMe > conftest.dir/file + AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar]) + rm -rf conftest.dir + if test -s conftest.tar; then + AM_RUN_LOG([$am__untar /dev/null 2>&1 && break + fi +done +rm -rf conftest.dir + +AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool]) +AC_MSG_RESULT([$am_cv_prog_tar_$1])]) +AC_SUBST([am__tar]) +AC_SUBST([am__untar]) +]) # _AM_PROG_TAR + diff --git a/app/xf86dga/compile b/app/xf86dga/compile new file mode 100644 index 000000000..1b1d23216 --- /dev/null +++ b/app/xf86dga/compile @@ -0,0 +1,142 @@ +#! /bin/sh +# Wrapper for compilers which do not understand `-c -o'. + +scriptversion=2005-05-14.22 + +# Copyright (C) 1999, 2000, 2003, 2004, 2005 Free Software Foundation, Inc. +# Written by Tom Tromey . +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +# This file is maintained in Automake, please report +# bugs to or send patches to +# . + +case $1 in + '') + echo "$0: No command. Try \`$0 --help' for more information." 1>&2 + exit 1; + ;; + -h | --h*) + cat <<\EOF +Usage: compile [--help] [--version] PROGRAM [ARGS] + +Wrapper for compilers which do not understand `-c -o'. +Remove `-o dest.o' from ARGS, run PROGRAM with the remaining +arguments, and rename the output as expected. + +If you are trying to build a whole package this is not the +right script to run: please start by reading the file `INSTALL'. + +Report bugs to . +EOF + exit $? + ;; + -v | --v*) + echo "compile $scriptversion" + exit $? + ;; +esac + +ofile= +cfile= +eat= + +for arg +do + if test -n "$eat"; then + eat= + else + case $1 in + -o) + # configure might choose to run compile as `compile cc -o foo foo.c'. + # So we strip `-o arg' only if arg is an object. + eat=1 + case $2 in + *.o | *.obj) + ofile=$2 + ;; + *) + set x "$@" -o "$2" + shift + ;; + esac + ;; + *.c) + cfile=$1 + set x "$@" "$1" + shift + ;; + *) + set x "$@" "$1" + shift + ;; + esac + fi + shift +done + +if test -z "$ofile" || test -z "$cfile"; then + # If no `-o' option was seen then we might have been invoked from a + # pattern rule where we don't need one. That is ok -- this is a + # normal compilation that the losing compiler can handle. If no + # `.c' file was seen then we are probably linking. That is also + # ok. + exec "$@" +fi + +# Name of file we expect compiler to create. +cofile=`echo "$cfile" | sed -e 's|^.*/||' -e 's/\.c$/.o/'` + +# Create the lock directory. +# Note: use `[/.-]' here to ensure that we don't use the same name +# that we are using for the .o file. Also, base the name on the expected +# object file name, since that is what matters with a parallel build. +lockdir=`echo "$cofile" | sed -e 's|[/.-]|_|g'`.d +while true; do + if mkdir "$lockdir" >/dev/null 2>&1; then + break + fi + sleep 1 +done +# FIXME: race condition here if user kills between mkdir and trap. +trap "rmdir '$lockdir'; exit 1" 1 2 15 + +# Run the compile. +"$@" +ret=$? + +if test -f "$cofile"; then + mv "$cofile" "$ofile" +elif test -f "${cofile}bj"; then + mv "${cofile}bj" "$ofile" +fi + +rmdir "$lockdir" +exit $ret + +# Local Variables: +# mode: shell-script +# sh-indentation: 2 +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-end: "$" +# End: diff --git a/app/xf86dga/config.guess b/app/xf86dga/config.guess new file mode 100644 index 000000000..917bbc50f --- /dev/null +++ b/app/xf86dga/config.guess @@ -0,0 +1,1463 @@ +#! /bin/sh +# Attempt to guess a canonical system name. +# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, +# 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. + +timestamp='2005-07-08' + +# This file is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA +# 02110-1301, USA. +# +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + + +# Originally written by Per Bothner . +# Please send patches to . Submit a context +# diff and a properly formatted ChangeLog entry. +# +# This script attempts to guess a canonical system name similar to +# config.sub. If it succeeds, it prints the system name on stdout, and +# exits with 0. Otherwise, it exits with 1. +# +# The plan is that this can be called by configure scripts if you +# don't specify an explicit build system type. + +me=`echo "$0" | sed -e 's,.*/,,'` + +usage="\ +Usage: $0 [OPTION] + +Output the configuration name of the system \`$me' is run on. + +Operation modes: + -h, --help print this help, then exit + -t, --time-stamp print date of last modification, then exit + -v, --version print version number, then exit + +Report bugs and patches to ." + +version="\ +GNU config.guess ($timestamp) + +Originally written by Per Bothner. +Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 +Free Software Foundation, Inc. + +This is free software; see the source for copying conditions. There is NO +warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." + +help=" +Try \`$me --help' for more information." + +# Parse command line +while test $# -gt 0 ; do + case $1 in + --time-stamp | --time* | -t ) + echo "$timestamp" ; exit ;; + --version | -v ) + echo "$version" ; exit ;; + --help | --h* | -h ) + echo "$usage"; exit ;; + -- ) # Stop option processing + shift; break ;; + - ) # Use stdin as input. + break ;; + -* ) + echo "$me: invalid option $1$help" >&2 + exit 1 ;; + * ) + break ;; + esac +done + +if test $# != 0; then + echo "$me: too many arguments$help" >&2 + exit 1 +fi + +trap 'exit 1' 1 2 15 + +# CC_FOR_BUILD -- compiler used by this script. Note that the use of a +# compiler to aid in system detection is discouraged as it requires +# temporary files to be created and, as you can see below, it is a +# headache to deal with in a portable fashion. + +# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still +# use `HOST_CC' if defined, but it is deprecated. + +# Portable tmp directory creation inspired by the Autoconf team. + +set_cc_for_build=' +trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ; +trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ; +: ${TMPDIR=/tmp} ; + { tmp=`(umask 077 && mktemp -d -q "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || + { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } || + { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } || + { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ; +dummy=$tmp/dummy ; +tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ; +case $CC_FOR_BUILD,$HOST_CC,$CC in + ,,) echo "int x;" > $dummy.c ; + for c in cc gcc c89 c99 ; do + if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then + CC_FOR_BUILD="$c"; break ; + fi ; + done ; + if test x"$CC_FOR_BUILD" = x ; then + CC_FOR_BUILD=no_compiler_found ; + fi + ;; + ,,*) CC_FOR_BUILD=$CC ;; + ,*,*) CC_FOR_BUILD=$HOST_CC ;; +esac ; set_cc_for_build= ;' + +# This is needed to find uname on a Pyramid OSx when run in the BSD universe. +# (ghazi@noc.rutgers.edu 1994-08-24) +if (test -f /.attbin/uname) >/dev/null 2>&1 ; then + PATH=$PATH:/.attbin ; export PATH +fi + +UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown +UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown +UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown +UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown + +# Note: order is significant - the case branches are not exclusive. + +case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in + *:NetBSD:*:*) + # NetBSD (nbsd) targets should (where applicable) match one or + # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*, + # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently + # switched to ELF, *-*-netbsd* would select the old + # object file format. This provides both forward + # compatibility and a consistent mechanism for selecting the + # object file format. + # + # Note: NetBSD doesn't particularly care about the vendor + # portion of the name. We always set it to "unknown". + sysctl="sysctl -n hw.machine_arch" + UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \ + /usr/sbin/$sysctl 2>/dev/null || echo unknown)` + case "${UNAME_MACHINE_ARCH}" in + armeb) machine=armeb-unknown ;; + arm*) machine=arm-unknown ;; + sh3el) machine=shl-unknown ;; + sh3eb) machine=sh-unknown ;; + *) machine=${UNAME_MACHINE_ARCH}-unknown ;; + esac + # The Operating System including object format, if it has switched + # to ELF recently, or will in the future. + case "${UNAME_MACHINE_ARCH}" in + arm*|i386|m68k|ns32k|sh3*|sparc|vax) + eval $set_cc_for_build + if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ + | grep __ELF__ >/dev/null + then + # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). + # Return netbsd for either. FIX? + os=netbsd + else + os=netbsdelf + fi + ;; + *) + os=netbsd + ;; + esac + # The OS release + # Debian GNU/NetBSD machines have a different userland, and + # thus, need a distinct triplet. However, they do not need + # kernel version information, so it can be replaced with a + # suitable tag, in the style of linux-gnu. + case "${UNAME_VERSION}" in + Debian*) + release='-gnu' + ;; + *) + release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` + ;; + esac + # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: + # contains redundant information, the shorter form: + # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. + echo "${machine}-${os}${release}" + exit ;; + *:OpenBSD:*:*) + UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` + echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE} + exit ;; + *:ekkoBSD:*:*) + echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE} + exit ;; + macppc:MirBSD:*:*) + echo powerppc-unknown-mirbsd${UNAME_RELEASE} + exit ;; + *:MirBSD:*:*) + echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE} + exit ;; + alpha:OSF1:*:*) + case $UNAME_RELEASE in + *4.0) + UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` + ;; + *5.*) + UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` + ;; + esac + # According to Compaq, /usr/sbin/psrinfo has been available on + # OSF/1 and Tru64 systems produced since 1995. I hope that + # covers most systems running today. This code pipes the CPU + # types through head -n 1, so we only detect the type of CPU 0. + ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` + case "$ALPHA_CPU_TYPE" in + "EV4 (21064)") + UNAME_MACHINE="alpha" ;; + "EV4.5 (21064)") + UNAME_MACHINE="alpha" ;; + "LCA4 (21066/21068)") + UNAME_MACHINE="alpha" ;; + "EV5 (21164)") + UNAME_MACHINE="alphaev5" ;; + "EV5.6 (21164A)") + UNAME_MACHINE="alphaev56" ;; + "EV5.6 (21164PC)") + UNAME_MACHINE="alphapca56" ;; + "EV5.7 (21164PC)") + UNAME_MACHINE="alphapca57" ;; + "EV6 (21264)") + UNAME_MACHINE="alphaev6" ;; + "EV6.7 (21264A)") + UNAME_MACHINE="alphaev67" ;; + "EV6.8CB (21264C)") + UNAME_MACHINE="alphaev68" ;; + "EV6.8AL (21264B)") + UNAME_MACHINE="alphaev68" ;; + "EV6.8CX (21264D)") + UNAME_MACHINE="alphaev68" ;; + "EV6.9A (21264/EV69A)") + UNAME_MACHINE="alphaev69" ;; + "EV7 (21364)") + UNAME_MACHINE="alphaev7" ;; + "EV7.9 (21364A)") + UNAME_MACHINE="alphaev79" ;; + esac + # A Pn.n version is a patched version. + # A Vn.n version is a released version. + # A Tn.n version is a released field test version. + # A Xn.n version is an unreleased experimental baselevel. + # 1.2 uses "1.2" for uname -r. + echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + exit ;; + Alpha\ *:Windows_NT*:*) + # How do we know it's Interix rather than the generic POSIX subsystem? + # Should we change UNAME_MACHINE based on the output of uname instead + # of the specific Alpha model? + echo alpha-pc-interix + exit ;; + 21064:Windows_NT:50:3) + echo alpha-dec-winnt3.5 + exit ;; + Amiga*:UNIX_System_V:4.0:*) + echo m68k-unknown-sysv4 + exit ;; + *:[Aa]miga[Oo][Ss]:*:*) + echo ${UNAME_MACHINE}-unknown-amigaos + exit ;; + *:[Mm]orph[Oo][Ss]:*:*) + echo ${UNAME_MACHINE}-unknown-morphos + exit ;; + *:OS/390:*:*) + echo i370-ibm-openedition + exit ;; + *:z/VM:*:*) + echo s390-ibm-zvmoe + exit ;; + *:OS400:*:*) + echo powerpc-ibm-os400 + exit ;; + arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) + echo arm-acorn-riscix${UNAME_RELEASE} + exit ;; + arm:riscos:*:*|arm:RISCOS:*:*) + echo arm-unknown-riscos + exit ;; + SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) + echo hppa1.1-hitachi-hiuxmpp + exit ;; + Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) + # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. + if test "`(/bin/universe) 2>/dev/null`" = att ; then + echo pyramid-pyramid-sysv3 + else + echo pyramid-pyramid-bsd + fi + exit ;; + NILE*:*:*:dcosx) + echo pyramid-pyramid-svr4 + exit ;; + DRS?6000:unix:4.0:6*) + echo sparc-icl-nx6 + exit ;; + DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*) + case `/usr/bin/uname -p` in + sparc) echo sparc-icl-nx7; exit ;; + esac ;; + sun4H:SunOS:5.*:*) + echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; + sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) + echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; + i86pc:SunOS:5.*:*) + echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; + sun4*:SunOS:6*:*) + # According to config.sub, this is the proper way to canonicalize + # SunOS6. Hard to guess exactly what SunOS6 will be like, but + # it's likely to be more like Solaris than SunOS4. + echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; + sun4*:SunOS:*:*) + case "`/usr/bin/arch -k`" in + Series*|S4*) + UNAME_RELEASE=`uname -v` + ;; + esac + # Japanese Language versions have a version number like `4.1.3-JL'. + echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'` + exit ;; + sun3*:SunOS:*:*) + echo m68k-sun-sunos${UNAME_RELEASE} + exit ;; + sun*:*:4.2BSD:*) + UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` + test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3 + case "`/bin/arch`" in + sun3) + echo m68k-sun-sunos${UNAME_RELEASE} + ;; + sun4) + echo sparc-sun-sunos${UNAME_RELEASE} + ;; + esac + exit ;; + aushp:SunOS:*:*) + echo sparc-auspex-sunos${UNAME_RELEASE} + exit ;; + # The situation for MiNT is a little confusing. The machine name + # can be virtually everything (everything which is not + # "atarist" or "atariste" at least should have a processor + # > m68000). The system name ranges from "MiNT" over "FreeMiNT" + # to the lowercase version "mint" (or "freemint"). Finally + # the system name "TOS" denotes a system which is actually not + # MiNT. But MiNT is downward compatible to TOS, so this should + # be no problem. + atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) + echo m68k-atari-mint${UNAME_RELEASE} + exit ;; + atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) + echo m68k-atari-mint${UNAME_RELEASE} + exit ;; + *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) + echo m68k-atari-mint${UNAME_RELEASE} + exit ;; + milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) + echo m68k-milan-mint${UNAME_RELEASE} + exit ;; + hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) + echo m68k-hades-mint${UNAME_RELEASE} + exit ;; + *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) + echo m68k-unknown-mint${UNAME_RELEASE} + exit ;; + m68k:machten:*:*) + echo m68k-apple-machten${UNAME_RELEASE} + exit ;; + powerpc:machten:*:*) + echo powerpc-apple-machten${UNAME_RELEASE} + exit ;; + RISC*:Mach:*:*) + echo mips-dec-mach_bsd4.3 + exit ;; + RISC*:ULTRIX:*:*) + echo mips-dec-ultrix${UNAME_RELEASE} + exit ;; + VAX*:ULTRIX*:*:*) + echo vax-dec-ultrix${UNAME_RELEASE} + exit ;; + 2020:CLIX:*:* | 2430:CLIX:*:*) + echo clipper-intergraph-clix${UNAME_RELEASE} + exit ;; + mips:*:*:UMIPS | mips:*:*:RISCos) + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c +#ifdef __cplusplus +#include /* for printf() prototype */ + int main (int argc, char *argv[]) { +#else + int main (argc, argv) int argc; char *argv[]; { +#endif + #if defined (host_mips) && defined (MIPSEB) + #if defined (SYSTYPE_SYSV) + printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0); + #endif + #if defined (SYSTYPE_SVR4) + printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0); + #endif + #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) + printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0); + #endif + #endif + exit (-1); + } +EOF + $CC_FOR_BUILD -o $dummy $dummy.c && + dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` && + SYSTEM_NAME=`$dummy $dummyarg` && + { echo "$SYSTEM_NAME"; exit; } + echo mips-mips-riscos${UNAME_RELEASE} + exit ;; + Motorola:PowerMAX_OS:*:*) + echo powerpc-motorola-powermax + exit ;; + Motorola:*:4.3:PL8-*) + echo powerpc-harris-powermax + exit ;; + Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) + echo powerpc-harris-powermax + exit ;; + Night_Hawk:Power_UNIX:*:*) + echo powerpc-harris-powerunix + exit ;; + m88k:CX/UX:7*:*) + echo m88k-harris-cxux7 + exit ;; + m88k:*:4*:R4*) + echo m88k-motorola-sysv4 + exit ;; + m88k:*:3*:R3*) + echo m88k-motorola-sysv3 + exit ;; + AViiON:dgux:*:*) + # DG/UX returns AViiON for all architectures + UNAME_PROCESSOR=`/usr/bin/uname -p` + if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ] + then + if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ + [ ${TARGET_BINARY_INTERFACE}x = x ] + then + echo m88k-dg-dgux${UNAME_RELEASE} + else + echo m88k-dg-dguxbcs${UNAME_RELEASE} + fi + else + echo i586-dg-dgux${UNAME_RELEASE} + fi + exit ;; + M88*:DolphinOS:*:*) # DolphinOS (SVR3) + echo m88k-dolphin-sysv3 + exit ;; + M88*:*:R3*:*) + # Delta 88k system running SVR3 + echo m88k-motorola-sysv3 + exit ;; + XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) + echo m88k-tektronix-sysv3 + exit ;; + Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) + echo m68k-tektronix-bsd + exit ;; + *:IRIX*:*:*) + echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` + exit ;; + ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. + echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id + exit ;; # Note that: echo "'`uname -s`'" gives 'AIX ' + i*86:AIX:*:*) + echo i386-ibm-aix + exit ;; + ia64:AIX:*:*) + if [ -x /usr/bin/oslevel ] ; then + IBM_REV=`/usr/bin/oslevel` + else + IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} + fi + echo ${UNAME_MACHINE}-ibm-aix${IBM_REV} + exit ;; + *:AIX:2:3) + if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #include + + main() + { + if (!__power_pc()) + exit(1); + puts("powerpc-ibm-aix3.2.5"); + exit(0); + } +EOF + if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` + then + echo "$SYSTEM_NAME" + else + echo rs6000-ibm-aix3.2.5 + fi + elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then + echo rs6000-ibm-aix3.2.4 + else + echo rs6000-ibm-aix3.2 + fi + exit ;; + *:AIX:*:[45]) + IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` + if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then + IBM_ARCH=rs6000 + else + IBM_ARCH=powerpc + fi + if [ -x /usr/bin/oslevel ] ; then + IBM_REV=`/usr/bin/oslevel` + else + IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} + fi + echo ${IBM_ARCH}-ibm-aix${IBM_REV} + exit ;; + *:AIX:*:*) + echo rs6000-ibm-aix + exit ;; + ibmrt:4.4BSD:*|romp-ibm:BSD:*) + echo romp-ibm-bsd4.4 + exit ;; + ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and + echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to + exit ;; # report: romp-ibm BSD 4.3 + *:BOSX:*:*) + echo rs6000-bull-bosx + exit ;; + DPX/2?00:B.O.S.:*:*) + echo m68k-bull-sysv3 + exit ;; + 9000/[34]??:4.3bsd:1.*:*) + echo m68k-hp-bsd + exit ;; + hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) + echo m68k-hp-bsd4.4 + exit ;; + 9000/[34678]??:HP-UX:*:*) + HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` + case "${UNAME_MACHINE}" in + 9000/31? ) HP_ARCH=m68000 ;; + 9000/[34]?? ) HP_ARCH=m68k ;; + 9000/[678][0-9][0-9]) + if [ -x /usr/bin/getconf ]; then + sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` + sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` + case "${sc_cpu_version}" in + 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 + 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 + 532) # CPU_PA_RISC2_0 + case "${sc_kernel_bits}" in + 32) HP_ARCH="hppa2.0n" ;; + 64) HP_ARCH="hppa2.0w" ;; + '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20 + esac ;; + esac + fi + if [ "${HP_ARCH}" = "" ]; then + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + + #define _HPUX_SOURCE + #include + #include + + int main () + { + #if defined(_SC_KERNEL_BITS) + long bits = sysconf(_SC_KERNEL_BITS); + #endif + long cpu = sysconf (_SC_CPU_VERSION); + + switch (cpu) + { + case CPU_PA_RISC1_0: puts ("hppa1.0"); break; + case CPU_PA_RISC1_1: puts ("hppa1.1"); break; + case CPU_PA_RISC2_0: + #if defined(_SC_KERNEL_BITS) + switch (bits) + { + case 64: puts ("hppa2.0w"); break; + case 32: puts ("hppa2.0n"); break; + default: puts ("hppa2.0"); break; + } break; + #else /* !defined(_SC_KERNEL_BITS) */ + puts ("hppa2.0"); break; + #endif + default: puts ("hppa1.0"); break; + } + exit (0); + } +EOF + (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` + test -z "$HP_ARCH" && HP_ARCH=hppa + fi ;; + esac + if [ ${HP_ARCH} = "hppa2.0w" ] + then + eval $set_cc_for_build + + # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating + # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler + # generating 64-bit code. GNU and HP use different nomenclature: + # + # $ CC_FOR_BUILD=cc ./config.guess + # => hppa2.0w-hp-hpux11.23 + # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess + # => hppa64-hp-hpux11.23 + + if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | + grep __LP64__ >/dev/null + then + HP_ARCH="hppa2.0w" + else + HP_ARCH="hppa64" + fi + fi + echo ${HP_ARCH}-hp-hpux${HPUX_REV} + exit ;; + ia64:HP-UX:*:*) + HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` + echo ia64-hp-hpux${HPUX_REV} + exit ;; + 3050*:HI-UX:*:*) + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #include + int + main () + { + long cpu = sysconf (_SC_CPU_VERSION); + /* The order matters, because CPU_IS_HP_MC68K erroneously returns + true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct + results, however. */ + if (CPU_IS_PA_RISC (cpu)) + { + switch (cpu) + { + case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; + case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; + case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; + default: puts ("hppa-hitachi-hiuxwe2"); break; + } + } + else if (CPU_IS_HP_MC68K (cpu)) + puts ("m68k-hitachi-hiuxwe2"); + else puts ("unknown-hitachi-hiuxwe2"); + exit (0); + } +EOF + $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` && + { echo "$SYSTEM_NAME"; exit; } + echo unknown-hitachi-hiuxwe2 + exit ;; + 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) + echo hppa1.1-hp-bsd + exit ;; + 9000/8??:4.3bsd:*:*) + echo hppa1.0-hp-bsd + exit ;; + *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) + echo hppa1.0-hp-mpeix + exit ;; + hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) + echo hppa1.1-hp-osf + exit ;; + hp8??:OSF1:*:*) + echo hppa1.0-hp-osf + exit ;; + i*86:OSF1:*:*) + if [ -x /usr/sbin/sysversion ] ; then + echo ${UNAME_MACHINE}-unknown-osf1mk + else + echo ${UNAME_MACHINE}-unknown-osf1 + fi + exit ;; + parisc*:Lites*:*:*) + echo hppa1.1-hp-lites + exit ;; + C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) + echo c1-convex-bsd + exit ;; + C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) + if getsysinfo -f scalar_acc + then echo c32-convex-bsd + else echo c2-convex-bsd + fi + exit ;; + C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) + echo c34-convex-bsd + exit ;; + C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) + echo c38-convex-bsd + exit ;; + C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) + echo c4-convex-bsd + exit ;; + CRAY*Y-MP:*:*:*) + echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit ;; + CRAY*[A-Z]90:*:*:*) + echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ + | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ + -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ + -e 's/\.[^.]*$/.X/' + exit ;; + CRAY*TS:*:*:*) + echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit ;; + CRAY*T3E:*:*:*) + echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit ;; + CRAY*SV1:*:*:*) + echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit ;; + *:UNICOS/mp:*:*) + echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit ;; + F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) + FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` + FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` + echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" + exit ;; + 5000:UNIX_System_V:4.*:*) + FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` + FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'` + echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" + exit ;; + i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) + echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} + exit ;; + sparc*:BSD/OS:*:*) + echo sparc-unknown-bsdi${UNAME_RELEASE} + exit ;; + *:BSD/OS:*:*) + echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} + exit ;; + *:FreeBSD:*:*) + echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` + exit ;; + i*:CYGWIN*:*) + echo ${UNAME_MACHINE}-pc-cygwin + exit ;; + i*:MINGW*:*) + echo ${UNAME_MACHINE}-pc-mingw32 + exit ;; + i*:windows32*:*) + # uname -m includes "-pc" on this system. + echo ${UNAME_MACHINE}-mingw32 + exit ;; + i*:PW*:*) + echo ${UNAME_MACHINE}-pc-pw32 + exit ;; + x86:Interix*:[34]*) + echo i586-pc-interix${UNAME_RELEASE}|sed -e 's/\..*//' + exit ;; + [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) + echo i${UNAME_MACHINE}-pc-mks + exit ;; + i*:Windows_NT*:* | Pentium*:Windows_NT*:*) + # How do we know it's Interix rather than the generic POSIX subsystem? + # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we + # UNAME_MACHINE based on the output of uname instead of i386? + echo i586-pc-interix + exit ;; + i*:UWIN*:*) + echo ${UNAME_MACHINE}-pc-uwin + exit ;; + amd64:CYGWIN*:*:*) + echo x86_64-unknown-cygwin + exit ;; + p*:CYGWIN*:*) + echo powerpcle-unknown-cygwin + exit ;; + prep*:SunOS:5.*:*) + echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; + *:GNU:*:*) + # the GNU system + echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` + exit ;; + *:GNU/*:*:*) + # other systems with GNU libc and userland + echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu + exit ;; + i*86:Minix:*:*) + echo ${UNAME_MACHINE}-pc-minix + exit ;; + arm*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + cris:Linux:*:*) + echo cris-axis-linux-gnu + exit ;; + crisv32:Linux:*:*) + echo crisv32-axis-linux-gnu + exit ;; + frv:Linux:*:*) + echo frv-unknown-linux-gnu + exit ;; + ia64:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + m32r*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + m68*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + mips:Linux:*:*) + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #undef CPU + #undef mips + #undef mipsel + #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) + CPU=mipsel + #else + #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) + CPU=mips + #else + CPU= + #endif + #endif +EOF + eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=` + test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } + ;; + mips64:Linux:*:*) + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #undef CPU + #undef mips64 + #undef mips64el + #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) + CPU=mips64el + #else + #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) + CPU=mips64 + #else + CPU= + #endif + #endif +EOF + eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=` + test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } + ;; + ppc:Linux:*:*) + echo powerpc-unknown-linux-gnu + exit ;; + ppc64:Linux:*:*) + echo powerpc64-unknown-linux-gnu + exit ;; + alpha:Linux:*:*) + case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in + EV5) UNAME_MACHINE=alphaev5 ;; + EV56) UNAME_MACHINE=alphaev56 ;; + PCA56) UNAME_MACHINE=alphapca56 ;; + PCA57) UNAME_MACHINE=alphapca56 ;; + EV6) UNAME_MACHINE=alphaev6 ;; + EV67) UNAME_MACHINE=alphaev67 ;; + EV68*) UNAME_MACHINE=alphaev68 ;; + esac + objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null + if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi + echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} + exit ;; + parisc:Linux:*:* | hppa:Linux:*:*) + # Look for CPU level + case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in + PA7*) echo hppa1.1-unknown-linux-gnu ;; + PA8*) echo hppa2.0-unknown-linux-gnu ;; + *) echo hppa-unknown-linux-gnu ;; + esac + exit ;; + parisc64:Linux:*:* | hppa64:Linux:*:*) + echo hppa64-unknown-linux-gnu + exit ;; + s390:Linux:*:* | s390x:Linux:*:*) + echo ${UNAME_MACHINE}-ibm-linux + exit ;; + sh64*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + sh*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + sparc:Linux:*:* | sparc64:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + x86_64:Linux:*:*) + echo x86_64-unknown-linux-gnu + exit ;; + i*86:Linux:*:*) + # The BFD linker knows what the default object file format is, so + # first see if it will tell us. cd to the root directory to prevent + # problems with other programs or directories called `ld' in the path. + # Set LC_ALL=C to ensure ld outputs messages in English. + ld_supported_targets=`cd /; LC_ALL=C ld --help 2>&1 \ + | sed -ne '/supported targets:/!d + s/[ ][ ]*/ /g + s/.*supported targets: *// + s/ .*// + p'` + case "$ld_supported_targets" in + elf32-i386) + TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu" + ;; + a.out-i386-linux) + echo "${UNAME_MACHINE}-pc-linux-gnuaout" + exit ;; + coff-i386) + echo "${UNAME_MACHINE}-pc-linux-gnucoff" + exit ;; + "") + # Either a pre-BFD a.out linker (linux-gnuoldld) or + # one that does not give us useful --help. + echo "${UNAME_MACHINE}-pc-linux-gnuoldld" + exit ;; + esac + # Determine whether the default compiler is a.out or elf + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #include + #ifdef __ELF__ + # ifdef __GLIBC__ + # if __GLIBC__ >= 2 + LIBC=gnu + # else + LIBC=gnulibc1 + # endif + # else + LIBC=gnulibc1 + # endif + #else + #ifdef __INTEL_COMPILER + LIBC=gnu + #else + LIBC=gnuaout + #endif + #endif + #ifdef __dietlibc__ + LIBC=dietlibc + #endif +EOF + eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=` + test x"${LIBC}" != x && { + echo "${UNAME_MACHINE}-pc-linux-${LIBC}" + exit + } + test x"${TENTATIVE}" != x && { echo "${TENTATIVE}"; exit; } + ;; + i*86:DYNIX/ptx:4*:*) + # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. + # earlier versions are messed up and put the nodename in both + # sysname and nodename. + echo i386-sequent-sysv4 + exit ;; + i*86:UNIX_SV:4.2MP:2.*) + # Unixware is an offshoot of SVR4, but it has its own version + # number series starting with 2... + # I am not positive that other SVR4 systems won't match this, + # I just have to hope. -- rms. + # Use sysv4.2uw... so that sysv4* matches it. + echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} + exit ;; + i*86:OS/2:*:*) + # If we were able to find `uname', then EMX Unix compatibility + # is probably installed. + echo ${UNAME_MACHINE}-pc-os2-emx + exit ;; + i*86:XTS-300:*:STOP) + echo ${UNAME_MACHINE}-unknown-stop + exit ;; + i*86:atheos:*:*) + echo ${UNAME_MACHINE}-unknown-atheos + exit ;; + i*86:syllable:*:*) + echo ${UNAME_MACHINE}-pc-syllable + exit ;; + i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*) + echo i386-unknown-lynxos${UNAME_RELEASE} + exit ;; + i*86:*DOS:*:*) + echo ${UNAME_MACHINE}-pc-msdosdjgpp + exit ;; + i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*) + UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` + if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then + echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL} + else + echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} + fi + exit ;; + i*86:*:5:[678]*) + # UnixWare 7.x, OpenUNIX and OpenServer 6. + case `/bin/uname -X | grep "^Machine"` in + *486*) UNAME_MACHINE=i486 ;; + *Pentium) UNAME_MACHINE=i586 ;; + *Pent*|*Celeron) UNAME_MACHINE=i686 ;; + esac + echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} + exit ;; + i*86:*:3.2:*) + if test -f /usr/options/cb.name; then + UNAME_REL=`sed -n 's/.*Version //p' /dev/null >/dev/null ; then + UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` + (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 + (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \ + && UNAME_MACHINE=i586 + (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \ + && UNAME_MACHINE=i686 + (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ + && UNAME_MACHINE=i686 + echo ${UNAME_MACHINE}-pc-sco$UNAME_REL + else + echo ${UNAME_MACHINE}-pc-sysv32 + fi + exit ;; + pc:*:*:*) + # Left here for compatibility: + # uname -m prints for DJGPP always 'pc', but it prints nothing about + # the processor, so we play safe by assuming i386. + echo i386-pc-msdosdjgpp + exit ;; + Intel:Mach:3*:*) + echo i386-pc-mach3 + exit ;; + paragon:*:*:*) + echo i860-intel-osf1 + exit ;; + i860:*:4.*:*) # i860-SVR4 + if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then + echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4 + else # Add other i860-SVR4 vendors below as they are discovered. + echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4 + fi + exit ;; + mini*:CTIX:SYS*5:*) + # "miniframe" + echo m68010-convergent-sysv + exit ;; + mc68k:UNIX:SYSTEM5:3.51m) + echo m68k-convergent-sysv + exit ;; + M680?0:D-NIX:5.3:*) + echo m68k-diab-dnix + exit ;; + M68*:*:R3V[5678]*:*) + test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;; + 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0) + OS_REL='' + test -r /etc/.relid \ + && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` + /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ + && { echo i486-ncr-sysv4.3${OS_REL}; exit; } + /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ + && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; + 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) + /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ + && { echo i486-ncr-sysv4; exit; } ;; + m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) + echo m68k-unknown-lynxos${UNAME_RELEASE} + exit ;; + mc68030:UNIX_System_V:4.*:*) + echo m68k-atari-sysv4 + exit ;; + TSUNAMI:LynxOS:2.*:*) + echo sparc-unknown-lynxos${UNAME_RELEASE} + exit ;; + rs6000:LynxOS:2.*:*) + echo rs6000-unknown-lynxos${UNAME_RELEASE} + exit ;; + PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*) + echo powerpc-unknown-lynxos${UNAME_RELEASE} + exit ;; + SM[BE]S:UNIX_SV:*:*) + echo mips-dde-sysv${UNAME_RELEASE} + exit ;; + RM*:ReliantUNIX-*:*:*) + echo mips-sni-sysv4 + exit ;; + RM*:SINIX-*:*:*) + echo mips-sni-sysv4 + exit ;; + *:SINIX-*:*:*) + if uname -p 2>/dev/null >/dev/null ; then + UNAME_MACHINE=`(uname -p) 2>/dev/null` + echo ${UNAME_MACHINE}-sni-sysv4 + else + echo ns32k-sni-sysv + fi + exit ;; + PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort + # says + echo i586-unisys-sysv4 + exit ;; + *:UNIX_System_V:4*:FTX*) + # From Gerald Hewes . + # How about differentiating between stratus architectures? -djm + echo hppa1.1-stratus-sysv4 + exit ;; + *:*:*:FTX*) + # From seanf@swdc.stratus.com. + echo i860-stratus-sysv4 + exit ;; + i*86:VOS:*:*) + # From Paul.Green@stratus.com. + echo ${UNAME_MACHINE}-stratus-vos + exit ;; + *:VOS:*:*) + # From Paul.Green@stratus.com. + echo hppa1.1-stratus-vos + exit ;; + mc68*:A/UX:*:*) + echo m68k-apple-aux${UNAME_RELEASE} + exit ;; + news*:NEWS-OS:6*:*) + echo mips-sony-newsos6 + exit ;; + R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) + if [ -d /usr/nec ]; then + echo mips-nec-sysv${UNAME_RELEASE} + else + echo mips-unknown-sysv${UNAME_RELEASE} + fi + exit ;; + BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. + echo powerpc-be-beos + exit ;; + BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. + echo powerpc-apple-beos + exit ;; + BePC:BeOS:*:*) # BeOS running on Intel PC compatible. + echo i586-pc-beos + exit ;; + SX-4:SUPER-UX:*:*) + echo sx4-nec-superux${UNAME_RELEASE} + exit ;; + SX-5:SUPER-UX:*:*) + echo sx5-nec-superux${UNAME_RELEASE} + exit ;; + SX-6:SUPER-UX:*:*) + echo sx6-nec-superux${UNAME_RELEASE} + exit ;; + Power*:Rhapsody:*:*) + echo powerpc-apple-rhapsody${UNAME_RELEASE} + exit ;; + *:Rhapsody:*:*) + echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} + exit ;; + *:Darwin:*:*) + UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown + case $UNAME_PROCESSOR in + *86) UNAME_PROCESSOR=i686 ;; + unknown) UNAME_PROCESSOR=powerpc ;; + esac + echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} + exit ;; + *:procnto*:*:* | *:QNX:[0123456789]*:*) + UNAME_PROCESSOR=`uname -p` + if test "$UNAME_PROCESSOR" = "x86"; then + UNAME_PROCESSOR=i386 + UNAME_MACHINE=pc + fi + echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE} + exit ;; + *:QNX:*:4*) + echo i386-pc-qnx + exit ;; + NSE-?:NONSTOP_KERNEL:*:*) + echo nse-tandem-nsk${UNAME_RELEASE} + exit ;; + NSR-?:NONSTOP_KERNEL:*:*) + echo nsr-tandem-nsk${UNAME_RELEASE} + exit ;; + *:NonStop-UX:*:*) + echo mips-compaq-nonstopux + exit ;; + BS2000:POSIX*:*:*) + echo bs2000-siemens-sysv + exit ;; + DS/*:UNIX_System_V:*:*) + echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} + exit ;; + *:Plan9:*:*) + # "uname -m" is not consistent, so use $cputype instead. 386 + # is converted to i386 for consistency with other x86 + # operating systems. + if test "$cputype" = "386"; then + UNAME_MACHINE=i386 + else + UNAME_MACHINE="$cputype" + fi + echo ${UNAME_MACHINE}-unknown-plan9 + exit ;; + *:TOPS-10:*:*) + echo pdp10-unknown-tops10 + exit ;; + *:TENEX:*:*) + echo pdp10-unknown-tenex + exit ;; + KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) + echo pdp10-dec-tops20 + exit ;; + XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) + echo pdp10-xkl-tops20 + exit ;; + *:TOPS-20:*:*) + echo pdp10-unknown-tops20 + exit ;; + *:ITS:*:*) + echo pdp10-unknown-its + exit ;; + SEI:*:*:SEIUX) + echo mips-sei-seiux${UNAME_RELEASE} + exit ;; + *:DragonFly:*:*) + echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` + exit ;; + *:*VMS:*:*) + UNAME_MACHINE=`(uname -p) 2>/dev/null` + case "${UNAME_MACHINE}" in + A*) echo alpha-dec-vms ; exit ;; + I*) echo ia64-dec-vms ; exit ;; + V*) echo vax-dec-vms ; exit ;; + esac ;; + *:XENIX:*:SysV) + echo i386-pc-xenix + exit ;; + i*86:skyos:*:*) + echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//' + exit ;; +esac + +#echo '(No uname command or uname output not recognized.)' 1>&2 +#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2 + +eval $set_cc_for_build +cat >$dummy.c < +# include +#endif +main () +{ +#if defined (sony) +#if defined (MIPSEB) + /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed, + I don't know.... */ + printf ("mips-sony-bsd\n"); exit (0); +#else +#include + printf ("m68k-sony-newsos%s\n", +#ifdef NEWSOS4 + "4" +#else + "" +#endif + ); exit (0); +#endif +#endif + +#if defined (__arm) && defined (__acorn) && defined (__unix) + printf ("arm-acorn-riscix\n"); exit (0); +#endif + +#if defined (hp300) && !defined (hpux) + printf ("m68k-hp-bsd\n"); exit (0); +#endif + +#if defined (NeXT) +#if !defined (__ARCHITECTURE__) +#define __ARCHITECTURE__ "m68k" +#endif + int version; + version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; + if (version < 4) + printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); + else + printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version); + exit (0); +#endif + +#if defined (MULTIMAX) || defined (n16) +#if defined (UMAXV) + printf ("ns32k-encore-sysv\n"); exit (0); +#else +#if defined (CMU) + printf ("ns32k-encore-mach\n"); exit (0); +#else + printf ("ns32k-encore-bsd\n"); exit (0); +#endif +#endif +#endif + +#if defined (__386BSD__) + printf ("i386-pc-bsd\n"); exit (0); +#endif + +#if defined (sequent) +#if defined (i386) + printf ("i386-sequent-dynix\n"); exit (0); +#endif +#if defined (ns32000) + printf ("ns32k-sequent-dynix\n"); exit (0); +#endif +#endif + +#if defined (_SEQUENT_) + struct utsname un; + + uname(&un); + + if (strncmp(un.version, "V2", 2) == 0) { + printf ("i386-sequent-ptx2\n"); exit (0); + } + if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */ + printf ("i386-sequent-ptx1\n"); exit (0); + } + printf ("i386-sequent-ptx\n"); exit (0); + +#endif + +#if defined (vax) +# if !defined (ultrix) +# include +# if defined (BSD) +# if BSD == 43 + printf ("vax-dec-bsd4.3\n"); exit (0); +# else +# if BSD == 199006 + printf ("vax-dec-bsd4.3reno\n"); exit (0); +# else + printf ("vax-dec-bsd\n"); exit (0); +# endif +# endif +# else + printf ("vax-dec-bsd\n"); exit (0); +# endif +# else + printf ("vax-dec-ultrix\n"); exit (0); +# endif +#endif + +#if defined (alliant) && defined (i860) + printf ("i860-alliant-bsd\n"); exit (0); +#endif + + exit (1); +} +EOF + +$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` && + { echo "$SYSTEM_NAME"; exit; } + +# Apollos put the system type in the environment. + +test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; } + +# Convex versions that predate uname can use getsysinfo(1) + +if [ -x /usr/convex/getsysinfo ] +then + case `getsysinfo -f cpu_type` in + c1*) + echo c1-convex-bsd + exit ;; + c2*) + if getsysinfo -f scalar_acc + then echo c32-convex-bsd + else echo c2-convex-bsd + fi + exit ;; + c34*) + echo c34-convex-bsd + exit ;; + c38*) + echo c38-convex-bsd + exit ;; + c4*) + echo c4-convex-bsd + exit ;; + esac +fi + +cat >&2 < in order to provide the needed +information to handle your system. + +config.guess timestamp = $timestamp + +uname -m = `(uname -m) 2>/dev/null || echo unknown` +uname -r = `(uname -r) 2>/dev/null || echo unknown` +uname -s = `(uname -s) 2>/dev/null || echo unknown` +uname -v = `(uname -v) 2>/dev/null || echo unknown` + +/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null` +/bin/uname -X = `(/bin/uname -X) 2>/dev/null` + +hostinfo = `(hostinfo) 2>/dev/null` +/bin/universe = `(/bin/universe) 2>/dev/null` +/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` +/bin/arch = `(/bin/arch) 2>/dev/null` +/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` +/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` + +UNAME_MACHINE = ${UNAME_MACHINE} +UNAME_RELEASE = ${UNAME_RELEASE} +UNAME_SYSTEM = ${UNAME_SYSTEM} +UNAME_VERSION = ${UNAME_VERSION} +EOF + +exit 1 + +# Local variables: +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "timestamp='" +# time-stamp-format: "%:y-%02m-%02d" +# time-stamp-end: "'" +# End: diff --git a/app/xf86dga/config.h.in b/app/xf86dga/config.h.in new file mode 100644 index 000000000..c364eda45 --- /dev/null +++ b/app/xf86dga/config.h.in @@ -0,0 +1,22 @@ +/* config.h.in. Generated from configure.ac by autoheader. */ + +/* Name of package */ +#undef PACKAGE + +/* Define to the address where bug reports for this package should be sent. */ +#undef PACKAGE_BUGREPORT + +/* Define to the full name of this package. */ +#undef PACKAGE_NAME + +/* Define to the full name and version of this package. */ +#undef PACKAGE_STRING + +/* Define to the one symbol short name of this package. */ +#undef PACKAGE_TARNAME + +/* Define to the version of this package. */ +#undef PACKAGE_VERSION + +/* Version number of package */ +#undef VERSION diff --git a/app/xf86dga/config.sub b/app/xf86dga/config.sub new file mode 100644 index 000000000..1c366dfde --- /dev/null +++ b/app/xf86dga/config.sub @@ -0,0 +1,1579 @@ +#! /bin/sh +# Configuration validation subroutine script. +# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, +# 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. + +timestamp='2005-07-08' + +# This file is (in principle) common to ALL GNU software. +# The presence of a machine in this file suggests that SOME GNU software +# can handle that machine. It does not imply ALL GNU software can. +# +# This file is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA +# 02110-1301, USA. +# +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + + +# Please send patches to . Submit a context +# diff and a properly formatted ChangeLog entry. +# +# Configuration subroutine to validate and canonicalize a configuration type. +# Supply the specified configuration type as an argument. +# If it is invalid, we print an error message on stderr and exit with code 1. +# Otherwise, we print the canonical config type on stdout and succeed. + +# This file is supposed to be the same for all GNU packages +# and recognize all the CPU types, system types and aliases +# that are meaningful with *any* GNU software. +# Each package is responsible for reporting which valid configurations +# it does not support. The user should be able to distinguish +# a failure to support a valid configuration from a meaningless +# configuration. + +# The goal of this file is to map all the various variations of a given +# machine specification into a single specification in the form: +# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM +# or in some cases, the newer four-part form: +# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM +# It is wrong to echo any other type of specification. + +me=`echo "$0" | sed -e 's,.*/,,'` + +usage="\ +Usage: $0 [OPTION] CPU-MFR-OPSYS + $0 [OPTION] ALIAS + +Canonicalize a configuration name. + +Operation modes: + -h, --help print this help, then exit + -t, --time-stamp print date of last modification, then exit + -v, --version print version number, then exit + +Report bugs and patches to ." + +version="\ +GNU config.sub ($timestamp) + +Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 +Free Software Foundation, Inc. + +This is free software; see the source for copying conditions. There is NO +warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." + +help=" +Try \`$me --help' for more information." + +# Parse command line +while test $# -gt 0 ; do + case $1 in + --time-stamp | --time* | -t ) + echo "$timestamp" ; exit ;; + --version | -v ) + echo "$version" ; exit ;; + --help | --h* | -h ) + echo "$usage"; exit ;; + -- ) # Stop option processing + shift; break ;; + - ) # Use stdin as input. + break ;; + -* ) + echo "$me: invalid option $1$help" + exit 1 ;; + + *local*) + # First pass through any local machine types. + echo $1 + exit ;; + + * ) + break ;; + esac +done + +case $# in + 0) echo "$me: missing argument$help" >&2 + exit 1;; + 1) ;; + *) echo "$me: too many arguments$help" >&2 + exit 1;; +esac + +# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). +# Here we must recognize all the valid KERNEL-OS combinations. +maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` +case $maybe_os in + nto-qnx* | linux-gnu* | linux-dietlibc | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | \ + kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | storm-chaos* | os2-emx* | rtmk-nova*) + os=-$maybe_os + basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` + ;; + *) + basic_machine=`echo $1 | sed 's/-[^-]*$//'` + if [ $basic_machine != $1 ] + then os=`echo $1 | sed 's/.*-/-/'` + else os=; fi + ;; +esac + +### Let's recognize common machines as not being operating systems so +### that things like config.sub decstation-3100 work. We also +### recognize some manufacturers as not being operating systems, so we +### can provide default operating systems below. +case $os in + -sun*os*) + # Prevent following clause from handling this invalid input. + ;; + -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \ + -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \ + -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \ + -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ + -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ + -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ + -apple | -axis | -knuth | -cray) + os= + basic_machine=$1 + ;; + -sim | -cisco | -oki | -wec | -winbond) + os= + basic_machine=$1 + ;; + -scout) + ;; + -wrs) + os=-vxworks + basic_machine=$1 + ;; + -chorusos*) + os=-chorusos + basic_machine=$1 + ;; + -chorusrdb) + os=-chorusrdb + basic_machine=$1 + ;; + -hiux*) + os=-hiuxwe2 + ;; + -sco5) + os=-sco3.2v5 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco4) + os=-sco3.2v4 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco3.2.[4-9]*) + os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco3.2v[4-9]*) + # Don't forget version if it is 3.2v4 or newer. + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco*) + os=-sco3.2v2 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -udk*) + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -isc) + os=-isc2.2 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -clix*) + basic_machine=clipper-intergraph + ;; + -isc*) + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -lynx*) + os=-lynxos + ;; + -ptx*) + basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'` + ;; + -windowsnt*) + os=`echo $os | sed -e 's/windowsnt/winnt/'` + ;; + -psos*) + os=-psos + ;; + -mint | -mint[0-9]*) + basic_machine=m68k-atari + os=-mint + ;; +esac + +# Decode aliases for certain CPU-COMPANY combinations. +case $basic_machine in + # Recognize the basic CPU types without company name. + # Some are omitted here because they have special meanings below. + 1750a | 580 \ + | a29k \ + | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ + | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ + | am33_2.0 \ + | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr \ + | bfin \ + | c4x | clipper \ + | d10v | d30v | dlx | dsp16xx \ + | fr30 | frv \ + | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ + | i370 | i860 | i960 | ia64 \ + | ip2k | iq2000 \ + | m32r | m32rle | m68000 | m68k | m88k | maxq | mcore \ + | mips | mipsbe | mipseb | mipsel | mipsle \ + | mips16 \ + | mips64 | mips64el \ + | mips64vr | mips64vrel \ + | mips64orion | mips64orionel \ + | mips64vr4100 | mips64vr4100el \ + | mips64vr4300 | mips64vr4300el \ + | mips64vr5000 | mips64vr5000el \ + | mips64vr5900 | mips64vr5900el \ + | mipsisa32 | mipsisa32el \ + | mipsisa32r2 | mipsisa32r2el \ + | mipsisa64 | mipsisa64el \ + | mipsisa64r2 | mipsisa64r2el \ + | mipsisa64sb1 | mipsisa64sb1el \ + | mipsisa64sr71k | mipsisa64sr71kel \ + | mipstx39 | mipstx39el \ + | mn10200 | mn10300 \ + | ms1 \ + | msp430 \ + | ns16k | ns32k \ + | or32 \ + | pdp10 | pdp11 | pj | pjl \ + | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \ + | pyramid \ + | sh | sh[1234] | sh[24]a | sh[23]e | sh[34]eb | shbe | shle | sh[1234]le | sh3ele \ + | sh64 | sh64le \ + | sparc | sparc64 | sparc64b | sparc86x | sparclet | sparclite \ + | sparcv8 | sparcv9 | sparcv9b \ + | strongarm \ + | tahoe | thumb | tic4x | tic80 | tron \ + | v850 | v850e \ + | we32k \ + | x86 | xscale | xscalee[bl] | xstormy16 | xtensa \ + | z8k) + basic_machine=$basic_machine-unknown + ;; + m32c) + basic_machine=$basic_machine-unknown + ;; + m6811 | m68hc11 | m6812 | m68hc12) + # Motorola 68HC11/12. + basic_machine=$basic_machine-unknown + os=-none + ;; + m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) + ;; + + # We use `pc' rather than `unknown' + # because (1) that's what they normally are, and + # (2) the word "unknown" tends to confuse beginning users. + i*86 | x86_64) + basic_machine=$basic_machine-pc + ;; + # Object if more than one company name word. + *-*-*) + echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 + exit 1 + ;; + # Recognize the basic CPU types with company name. + 580-* \ + | a29k-* \ + | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ + | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ + | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \ + | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ + | avr-* \ + | bfin-* | bs2000-* \ + | c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \ + | clipper-* | craynv-* | cydra-* \ + | d10v-* | d30v-* | dlx-* \ + | elxsi-* \ + | f30[01]-* | f700-* | fr30-* | frv-* | fx80-* \ + | h8300-* | h8500-* \ + | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ + | i*86-* | i860-* | i960-* | ia64-* \ + | ip2k-* | iq2000-* \ + | m32r-* | m32rle-* \ + | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ + | m88110-* | m88k-* | maxq-* | mcore-* \ + | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ + | mips16-* \ + | mips64-* | mips64el-* \ + | mips64vr-* | mips64vrel-* \ + | mips64orion-* | mips64orionel-* \ + | mips64vr4100-* | mips64vr4100el-* \ + | mips64vr4300-* | mips64vr4300el-* \ + | mips64vr5000-* | mips64vr5000el-* \ + | mips64vr5900-* | mips64vr5900el-* \ + | mipsisa32-* | mipsisa32el-* \ + | mipsisa32r2-* | mipsisa32r2el-* \ + | mipsisa64-* | mipsisa64el-* \ + | mipsisa64r2-* | mipsisa64r2el-* \ + | mipsisa64sb1-* | mipsisa64sb1el-* \ + | mipsisa64sr71k-* | mipsisa64sr71kel-* \ + | mipstx39-* | mipstx39el-* \ + | mmix-* \ + | ms1-* \ + | msp430-* \ + | none-* | np1-* | ns16k-* | ns32k-* \ + | orion-* \ + | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ + | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \ + | pyramid-* \ + | romp-* | rs6000-* \ + | sh-* | sh[1234]-* | sh[24]a-* | sh[23]e-* | sh[34]eb-* | shbe-* \ + | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ + | sparc-* | sparc64-* | sparc64b-* | sparc86x-* | sparclet-* \ + | sparclite-* \ + | sparcv8-* | sparcv9-* | sparcv9b-* | strongarm-* | sv1-* | sx?-* \ + | tahoe-* | thumb-* \ + | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ + | tron-* \ + | v850-* | v850e-* | vax-* \ + | we32k-* \ + | x86-* | x86_64-* | xps100-* | xscale-* | xscalee[bl]-* \ + | xstormy16-* | xtensa-* \ + | ymp-* \ + | z8k-*) + ;; + m32c-*) + ;; + # Recognize the various machine names and aliases which stand + # for a CPU type and a company and sometimes even an OS. + 386bsd) + basic_machine=i386-unknown + os=-bsd + ;; + 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) + basic_machine=m68000-att + ;; + 3b*) + basic_machine=we32k-att + ;; + a29khif) + basic_machine=a29k-amd + os=-udi + ;; + abacus) + basic_machine=abacus-unknown + ;; + adobe68k) + basic_machine=m68010-adobe + os=-scout + ;; + alliant | fx80) + basic_machine=fx80-alliant + ;; + altos | altos3068) + basic_machine=m68k-altos + ;; + am29k) + basic_machine=a29k-none + os=-bsd + ;; + amd64) + basic_machine=x86_64-pc + ;; + amd64-*) + basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + amdahl) + basic_machine=580-amdahl + os=-sysv + ;; + amiga | amiga-*) + basic_machine=m68k-unknown + ;; + amigaos | amigados) + basic_machine=m68k-unknown + os=-amigaos + ;; + amigaunix | amix) + basic_machine=m68k-unknown + os=-sysv4 + ;; + apollo68) + basic_machine=m68k-apollo + os=-sysv + ;; + apollo68bsd) + basic_machine=m68k-apollo + os=-bsd + ;; + aux) + basic_machine=m68k-apple + os=-aux + ;; + balance) + basic_machine=ns32k-sequent + os=-dynix + ;; + c90) + basic_machine=c90-cray + os=-unicos + ;; + convex-c1) + basic_machine=c1-convex + os=-bsd + ;; + convex-c2) + basic_machine=c2-convex + os=-bsd + ;; + convex-c32) + basic_machine=c32-convex + os=-bsd + ;; + convex-c34) + basic_machine=c34-convex + os=-bsd + ;; + convex-c38) + basic_machine=c38-convex + os=-bsd + ;; + cray | j90) + basic_machine=j90-cray + os=-unicos + ;; + craynv) + basic_machine=craynv-cray + os=-unicosmp + ;; + cr16c) + basic_machine=cr16c-unknown + os=-elf + ;; + crds | unos) + basic_machine=m68k-crds + ;; + crisv32 | crisv32-* | etraxfs*) + basic_machine=crisv32-axis + ;; + cris | cris-* | etrax*) + basic_machine=cris-axis + ;; + crx) + basic_machine=crx-unknown + os=-elf + ;; + da30 | da30-*) + basic_machine=m68k-da30 + ;; + decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn) + basic_machine=mips-dec + ;; + decsystem10* | dec10*) + basic_machine=pdp10-dec + os=-tops10 + ;; + decsystem20* | dec20*) + basic_machine=pdp10-dec + os=-tops20 + ;; + delta | 3300 | motorola-3300 | motorola-delta \ + | 3300-motorola | delta-motorola) + basic_machine=m68k-motorola + ;; + delta88) + basic_machine=m88k-motorola + os=-sysv3 + ;; + djgpp) + basic_machine=i586-pc + os=-msdosdjgpp + ;; + dpx20 | dpx20-*) + basic_machine=rs6000-bull + os=-bosx + ;; + dpx2* | dpx2*-bull) + basic_machine=m68k-bull + os=-sysv3 + ;; + ebmon29k) + basic_machine=a29k-amd + os=-ebmon + ;; + elxsi) + basic_machine=elxsi-elxsi + os=-bsd + ;; + encore | umax | mmax) + basic_machine=ns32k-encore + ;; + es1800 | OSE68k | ose68k | ose | OSE) + basic_machine=m68k-ericsson + os=-ose + ;; + fx2800) + basic_machine=i860-alliant + ;; + genix) + basic_machine=ns32k-ns + ;; + gmicro) + basic_machine=tron-gmicro + os=-sysv + ;; + go32) + basic_machine=i386-pc + os=-go32 + ;; + h3050r* | hiux*) + basic_machine=hppa1.1-hitachi + os=-hiuxwe2 + ;; + h8300hms) + basic_machine=h8300-hitachi + os=-hms + ;; + h8300xray) + basic_machine=h8300-hitachi + os=-xray + ;; + h8500hms) + basic_machine=h8500-hitachi + os=-hms + ;; + harris) + basic_machine=m88k-harris + os=-sysv3 + ;; + hp300-*) + basic_machine=m68k-hp + ;; + hp300bsd) + basic_machine=m68k-hp + os=-bsd + ;; + hp300hpux) + basic_machine=m68k-hp + os=-hpux + ;; + hp3k9[0-9][0-9] | hp9[0-9][0-9]) + basic_machine=hppa1.0-hp + ;; + hp9k2[0-9][0-9] | hp9k31[0-9]) + basic_machine=m68000-hp + ;; + hp9k3[2-9][0-9]) + basic_machine=m68k-hp + ;; + hp9k6[0-9][0-9] | hp6[0-9][0-9]) + basic_machine=hppa1.0-hp + ;; + hp9k7[0-79][0-9] | hp7[0-79][0-9]) + basic_machine=hppa1.1-hp + ;; + hp9k78[0-9] | hp78[0-9]) + # FIXME: really hppa2.0-hp + basic_machine=hppa1.1-hp + ;; + hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) + # FIXME: really hppa2.0-hp + basic_machine=hppa1.1-hp + ;; + hp9k8[0-9][13679] | hp8[0-9][13679]) + basic_machine=hppa1.1-hp + ;; + hp9k8[0-9][0-9] | hp8[0-9][0-9]) + basic_machine=hppa1.0-hp + ;; + hppa-next) + os=-nextstep3 + ;; + hppaosf) + basic_machine=hppa1.1-hp + os=-osf + ;; + hppro) + basic_machine=hppa1.1-hp + os=-proelf + ;; + i370-ibm* | ibm*) + basic_machine=i370-ibm + ;; +# I'm not sure what "Sysv32" means. Should this be sysv3.2? + i*86v32) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-sysv32 + ;; + i*86v4*) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-sysv4 + ;; + i*86v) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-sysv + ;; + i*86sol2) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-solaris2 + ;; + i386mach) + basic_machine=i386-mach + os=-mach + ;; + i386-vsta | vsta) + basic_machine=i386-unknown + os=-vsta + ;; + iris | iris4d) + basic_machine=mips-sgi + case $os in + -irix*) + ;; + *) + os=-irix4 + ;; + esac + ;; + isi68 | isi) + basic_machine=m68k-isi + os=-sysv + ;; + m88k-omron*) + basic_machine=m88k-omron + ;; + magnum | m3230) + basic_machine=mips-mips + os=-sysv + ;; + merlin) + basic_machine=ns32k-utek + os=-sysv + ;; + mingw32) + basic_machine=i386-pc + os=-mingw32 + ;; + miniframe) + basic_machine=m68000-convergent + ;; + *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*) + basic_machine=m68k-atari + os=-mint + ;; + mips3*-*) + basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` + ;; + mips3*) + basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown + ;; + monitor) + basic_machine=m68k-rom68k + os=-coff + ;; + morphos) + basic_machine=powerpc-unknown + os=-morphos + ;; + msdos) + basic_machine=i386-pc + os=-msdos + ;; + mvs) + basic_machine=i370-ibm + os=-mvs + ;; + ncr3000) + basic_machine=i486-ncr + os=-sysv4 + ;; + netbsd386) + basic_machine=i386-unknown + os=-netbsd + ;; + netwinder) + basic_machine=armv4l-rebel + os=-linux + ;; + news | news700 | news800 | news900) + basic_machine=m68k-sony + os=-newsos + ;; + news1000) + basic_machine=m68030-sony + os=-newsos + ;; + news-3600 | risc-news) + basic_machine=mips-sony + os=-newsos + ;; + necv70) + basic_machine=v70-nec + os=-sysv + ;; + next | m*-next ) + basic_machine=m68k-next + case $os in + -nextstep* ) + ;; + -ns2*) + os=-nextstep2 + ;; + *) + os=-nextstep3 + ;; + esac + ;; + nh3000) + basic_machine=m68k-harris + os=-cxux + ;; + nh[45]000) + basic_machine=m88k-harris + os=-cxux + ;; + nindy960) + basic_machine=i960-intel + os=-nindy + ;; + mon960) + basic_machine=i960-intel + os=-mon960 + ;; + nonstopux) + basic_machine=mips-compaq + os=-nonstopux + ;; + np1) + basic_machine=np1-gould + ;; + nsr-tandem) + basic_machine=nsr-tandem + ;; + op50n-* | op60c-*) + basic_machine=hppa1.1-oki + os=-proelf + ;; + openrisc | openrisc-*) + basic_machine=or32-unknown + ;; + os400) + basic_machine=powerpc-ibm + os=-os400 + ;; + OSE68000 | ose68000) + basic_machine=m68000-ericsson + os=-ose + ;; + os68k) + basic_machine=m68k-none + os=-os68k + ;; + pa-hitachi) + basic_machine=hppa1.1-hitachi + os=-hiuxwe2 + ;; + paragon) + basic_machine=i860-intel + os=-osf + ;; + pbd) + basic_machine=sparc-tti + ;; + pbb) + basic_machine=m68k-tti + ;; + pc532 | pc532-*) + basic_machine=ns32k-pc532 + ;; + pentium | p5 | k5 | k6 | nexgen | viac3) + basic_machine=i586-pc + ;; + pentiumpro | p6 | 6x86 | athlon | athlon_*) + basic_machine=i686-pc + ;; + pentiumii | pentium2 | pentiumiii | pentium3) + basic_machine=i686-pc + ;; + pentium4) + basic_machine=i786-pc + ;; + pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) + basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pentiumpro-* | p6-* | 6x86-* | athlon-*) + basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*) + basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pentium4-*) + basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pn) + basic_machine=pn-gould + ;; + power) basic_machine=power-ibm + ;; + ppc) basic_machine=powerpc-unknown + ;; + ppc-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ppcle | powerpclittle | ppc-le | powerpc-little) + basic_machine=powerpcle-unknown + ;; + ppcle-* | powerpclittle-*) + basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ppc64) basic_machine=powerpc64-unknown + ;; + ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ppc64le | powerpc64little | ppc64-le | powerpc64-little) + basic_machine=powerpc64le-unknown + ;; + ppc64le-* | powerpc64little-*) + basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ps2) + basic_machine=i386-ibm + ;; + pw32) + basic_machine=i586-unknown + os=-pw32 + ;; + rom68k) + basic_machine=m68k-rom68k + os=-coff + ;; + rm[46]00) + basic_machine=mips-siemens + ;; + rtpc | rtpc-*) + basic_machine=romp-ibm + ;; + s390 | s390-*) + basic_machine=s390-ibm + ;; + s390x | s390x-*) + basic_machine=s390x-ibm + ;; + sa29200) + basic_machine=a29k-amd + os=-udi + ;; + sb1) + basic_machine=mipsisa64sb1-unknown + ;; + sb1el) + basic_machine=mipsisa64sb1el-unknown + ;; + sei) + basic_machine=mips-sei + os=-seiux + ;; + sequent) + basic_machine=i386-sequent + ;; + sh) + basic_machine=sh-hitachi + os=-hms + ;; + sh64) + basic_machine=sh64-unknown + ;; + sparclite-wrs | simso-wrs) + basic_machine=sparclite-wrs + os=-vxworks + ;; + sps7) + basic_machine=m68k-bull + os=-sysv2 + ;; + spur) + basic_machine=spur-unknown + ;; + st2000) + basic_machine=m68k-tandem + ;; + stratus) + basic_machine=i860-stratus + os=-sysv4 + ;; + sun2) + basic_machine=m68000-sun + ;; + sun2os3) + basic_machine=m68000-sun + os=-sunos3 + ;; + sun2os4) + basic_machine=m68000-sun + os=-sunos4 + ;; + sun3os3) + basic_machine=m68k-sun + os=-sunos3 + ;; + sun3os4) + basic_machine=m68k-sun + os=-sunos4 + ;; + sun4os3) + basic_machine=sparc-sun + os=-sunos3 + ;; + sun4os4) + basic_machine=sparc-sun + os=-sunos4 + ;; + sun4sol2) + basic_machine=sparc-sun + os=-solaris2 + ;; + sun3 | sun3-*) + basic_machine=m68k-sun + ;; + sun4) + basic_machine=sparc-sun + ;; + sun386 | sun386i | roadrunner) + basic_machine=i386-sun + ;; + sv1) + basic_machine=sv1-cray + os=-unicos + ;; + symmetry) + basic_machine=i386-sequent + os=-dynix + ;; + t3e) + basic_machine=alphaev5-cray + os=-unicos + ;; + t90) + basic_machine=t90-cray + os=-unicos + ;; + tic54x | c54x*) + basic_machine=tic54x-unknown + os=-coff + ;; + tic55x | c55x*) + basic_machine=tic55x-unknown + os=-coff + ;; + tic6x | c6x*) + basic_machine=tic6x-unknown + os=-coff + ;; + tx39) + basic_machine=mipstx39-unknown + ;; + tx39el) + basic_machine=mipstx39el-unknown + ;; + toad1) + basic_machine=pdp10-xkl + os=-tops20 + ;; + tower | tower-32) + basic_machine=m68k-ncr + ;; + tpf) + basic_machine=s390x-ibm + os=-tpf + ;; + udi29k) + basic_machine=a29k-amd + os=-udi + ;; + ultra3) + basic_machine=a29k-nyu + os=-sym1 + ;; + v810 | necv810) + basic_machine=v810-nec + os=-none + ;; + vaxv) + basic_machine=vax-dec + os=-sysv + ;; + vms) + basic_machine=vax-dec + os=-vms + ;; + vpp*|vx|vx-*) + basic_machine=f301-fujitsu + ;; + vxworks960) + basic_machine=i960-wrs + os=-vxworks + ;; + vxworks68) + basic_machine=m68k-wrs + os=-vxworks + ;; + vxworks29k) + basic_machine=a29k-wrs + os=-vxworks + ;; + w65*) + basic_machine=w65-wdc + os=-none + ;; + w89k-*) + basic_machine=hppa1.1-winbond + os=-proelf + ;; + xbox) + basic_machine=i686-pc + os=-mingw32 + ;; + xps | xps100) + basic_machine=xps100-honeywell + ;; + ymp) + basic_machine=ymp-cray + os=-unicos + ;; + z8k-*-coff) + basic_machine=z8k-unknown + os=-sim + ;; + none) + basic_machine=none-none + os=-none + ;; + +# Here we handle the default manufacturer of certain CPU types. It is in +# some cases the only manufacturer, in others, it is the most popular. + w89k) + basic_machine=hppa1.1-winbond + ;; + op50n) + basic_machine=hppa1.1-oki + ;; + op60c) + basic_machine=hppa1.1-oki + ;; + romp) + basic_machine=romp-ibm + ;; + mmix) + basic_machine=mmix-knuth + ;; + rs6000) + basic_machine=rs6000-ibm + ;; + vax) + basic_machine=vax-dec + ;; + pdp10) + # there are many clones, so DEC is not a safe bet + basic_machine=pdp10-unknown + ;; + pdp11) + basic_machine=pdp11-dec + ;; + we32k) + basic_machine=we32k-att + ;; + sh[1234] | sh[24]a | sh[34]eb | sh[1234]le | sh[23]ele) + basic_machine=sh-unknown + ;; + sparc | sparcv8 | sparcv9 | sparcv9b) + basic_machine=sparc-sun + ;; + cydra) + basic_machine=cydra-cydrome + ;; + orion) + basic_machine=orion-highlevel + ;; + orion105) + basic_machine=clipper-highlevel + ;; + mac | mpw | mac-mpw) + basic_machine=m68k-apple + ;; + pmac | pmac-mpw) + basic_machine=powerpc-apple + ;; + *-unknown) + # Make sure to match an already-canonicalized machine name. + ;; + *) + echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 + exit 1 + ;; +esac + +# Here we canonicalize certain aliases for manufacturers. +case $basic_machine in + *-digital*) + basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'` + ;; + *-commodore*) + basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'` + ;; + *) + ;; +esac + +# Decode manufacturer-specific aliases for certain operating systems. + +if [ x"$os" != x"" ] +then +case $os in + # First match some system type aliases + # that might get confused with valid system types. + # -solaris* is a basic system type, with this one exception. + -solaris1 | -solaris1.*) + os=`echo $os | sed -e 's|solaris1|sunos4|'` + ;; + -solaris) + os=-solaris2 + ;; + -svr4*) + os=-sysv4 + ;; + -unixware*) + os=-sysv4.2uw + ;; + -gnu/linux*) + os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` + ;; + # First accept the basic system types. + # The portable systems comes first. + # Each alternative MUST END IN A *, to match a version number. + # -sysv* is not here because it comes later, after sysvr4. + -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ + | -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\ + | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \ + | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ + | -aos* \ + | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ + | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ + | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* | -openbsd* \ + | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \ + | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ + | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ + | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ + | -chorusos* | -chorusrdb* \ + | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ + | -mingw32* | -linux-gnu* | -linux-uclibc* | -uxpv* | -beos* | -mpeix* | -udk* \ + | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ + | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ + | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ + | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ + | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ + | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ + | -skyos* | -haiku*) + # Remember, each alternative MUST END IN *, to match a version number. + ;; + -qnx*) + case $basic_machine in + x86-* | i*86-*) + ;; + *) + os=-nto$os + ;; + esac + ;; + -nto-qnx*) + ;; + -nto*) + os=`echo $os | sed -e 's|nto|nto-qnx|'` + ;; + -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ + | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \ + | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) + ;; + -mac*) + os=`echo $os | sed -e 's|mac|macos|'` + ;; + -linux-dietlibc) + os=-linux-dietlibc + ;; + -linux*) + os=`echo $os | sed -e 's|linux|linux-gnu|'` + ;; + -sunos5*) + os=`echo $os | sed -e 's|sunos5|solaris2|'` + ;; + -sunos6*) + os=`echo $os | sed -e 's|sunos6|solaris3|'` + ;; + -opened*) + os=-openedition + ;; + -os400*) + os=-os400 + ;; + -wince*) + os=-wince + ;; + -osfrose*) + os=-osfrose + ;; + -osf*) + os=-osf + ;; + -utek*) + os=-bsd + ;; + -dynix*) + os=-bsd + ;; + -acis*) + os=-aos + ;; + -atheos*) + os=-atheos + ;; + -syllable*) + os=-syllable + ;; + -386bsd) + os=-bsd + ;; + -ctix* | -uts*) + os=-sysv + ;; + -nova*) + os=-rtmk-nova + ;; + -ns2 ) + os=-nextstep2 + ;; + -nsk*) + os=-nsk + ;; + # Preserve the version number of sinix5. + -sinix5.*) + os=`echo $os | sed -e 's|sinix|sysv|'` + ;; + -sinix*) + os=-sysv4 + ;; + -tpf*) + os=-tpf + ;; + -triton*) + os=-sysv3 + ;; + -oss*) + os=-sysv3 + ;; + -svr4) + os=-sysv4 + ;; + -svr3) + os=-sysv3 + ;; + -sysvr4) + os=-sysv4 + ;; + # This must come after -sysvr4. + -sysv*) + ;; + -ose*) + os=-ose + ;; + -es1800*) + os=-ose + ;; + -xenix) + os=-xenix + ;; + -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) + os=-mint + ;; + -aros*) + os=-aros + ;; + -kaos*) + os=-kaos + ;; + -zvmoe) + os=-zvmoe + ;; + -none) + ;; + *) + # Get rid of the `-' at the beginning of $os. + os=`echo $os | sed 's/[^-]*-//'` + echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2 + exit 1 + ;; +esac +else + +# Here we handle the default operating systems that come with various machines. +# The value should be what the vendor currently ships out the door with their +# machine or put another way, the most popular os provided with the machine. + +# Note that if you're going to try to match "-MANUFACTURER" here (say, +# "-sun"), then you have to tell the case statement up towards the top +# that MANUFACTURER isn't an operating system. Otherwise, code above +# will signal an error saying that MANUFACTURER isn't an operating +# system, and we'll never get to this point. + +case $basic_machine in + *-acorn) + os=-riscix1.2 + ;; + arm*-rebel) + os=-linux + ;; + arm*-semi) + os=-aout + ;; + c4x-* | tic4x-*) + os=-coff + ;; + # This must come before the *-dec entry. + pdp10-*) + os=-tops20 + ;; + pdp11-*) + os=-none + ;; + *-dec | vax-*) + os=-ultrix4.2 + ;; + m68*-apollo) + os=-domain + ;; + i386-sun) + os=-sunos4.0.2 + ;; + m68000-sun) + os=-sunos3 + # This also exists in the configure program, but was not the + # default. + # os=-sunos4 + ;; + m68*-cisco) + os=-aout + ;; + mips*-cisco) + os=-elf + ;; + mips*-*) + os=-elf + ;; + or32-*) + os=-coff + ;; + *-tti) # must be before sparc entry or we get the wrong os. + os=-sysv3 + ;; + sparc-* | *-sun) + os=-sunos4.1.1 + ;; + *-be) + os=-beos + ;; + *-haiku) + os=-haiku + ;; + *-ibm) + os=-aix + ;; + *-knuth) + os=-mmixware + ;; + *-wec) + os=-proelf + ;; + *-winbond) + os=-proelf + ;; + *-oki) + os=-proelf + ;; + *-hp) + os=-hpux + ;; + *-hitachi) + os=-hiux + ;; + i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) + os=-sysv + ;; + *-cbm) + os=-amigaos + ;; + *-dg) + os=-dgux + ;; + *-dolphin) + os=-sysv3 + ;; + m68k-ccur) + os=-rtu + ;; + m88k-omron*) + os=-luna + ;; + *-next ) + os=-nextstep + ;; + *-sequent) + os=-ptx + ;; + *-crds) + os=-unos + ;; + *-ns) + os=-genix + ;; + i370-*) + os=-mvs + ;; + *-next) + os=-nextstep3 + ;; + *-gould) + os=-sysv + ;; + *-highlevel) + os=-bsd + ;; + *-encore) + os=-bsd + ;; + *-sgi) + os=-irix + ;; + *-siemens) + os=-sysv4 + ;; + *-masscomp) + os=-rtu + ;; + f30[01]-fujitsu | f700-fujitsu) + os=-uxpv + ;; + *-rom68k) + os=-coff + ;; + *-*bug) + os=-coff + ;; + *-apple) + os=-macos + ;; + *-atari*) + os=-mint + ;; + *) + os=-none + ;; +esac +fi + +# Here we handle the case where we know the os, and the CPU type, but not the +# manufacturer. We pick the logical manufacturer. +vendor=unknown +case $basic_machine in + *-unknown) + case $os in + -riscix*) + vendor=acorn + ;; + -sunos*) + vendor=sun + ;; + -aix*) + vendor=ibm + ;; + -beos*) + vendor=be + ;; + -hpux*) + vendor=hp + ;; + -mpeix*) + vendor=hp + ;; + -hiux*) + vendor=hitachi + ;; + -unos*) + vendor=crds + ;; + -dgux*) + vendor=dg + ;; + -luna*) + vendor=omron + ;; + -genix*) + vendor=ns + ;; + -mvs* | -opened*) + vendor=ibm + ;; + -os400*) + vendor=ibm + ;; + -ptx*) + vendor=sequent + ;; + -tpf*) + vendor=ibm + ;; + -vxsim* | -vxworks* | -windiss*) + vendor=wrs + ;; + -aux*) + vendor=apple + ;; + -hms*) + vendor=hitachi + ;; + -mpw* | -macos*) + vendor=apple + ;; + -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) + vendor=atari + ;; + -vos*) + vendor=stratus + ;; + esac + basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"` + ;; +esac + +echo $basic_machine$os +exit + +# Local variables: +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "timestamp='" +# time-stamp-format: "%:y-%02m-%02d" +# time-stamp-end: "'" +# End: diff --git a/app/xf86dga/configure b/app/xf86dga/configure new file mode 100644 index 000000000..3069cb603 --- /dev/null +++ b/app/xf86dga/configure @@ -0,0 +1,4736 @@ +#! /bin/sh +# Guess values for system-dependent variables and create Makefiles. +# Generated by GNU Autoconf 2.59 for xf86dga 1.0.2. +# +# Report bugs to . +# +# Copyright (C) 2003 Free Software Foundation, Inc. +# This configure script is free software; the Free Software Foundation +# gives unlimited permission to copy, distribute and modify it. +## --------------------- ## +## M4sh Initialization. ## +## --------------------- ## + +# Be Bourne compatible +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then + emulate sh + NULLCMD=: + # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' +elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then + set -o posix +fi +DUALCASE=1; export DUALCASE # for MKS sh + +# Support unset when possible. +if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then + as_unset=unset +else + as_unset=false +fi + + +# Work around bugs in pre-3.0 UWIN ksh. +$as_unset ENV MAIL MAILPATH +PS1='$ ' +PS2='> ' +PS4='+ ' + +# NLS nuisances. +for as_var in \ + LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ + LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ + LC_TELEPHONE LC_TIME +do + if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then + eval $as_var=C; export $as_var + else + $as_unset $as_var + fi +done + +# Required to use basename. +if expr a : '\(a\)' >/dev/null 2>&1; then + as_expr=expr +else + as_expr=false +fi + +if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then + as_basename=basename +else + as_basename=false +fi + + +# Name of the executable. +as_me=`$as_basename "$0" || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)$' \| \ + . : '\(.\)' 2>/dev/null || +echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; } + /^X\/\(\/\/\)$/{ s//\1/; q; } + /^X\/\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + + +# PATH needs CR, and LINENO needs CR and PATH. +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + echo "#! /bin/sh" >conf$$.sh + echo "exit 0" >>conf$$.sh + chmod +x conf$$.sh + if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then + PATH_SEPARATOR=';' + else + PATH_SEPARATOR=: + fi + rm -f conf$$.sh +fi + + + as_lineno_1=$LINENO + as_lineno_2=$LINENO + as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` + test "x$as_lineno_1" != "x$as_lineno_2" && + test "x$as_lineno_3" = "x$as_lineno_2" || { + # Find who we are. Look in the path if we contain no path at all + # relative or not. + case $0 in + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break +done + + ;; + esac + # We did not find ourselves, most probably we were run as `sh COMMAND' + # in which case we are not to be found in the path. + if test "x$as_myself" = x; then + as_myself=$0 + fi + if test ! -f "$as_myself"; then + { echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2 + { (exit 1); exit 1; }; } + fi + case $CONFIG_SHELL in + '') + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for as_base in sh bash ksh sh5; do + case $as_dir in + /*) + if ("$as_dir/$as_base" -c ' + as_lineno_1=$LINENO + as_lineno_2=$LINENO + as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` + test "x$as_lineno_1" != "x$as_lineno_2" && + test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then + $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; } + $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; } + CONFIG_SHELL=$as_dir/$as_base + export CONFIG_SHELL + exec "$CONFIG_SHELL" "$0" ${1+"$@"} + fi;; + esac + done +done +;; + esac + + # Create $as_me.lineno as a copy of $as_myself, but with $LINENO + # uniformly replaced by the line number. The first 'sed' inserts a + # line-number line before each line; the second 'sed' does the real + # work. The second script uses 'N' to pair each line-number line + # with the numbered line, and appends trailing '-' during + # substitution so that $LINENO is not a special case at line end. + # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the + # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-) + sed '=' <$as_myself | + sed ' + N + s,$,-, + : loop + s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3, + t loop + s,-$,, + s,^['$as_cr_digits']*\n,, + ' >$as_me.lineno && + chmod +x $as_me.lineno || + { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 + { (exit 1); exit 1; }; } + + # Don't try to exec as it changes $[0], causing all sort of problems + # (the dirname of $[0] is not the place where we might find the + # original and so on. Autoconf is especially sensible to this). + . ./$as_me.lineno + # Exit status is that of the last command. + exit +} + + +case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in + *c*,-n*) ECHO_N= ECHO_C=' +' ECHO_T=' ' ;; + *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; + *) ECHO_N= ECHO_C='\c' ECHO_T= ;; +esac + +if expr a : '\(a\)' >/dev/null 2>&1; then + as_expr=expr +else + as_expr=false +fi + +rm -f conf$$ conf$$.exe conf$$.file +echo >conf$$.file +if ln -s conf$$.file conf$$ 2>/dev/null; then + # We could just check for DJGPP; but this test a) works b) is more generic + # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). + if test -f conf$$.exe; then + # Don't use ln at all; we don't have any links + as_ln_s='cp -p' + else + as_ln_s='ln -s' + fi +elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln +else + as_ln_s='cp -p' +fi +rm -f conf$$ conf$$.exe conf$$.file + +if mkdir -p . 2>/dev/null; then + as_mkdir_p=: +else + test -d ./-p && rmdir ./-p + as_mkdir_p=false +fi + +as_executable_p="test -f" + +# Sed expression to map a string onto a valid CPP name. +as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" + +# Sed expression to map a string onto a valid variable name. +as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" + + +# IFS +# We need space, tab and new line, in precisely that order. +as_nl=' +' +IFS=" $as_nl" + +# CDPATH. +$as_unset CDPATH + + +# Name of the host. +# hostname on some systems (SVR3.2, Linux) returns a bogus exit status, +# so uname gets run too. +ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` + +exec 6>&1 + +# +# Initializations. +# +ac_default_prefix=/usr/local +ac_config_libobj_dir=. +cross_compiling=no +subdirs= +MFLAGS= +MAKEFLAGS= +SHELL=${CONFIG_SHELL-/bin/sh} + +# Maximum number of lines to put in a shell here document. +# This variable seems obsolete. It should probably be removed, and +# only ac_max_sed_lines should be used. +: ${ac_max_here_lines=38} + +# Identity of this package. +PACKAGE_NAME='xf86dga' +PACKAGE_TARNAME='xf86dga' +PACKAGE_VERSION='1.0.2' +PACKAGE_STRING='xf86dga 1.0.2' +PACKAGE_BUGREPORT='https://bugs.freedesktop.org/enter_bug.cgi?product=xorg' + +ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CYGPATH_W PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO install_sh STRIP ac_ct_STRIP INSTALL_STRIP_PROGRAM mkdir_p AWK SET_MAKE am__leading_dot AMTAR am__tar am__untar MAINTAINER_MODE_TRUE MAINTAINER_MODE_FALSE MAINT CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT DEPDIR am__include am__quote AMDEP_TRUE AMDEP_FALSE AMDEPBACKSLASH CCDEPMODE am__fastdepCC_TRUE am__fastdepCC_FALSE PKG_CONFIG ac_pt_PKG_CONFIG XF86DGA_CFLAGS XF86DGA_LIBS build build_cpu build_vendor build_os host host_cpu host_vendor host_os APP_MAN_SUFFIX LIB_MAN_SUFFIX FILE_MAN_SUFFIX MISC_MAN_SUFFIX DRIVER_MAN_SUFFIX ADMIN_MAN_SUFFIX APP_MAN_DIR LIB_MAN_DIR FILE_MAN_DIR MISC_MAN_DIR DRIVER_MAN_DIR ADMIN_MAN_DIR LIBOBJS LTLIBOBJS' +ac_subst_files='' + +# Initialize some variables set by options. +ac_init_help= +ac_init_version=false +# The variables have the same names as the options, with +# dashes changed to underlines. +cache_file=/dev/null +exec_prefix=NONE +no_create= +no_recursion= +prefix=NONE +program_prefix=NONE +program_suffix=NONE +program_transform_name=s,x,x, +silent= +site= +srcdir= +verbose= +x_includes=NONE +x_libraries=NONE + +# Installation directory options. +# These are left unexpanded so users can "make install exec_prefix=/foo" +# and all the variables that are supposed to be based on exec_prefix +# by default will actually change. +# Use braces instead of parens because sh, perl, etc. also accept them. +bindir='${exec_prefix}/bin' +sbindir='${exec_prefix}/sbin' +libexecdir='${exec_prefix}/libexec' +datadir='${prefix}/share' +sysconfdir='${prefix}/etc' +sharedstatedir='${prefix}/com' +localstatedir='${prefix}/var' +libdir='${exec_prefix}/lib' +includedir='${prefix}/include' +oldincludedir='/usr/include' +infodir='${prefix}/info' +mandir='${prefix}/man' + +ac_prev= +for ac_option +do + # If the previous option needs an argument, assign it. + if test -n "$ac_prev"; then + eval "$ac_prev=\$ac_option" + ac_prev= + continue + fi + + ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'` + + # Accept the important Cygnus configure options, so we can diagnose typos. + + case $ac_option in + + -bindir | --bindir | --bindi | --bind | --bin | --bi) + ac_prev=bindir ;; + -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) + bindir=$ac_optarg ;; + + -build | --build | --buil | --bui | --bu) + ac_prev=build_alias ;; + -build=* | --build=* | --buil=* | --bui=* | --bu=*) + build_alias=$ac_optarg ;; + + -cache-file | --cache-file | --cache-fil | --cache-fi \ + | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) + ac_prev=cache_file ;; + -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ + | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) + cache_file=$ac_optarg ;; + + --config-cache | -C) + cache_file=config.cache ;; + + -datadir | --datadir | --datadi | --datad | --data | --dat | --da) + ac_prev=datadir ;; + -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \ + | --da=*) + datadir=$ac_optarg ;; + + -disable-* | --disable-*) + ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid feature name: $ac_feature" >&2 + { (exit 1); exit 1; }; } + ac_feature=`echo $ac_feature | sed 's/-/_/g'` + eval "enable_$ac_feature=no" ;; + + -enable-* | --enable-*) + ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid feature name: $ac_feature" >&2 + { (exit 1); exit 1; }; } + ac_feature=`echo $ac_feature | sed 's/-/_/g'` + case $ac_option in + *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; + *) ac_optarg=yes ;; + esac + eval "enable_$ac_feature='$ac_optarg'" ;; + + -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ + | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ + | --exec | --exe | --ex) + ac_prev=exec_prefix ;; + -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ + | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ + | --exec=* | --exe=* | --ex=*) + exec_prefix=$ac_optarg ;; + + -gas | --gas | --ga | --g) + # Obsolete; use --with-gas. + with_gas=yes ;; + + -help | --help | --hel | --he | -h) + ac_init_help=long ;; + -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) + ac_init_help=recursive ;; + -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) + ac_init_help=short ;; + + -host | --host | --hos | --ho) + ac_prev=host_alias ;; + -host=* | --host=* | --hos=* | --ho=*) + host_alias=$ac_optarg ;; + + -includedir | --includedir | --includedi | --included | --include \ + | --includ | --inclu | --incl | --inc) + ac_prev=includedir ;; + -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ + | --includ=* | --inclu=* | --incl=* | --inc=*) + includedir=$ac_optarg ;; + + -infodir | --infodir | --infodi | --infod | --info | --inf) + ac_prev=infodir ;; + -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) + infodir=$ac_optarg ;; + + -libdir | --libdir | --libdi | --libd) + ac_prev=libdir ;; + -libdir=* | --libdir=* | --libdi=* | --libd=*) + libdir=$ac_optarg ;; + + -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ + | --libexe | --libex | --libe) + ac_prev=libexecdir ;; + -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ + | --libexe=* | --libex=* | --libe=*) + libexecdir=$ac_optarg ;; + + -localstatedir | --localstatedir | --localstatedi | --localstated \ + | --localstate | --localstat | --localsta | --localst \ + | --locals | --local | --loca | --loc | --lo) + ac_prev=localstatedir ;; + -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ + | --localstate=* | --localstat=* | --localsta=* | --localst=* \ + | --locals=* | --local=* | --loca=* | --loc=* | --lo=*) + localstatedir=$ac_optarg ;; + + -mandir | --mandir | --mandi | --mand | --man | --ma | --m) + ac_prev=mandir ;; + -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) + mandir=$ac_optarg ;; + + -nfp | --nfp | --nf) + # Obsolete; use --without-fp. + with_fp=no ;; + + -no-create | --no-create | --no-creat | --no-crea | --no-cre \ + | --no-cr | --no-c | -n) + no_create=yes ;; + + -no-recursion | --no-recursion | --no-recursio | --no-recursi \ + | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) + no_recursion=yes ;; + + -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ + | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ + | --oldin | --oldi | --old | --ol | --o) + ac_prev=oldincludedir ;; + -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ + | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ + | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) + oldincludedir=$ac_optarg ;; + + -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) + ac_prev=prefix ;; + -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) + prefix=$ac_optarg ;; + + -program-prefix | --program-prefix | --program-prefi | --program-pref \ + | --program-pre | --program-pr | --program-p) + ac_prev=program_prefix ;; + -program-prefix=* | --program-prefix=* | --program-prefi=* \ + | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) + program_prefix=$ac_optarg ;; + + -program-suffix | --program-suffix | --program-suffi | --program-suff \ + | --program-suf | --program-su | --program-s) + ac_prev=program_suffix ;; + -program-suffix=* | --program-suffix=* | --program-suffi=* \ + | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) + program_suffix=$ac_optarg ;; + + -program-transform-name | --program-transform-name \ + | --program-transform-nam | --program-transform-na \ + | --program-transform-n | --program-transform- \ + | --program-transform | --program-transfor \ + | --program-transfo | --program-transf \ + | --program-trans | --program-tran \ + | --progr-tra | --program-tr | --program-t) + ac_prev=program_transform_name ;; + -program-transform-name=* | --program-transform-name=* \ + | --program-transform-nam=* | --program-transform-na=* \ + | --program-transform-n=* | --program-transform-=* \ + | --program-transform=* | --program-transfor=* \ + | --program-transfo=* | --program-transf=* \ + | --program-trans=* | --program-tran=* \ + | --progr-tra=* | --program-tr=* | --program-t=*) + program_transform_name=$ac_optarg ;; + + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + silent=yes ;; + + -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) + ac_prev=sbindir ;; + -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ + | --sbi=* | --sb=*) + sbindir=$ac_optarg ;; + + -sharedstatedir | --sharedstatedir | --sharedstatedi \ + | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ + | --sharedst | --shareds | --shared | --share | --shar \ + | --sha | --sh) + ac_prev=sharedstatedir ;; + -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ + | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ + | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ + | --sha=* | --sh=*) + sharedstatedir=$ac_optarg ;; + + -site | --site | --sit) + ac_prev=site ;; + -site=* | --site=* | --sit=*) + site=$ac_optarg ;; + + -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) + ac_prev=srcdir ;; + -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) + srcdir=$ac_optarg ;; + + -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ + | --syscon | --sysco | --sysc | --sys | --sy) + ac_prev=sysconfdir ;; + -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ + | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) + sysconfdir=$ac_optarg ;; + + -target | --target | --targe | --targ | --tar | --ta | --t) + ac_prev=target_alias ;; + -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) + target_alias=$ac_optarg ;; + + -v | -verbose | --verbose | --verbos | --verbo | --verb) + verbose=yes ;; + + -version | --version | --versio | --versi | --vers | -V) + ac_init_version=: ;; + + -with-* | --with-*) + ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid package name: $ac_package" >&2 + { (exit 1); exit 1; }; } + ac_package=`echo $ac_package| sed 's/-/_/g'` + case $ac_option in + *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; + *) ac_optarg=yes ;; + esac + eval "with_$ac_package='$ac_optarg'" ;; + + -without-* | --without-*) + ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid package name: $ac_package" >&2 + { (exit 1); exit 1; }; } + ac_package=`echo $ac_package | sed 's/-/_/g'` + eval "with_$ac_package=no" ;; + + --x) + # Obsolete; use --with-x. + with_x=yes ;; + + -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ + | --x-incl | --x-inc | --x-in | --x-i) + ac_prev=x_includes ;; + -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ + | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) + x_includes=$ac_optarg ;; + + -x-libraries | --x-libraries | --x-librarie | --x-librari \ + | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) + ac_prev=x_libraries ;; + -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ + | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) + x_libraries=$ac_optarg ;; + + -*) { echo "$as_me: error: unrecognized option: $ac_option +Try \`$0 --help' for more information." >&2 + { (exit 1); exit 1; }; } + ;; + + *=*) + ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` + # Reject names that are not valid shell variable names. + expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid variable name: $ac_envvar" >&2 + { (exit 1); exit 1; }; } + ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` + eval "$ac_envvar='$ac_optarg'" + export $ac_envvar ;; + + *) + # FIXME: should be removed in autoconf 3.0. + echo "$as_me: WARNING: you should use --build, --host, --target" >&2 + expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && + echo "$as_me: WARNING: invalid host type: $ac_option" >&2 + : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option} + ;; + + esac +done + +if test -n "$ac_prev"; then + ac_option=--`echo $ac_prev | sed 's/_/-/g'` + { echo "$as_me: error: missing argument to $ac_option" >&2 + { (exit 1); exit 1; }; } +fi + +# Be sure to have absolute paths. +for ac_var in exec_prefix prefix +do + eval ac_val=$`echo $ac_var` + case $ac_val in + [\\/$]* | ?:[\\/]* | NONE | '' ) ;; + *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 + { (exit 1); exit 1; }; };; + esac +done + +# Be sure to have absolute paths. +for ac_var in bindir sbindir libexecdir datadir sysconfdir sharedstatedir \ + localstatedir libdir includedir oldincludedir infodir mandir +do + eval ac_val=$`echo $ac_var` + case $ac_val in + [\\/$]* | ?:[\\/]* ) ;; + *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 + { (exit 1); exit 1; }; };; + esac +done + +# There might be people who depend on the old broken behavior: `$host' +# used to hold the argument of --host etc. +# FIXME: To remove some day. +build=$build_alias +host=$host_alias +target=$target_alias + +# FIXME: To remove some day. +if test "x$host_alias" != x; then + if test "x$build_alias" = x; then + cross_compiling=maybe + echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host. + If a cross compiler is detected then cross compile mode will be used." >&2 + elif test "x$build_alias" != "x$host_alias"; then + cross_compiling=yes + fi +fi + +ac_tool_prefix= +test -n "$host_alias" && ac_tool_prefix=$host_alias- + +test "$silent" = yes && exec 6>/dev/null + + +# Find the source files, if location was not specified. +if test -z "$srcdir"; then + ac_srcdir_defaulted=yes + # Try the directory containing this script, then its parent. + ac_confdir=`(dirname "$0") 2>/dev/null || +$as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$0" : 'X\(//\)[^/]' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$0" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + srcdir=$ac_confdir + if test ! -r $srcdir/$ac_unique_file; then + srcdir=.. + fi +else + ac_srcdir_defaulted=no +fi +if test ! -r $srcdir/$ac_unique_file; then + if test "$ac_srcdir_defaulted" = yes; then + { echo "$as_me: error: cannot find sources ($ac_unique_file) in $ac_confdir or .." >&2 + { (exit 1); exit 1; }; } + else + { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 + { (exit 1); exit 1; }; } + fi +fi +(cd $srcdir && test -r ./$ac_unique_file) 2>/dev/null || + { echo "$as_me: error: sources are in $srcdir, but \`cd $srcdir' does not work" >&2 + { (exit 1); exit 1; }; } +srcdir=`echo "$srcdir" | sed 's%\([^\\/]\)[\\/]*$%\1%'` +ac_env_build_alias_set=${build_alias+set} +ac_env_build_alias_value=$build_alias +ac_cv_env_build_alias_set=${build_alias+set} +ac_cv_env_build_alias_value=$build_alias +ac_env_host_alias_set=${host_alias+set} +ac_env_host_alias_value=$host_alias +ac_cv_env_host_alias_set=${host_alias+set} +ac_cv_env_host_alias_value=$host_alias +ac_env_target_alias_set=${target_alias+set} +ac_env_target_alias_value=$target_alias +ac_cv_env_target_alias_set=${target_alias+set} +ac_cv_env_target_alias_value=$target_alias +ac_env_CC_set=${CC+set} +ac_env_CC_value=$CC +ac_cv_env_CC_set=${CC+set} +ac_cv_env_CC_value=$CC +ac_env_CFLAGS_set=${CFLAGS+set} +ac_env_CFLAGS_value=$CFLAGS +ac_cv_env_CFLAGS_set=${CFLAGS+set} +ac_cv_env_CFLAGS_value=$CFLAGS +ac_env_LDFLAGS_set=${LDFLAGS+set} +ac_env_LDFLAGS_value=$LDFLAGS +ac_cv_env_LDFLAGS_set=${LDFLAGS+set} +ac_cv_env_LDFLAGS_value=$LDFLAGS +ac_env_CPPFLAGS_set=${CPPFLAGS+set} +ac_env_CPPFLAGS_value=$CPPFLAGS +ac_cv_env_CPPFLAGS_set=${CPPFLAGS+set} +ac_cv_env_CPPFLAGS_value=$CPPFLAGS +ac_env_PKG_CONFIG_set=${PKG_CONFIG+set} +ac_env_PKG_CONFIG_value=$PKG_CONFIG +ac_cv_env_PKG_CONFIG_set=${PKG_CONFIG+set} +ac_cv_env_PKG_CONFIG_value=$PKG_CONFIG +ac_env_XF86DGA_CFLAGS_set=${XF86DGA_CFLAGS+set} +ac_env_XF86DGA_CFLAGS_value=$XF86DGA_CFLAGS +ac_cv_env_XF86DGA_CFLAGS_set=${XF86DGA_CFLAGS+set} +ac_cv_env_XF86DGA_CFLAGS_value=$XF86DGA_CFLAGS +ac_env_XF86DGA_LIBS_set=${XF86DGA_LIBS+set} +ac_env_XF86DGA_LIBS_value=$XF86DGA_LIBS +ac_cv_env_XF86DGA_LIBS_set=${XF86DGA_LIBS+set} +ac_cv_env_XF86DGA_LIBS_value=$XF86DGA_LIBS + +# +# Report the --help message. +# +if test "$ac_init_help" = "long"; then + # Omit some internal or obsolete options to make the list less imposing. + # This message is too long to be a string in the A/UX 3.1 sh. + cat <<_ACEOF +\`configure' configures xf86dga 1.0.2 to adapt to many kinds of systems. + +Usage: $0 [OPTION]... [VAR=VALUE]... + +To assign environment variables (e.g., CC, CFLAGS...), specify them as +VAR=VALUE. See below for descriptions of some of the useful variables. + +Defaults for the options are specified in brackets. + +Configuration: + -h, --help display this help and exit + --help=short display options specific to this package + --help=recursive display the short help of all the included packages + -V, --version display version information and exit + -q, --quiet, --silent do not print \`checking...' messages + --cache-file=FILE cache test results in FILE [disabled] + -C, --config-cache alias for \`--cache-file=config.cache' + -n, --no-create do not create output files + --srcdir=DIR find the sources in DIR [configure dir or \`..'] + +_ACEOF + + cat <<_ACEOF +Installation directories: + --prefix=PREFIX install architecture-independent files in PREFIX + [$ac_default_prefix] + --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX + [PREFIX] + +By default, \`make install' will install all the files in +\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify +an installation prefix other than \`$ac_default_prefix' using \`--prefix', +for instance \`--prefix=\$HOME'. + +For better control, use the options below. + +Fine tuning of the installation directories: + --bindir=DIR user executables [EPREFIX/bin] + --sbindir=DIR system admin executables [EPREFIX/sbin] + --libexecdir=DIR program executables [EPREFIX/libexec] + --datadir=DIR read-only architecture-independent data [PREFIX/share] + --sysconfdir=DIR read-only single-machine data [PREFIX/etc] + --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] + --localstatedir=DIR modifiable single-machine data [PREFIX/var] + --libdir=DIR object code libraries [EPREFIX/lib] + --includedir=DIR C header files [PREFIX/include] + --oldincludedir=DIR C header files for non-gcc [/usr/include] + --infodir=DIR info documentation [PREFIX/info] + --mandir=DIR man documentation [PREFIX/man] +_ACEOF + + cat <<\_ACEOF + +Program names: + --program-prefix=PREFIX prepend PREFIX to installed program names + --program-suffix=SUFFIX append SUFFIX to installed program names + --program-transform-name=PROGRAM run sed PROGRAM on installed program names + +System types: + --build=BUILD configure for building on BUILD [guessed] + --host=HOST cross-compile to build programs to run on HOST [BUILD] +_ACEOF +fi + +if test -n "$ac_init_help"; then + case $ac_init_help in + short | recursive ) echo "Configuration of xf86dga 1.0.2:";; + esac + cat <<\_ACEOF + +Optional Features: + --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) + --enable-FEATURE[=ARG] include FEATURE [ARG=yes] + --enable-maintainer-mode enable make rules and dependencies not useful + (and sometimes confusing) to the casual installer + --disable-dependency-tracking speeds up one-time build + --enable-dependency-tracking do not reject slow dependency extractors + +Optional Packages: + --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] + --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) + --with-release-version=STRING + Use release version string in package name + +Some influential environment variables: + CC C compiler command + CFLAGS C compiler flags + LDFLAGS linker flags, e.g. -L if you have libraries in a + nonstandard directory + CPPFLAGS C/C++ preprocessor flags, e.g. -I if you have + headers in a nonstandard directory + PKG_CONFIG path to pkg-config utility + XF86DGA_CFLAGS + C compiler flags for XF86DGA, overriding pkg-config + XF86DGA_LIBS + linker flags for XF86DGA, overriding pkg-config + +Use these variables to override the choices made by `configure' or to help +it to find libraries and programs with nonstandard names/locations. + +Report bugs to . +_ACEOF +fi + +if test "$ac_init_help" = "recursive"; then + # If there are subdirs, report their specific --help. + ac_popdir=`pwd` + for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue + test -d $ac_dir || continue + ac_builddir=. + +if test "$ac_dir" != .; then + ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` + # A "../" for each directory in $ac_dir_suffix. + ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` +else + ac_dir_suffix= ac_top_builddir= +fi + +case $srcdir in + .) # No --srcdir option. We are building in place. + ac_srcdir=. + if test -z "$ac_top_builddir"; then + ac_top_srcdir=. + else + ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` + fi ;; + [\\/]* | ?:[\\/]* ) # Absolute path. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir ;; + *) # Relative path. + ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_builddir$srcdir ;; +esac + +# Do not use `cd foo && pwd` to compute absolute paths, because +# the directories may not exist. +case `pwd` in +.) ac_abs_builddir="$ac_dir";; +*) + case "$ac_dir" in + .) ac_abs_builddir=`pwd`;; + [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";; + *) ac_abs_builddir=`pwd`/"$ac_dir";; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_top_builddir=${ac_top_builddir}.;; +*) + case ${ac_top_builddir}. in + .) ac_abs_top_builddir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;; + *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_srcdir=$ac_srcdir;; +*) + case $ac_srcdir in + .) ac_abs_srcdir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;; + *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_top_srcdir=$ac_top_srcdir;; +*) + case $ac_top_srcdir in + .) ac_abs_top_srcdir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;; + *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;; + esac;; +esac + + cd $ac_dir + # Check for guested configure; otherwise get Cygnus style configure. + if test -f $ac_srcdir/configure.gnu; then + echo + $SHELL $ac_srcdir/configure.gnu --help=recursive + elif test -f $ac_srcdir/configure; then + echo + $SHELL $ac_srcdir/configure --help=recursive + elif test -f $ac_srcdir/configure.ac || + test -f $ac_srcdir/configure.in; then + echo + $ac_configure --help + else + echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 + fi + cd $ac_popdir + done +fi + +test -n "$ac_init_help" && exit 0 +if $ac_init_version; then + cat <<\_ACEOF +xf86dga configure 1.0.2 +generated by GNU Autoconf 2.59 + +Copyright (C) 2003 Free Software Foundation, Inc. +This configure script is free software; the Free Software Foundation +gives unlimited permission to copy, distribute and modify it. +_ACEOF + exit 0 +fi +exec 5>config.log +cat >&5 <<_ACEOF +This file contains any messages produced by compilers while +running configure, to aid debugging if configure makes a mistake. + +It was created by xf86dga $as_me 1.0.2, which was +generated by GNU Autoconf 2.59. Invocation command line was + + $ $0 $@ + +_ACEOF +{ +cat <<_ASUNAME +## --------- ## +## Platform. ## +## --------- ## + +hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` +uname -m = `(uname -m) 2>/dev/null || echo unknown` +uname -r = `(uname -r) 2>/dev/null || echo unknown` +uname -s = `(uname -s) 2>/dev/null || echo unknown` +uname -v = `(uname -v) 2>/dev/null || echo unknown` + +/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` +/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` + +/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` +/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` +/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` +hostinfo = `(hostinfo) 2>/dev/null || echo unknown` +/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` +/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` +/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` + +_ASUNAME + +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + echo "PATH: $as_dir" +done + +} >&5 + +cat >&5 <<_ACEOF + + +## ----------- ## +## Core tests. ## +## ----------- ## + +_ACEOF + + +# Keep a trace of the command line. +# Strip out --no-create and --no-recursion so they do not pile up. +# Strip out --silent because we don't want to record it for future runs. +# Also quote any args containing shell meta-characters. +# Make two passes to allow for proper duplicate-argument suppression. +ac_configure_args= +ac_configure_args0= +ac_configure_args1= +ac_sep= +ac_must_keep_next=false +for ac_pass in 1 2 +do + for ac_arg + do + case $ac_arg in + -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + continue ;; + *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*) + ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + case $ac_pass in + 1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;; + 2) + ac_configure_args1="$ac_configure_args1 '$ac_arg'" + if test $ac_must_keep_next = true; then + ac_must_keep_next=false # Got value, back to normal. + else + case $ac_arg in + *=* | --config-cache | -C | -disable-* | --disable-* \ + | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ + | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ + | -with-* | --with-* | -without-* | --without-* | --x) + case "$ac_configure_args0 " in + "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; + esac + ;; + -* ) ac_must_keep_next=true ;; + esac + fi + ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'" + # Get rid of the leading space. + ac_sep=" " + ;; + esac + done +done +$as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; } +$as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export ac_configure_args1; } + +# When interrupted or exit'd, cleanup temporary files, and complete +# config.log. We remove comments because anyway the quotes in there +# would cause problems or look ugly. +# WARNING: Be sure not to use single quotes in there, as some shells, +# such as our DU 5.0 friend, will then `close' the trap. +trap 'exit_status=$? + # Save into config.log some information that might help in debugging. + { + echo + + cat <<\_ASBOX +## ---------------- ## +## Cache variables. ## +## ---------------- ## +_ASBOX + echo + # The following way of writing the cache mishandles newlines in values, +{ + (set) 2>&1 | + case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in + *ac_space=\ *) + sed -n \ + "s/'"'"'/'"'"'\\\\'"'"''"'"'/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p" + ;; + *) + sed -n \ + "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" + ;; + esac; +} + echo + + cat <<\_ASBOX +## ----------------- ## +## Output variables. ## +## ----------------- ## +_ASBOX + echo + for ac_var in $ac_subst_vars + do + eval ac_val=$`echo $ac_var` + echo "$ac_var='"'"'$ac_val'"'"'" + done | sort + echo + + if test -n "$ac_subst_files"; then + cat <<\_ASBOX +## ------------- ## +## Output files. ## +## ------------- ## +_ASBOX + echo + for ac_var in $ac_subst_files + do + eval ac_val=$`echo $ac_var` + echo "$ac_var='"'"'$ac_val'"'"'" + done | sort + echo + fi + + if test -s confdefs.h; then + cat <<\_ASBOX +## ----------- ## +## confdefs.h. ## +## ----------- ## +_ASBOX + echo + sed "/^$/d" confdefs.h | sort + echo + fi + test "$ac_signal" != 0 && + echo "$as_me: caught signal $ac_signal" + echo "$as_me: exit $exit_status" + } >&5 + rm -f core *.core && + rm -rf conftest* confdefs* conf$$* $ac_clean_files && + exit $exit_status + ' 0 +for ac_signal in 1 2 13 15; do + trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal +done +ac_signal=0 + +# confdefs.h avoids OS command line length limits that DEFS can exceed. +rm -rf conftest* confdefs.h +# AIX cpp loses on an empty file, so make sure it contains at least a newline. +echo >confdefs.h + +# Predefined preprocessor variables. + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_NAME "$PACKAGE_NAME" +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_TARNAME "$PACKAGE_TARNAME" +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_VERSION "$PACKAGE_VERSION" +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_STRING "$PACKAGE_STRING" +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" +_ACEOF + + +# Let the site file select an alternate cache file if it wants to. +# Prefer explicitly selected file to automatically selected ones. +if test -z "$CONFIG_SITE"; then + if test "x$prefix" != xNONE; then + CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" + else + CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" + fi +fi +for ac_site_file in $CONFIG_SITE; do + if test -r "$ac_site_file"; then + { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5 +echo "$as_me: loading site script $ac_site_file" >&6;} + sed 's/^/| /' "$ac_site_file" >&5 + . "$ac_site_file" + fi +done + +if test -r "$cache_file"; then + # Some versions of bash will fail to source /dev/null (special + # files actually), so we avoid doing that. + if test -f "$cache_file"; then + { echo "$as_me:$LINENO: loading cache $cache_file" >&5 +echo "$as_me: loading cache $cache_file" >&6;} + case $cache_file in + [\\/]* | ?:[\\/]* ) . $cache_file;; + *) . ./$cache_file;; + esac + fi +else + { echo "$as_me:$LINENO: creating cache $cache_file" >&5 +echo "$as_me: creating cache $cache_file" >&6;} + >$cache_file +fi + +# Check that the precious variables saved in the cache have kept the same +# value. +ac_cache_corrupted=false +for ac_var in `(set) 2>&1 | + sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do + eval ac_old_set=\$ac_cv_env_${ac_var}_set + eval ac_new_set=\$ac_env_${ac_var}_set + eval ac_old_val="\$ac_cv_env_${ac_var}_value" + eval ac_new_val="\$ac_env_${ac_var}_value" + case $ac_old_set,$ac_new_set in + set,) + { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 +echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,set) + { echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5 +echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,);; + *) + if test "x$ac_old_val" != "x$ac_new_val"; then + { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5 +echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} + { echo "$as_me:$LINENO: former value: $ac_old_val" >&5 +echo "$as_me: former value: $ac_old_val" >&2;} + { echo "$as_me:$LINENO: current value: $ac_new_val" >&5 +echo "$as_me: current value: $ac_new_val" >&2;} + ac_cache_corrupted=: + fi;; + esac + # Pass precious variables to config.status. + if test "$ac_new_set" = set; then + case $ac_new_val in + *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*) + ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; + *) ac_arg=$ac_var=$ac_new_val ;; + esac + case " $ac_configure_args " in + *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. + *) ac_configure_args="$ac_configure_args '$ac_arg'" ;; + esac + fi +done +if $ac_cache_corrupted; then + { echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5 +echo "$as_me: error: changes in the environment can compromise the build" >&2;} + { { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5 +echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;} + { (exit 1); exit 1; }; } +fi + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + + + + + + + + + + + + + + + + + + + + + + + + + + +am__api_version="1.9" +ac_aux_dir= +for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do + if test -f $ac_dir/install-sh; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install-sh -c" + break + elif test -f $ac_dir/install.sh; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install.sh -c" + break + elif test -f $ac_dir/shtool; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/shtool install -c" + break + fi +done +if test -z "$ac_aux_dir"; then + { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&5 +echo "$as_me: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&2;} + { (exit 1); exit 1; }; } +fi +ac_config_guess="$SHELL $ac_aux_dir/config.guess" +ac_config_sub="$SHELL $ac_aux_dir/config.sub" +ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure. + +# Find a good install program. We prefer a C program (faster), +# so one script is as good as another. But avoid the broken or +# incompatible versions: +# SysV /etc/install, /usr/sbin/install +# SunOS /usr/etc/install +# IRIX /sbin/install +# AIX /bin/install +# AmigaOS /C/install, which installs bootblocks on floppy discs +# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag +# AFS /usr/afsws/bin/install, which mishandles nonexistent args +# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" +# OS/2's system install, which has a completely different semantic +# ./install, which can be erroneously created by make from ./install.sh. +echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5 +echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6 +if test -z "$INSTALL"; then +if test "${ac_cv_path_install+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + # Account for people who put trailing slashes in PATH elements. +case $as_dir/ in + ./ | .// | /cC/* | \ + /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ + ?:\\/os2\\/install\\/* | ?:\\/OS2\\/INSTALL\\/* | \ + /usr/ucb/* ) ;; + *) + # OSF1 and SCO ODT 3.0 have their own names for install. + # Don't use installbsd from OSF since it installs stuff as root + # by default. + for ac_prog in ginstall scoinst install; do + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then + if test $ac_prog = install && + grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + # AIX install. It has an incompatible calling convention. + : + elif test $ac_prog = install && + grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + # program-specific install script used by HP pwplus--don't use. + : + else + ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" + break 3 + fi + fi + done + done + ;; +esac +done + + +fi + if test "${ac_cv_path_install+set}" = set; then + INSTALL=$ac_cv_path_install + else + # As a last resort, use the slow shell script. We don't cache a + # path for INSTALL within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the path is relative. + INSTALL=$ac_install_sh + fi +fi +echo "$as_me:$LINENO: result: $INSTALL" >&5 +echo "${ECHO_T}$INSTALL" >&6 + +# Use test -z because SunOS4 sh mishandles braces in ${var-val}. +# It thinks the first close brace ends the variable substitution. +test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' + +test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' + +test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' + +echo "$as_me:$LINENO: checking whether build environment is sane" >&5 +echo $ECHO_N "checking whether build environment is sane... $ECHO_C" >&6 +# Just in case +sleep 1 +echo timestamp > conftest.file +# Do `set' in a subshell so we don't clobber the current shell's +# arguments. Must try -L first in case configure is actually a +# symlink; some systems play weird games with the mod time of symlinks +# (eg FreeBSD returns the mod time of the symlink's containing +# directory). +if ( + set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null` + if test "$*" = "X"; then + # -L didn't work. + set X `ls -t $srcdir/configure conftest.file` + fi + rm -f conftest.file + if test "$*" != "X $srcdir/configure conftest.file" \ + && test "$*" != "X conftest.file $srcdir/configure"; then + + # If neither matched, then we have a broken ls. This can happen + # if, for instance, CONFIG_SHELL is bash and it inherits a + # broken ls alias from the environment. This has actually + # happened. Such a system could not be considered "sane". + { { echo "$as_me:$LINENO: error: ls -t appears to fail. Make sure there is not a broken +alias in your environment" >&5 +echo "$as_me: error: ls -t appears to fail. Make sure there is not a broken +alias in your environment" >&2;} + { (exit 1); exit 1; }; } + fi + + test "$2" = conftest.file + ) +then + # Ok. + : +else + { { echo "$as_me:$LINENO: error: newly created file is older than distributed files! +Check your system clock" >&5 +echo "$as_me: error: newly created file is older than distributed files! +Check your system clock" >&2;} + { (exit 1); exit 1; }; } +fi +echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 +test "$program_prefix" != NONE && + program_transform_name="s,^,$program_prefix,;$program_transform_name" +# Use a double $ so make ignores it. +test "$program_suffix" != NONE && + program_transform_name="s,\$,$program_suffix,;$program_transform_name" +# Double any \ or $. echo might interpret backslashes. +# By default was `s,x,x', remove it if useless. +cat <<\_ACEOF >conftest.sed +s/[\\$]/&&/g;s/;s,x,x,$// +_ACEOF +program_transform_name=`echo $program_transform_name | sed -f conftest.sed` +rm conftest.sed + +# expand $ac_aux_dir to an absolute path +am_aux_dir=`cd $ac_aux_dir && pwd` + +test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing" +# Use eval to expand $SHELL +if eval "$MISSING --run true"; then + am_missing_run="$MISSING --run " +else + am_missing_run= + { echo "$as_me:$LINENO: WARNING: \`missing' script is too old or missing" >&5 +echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;} +fi + +if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then + # We used to keeping the `.' as first argument, in order to + # allow $(mkdir_p) to be used without argument. As in + # $(mkdir_p) $(somedir) + # where $(somedir) is conditionally defined. However this is wrong + # for two reasons: + # 1. if the package is installed by a user who cannot write `.' + # make install will fail, + # 2. the above comment should most certainly read + # $(mkdir_p) $(DESTDIR)$(somedir) + # so it does not work when $(somedir) is undefined and + # $(DESTDIR) is not. + # To support the latter case, we have to write + # test -z "$(somedir)" || $(mkdir_p) $(DESTDIR)$(somedir), + # so the `.' trick is pointless. + mkdir_p='mkdir -p --' +else + # On NextStep and OpenStep, the `mkdir' command does not + # recognize any option. It will interpret all options as + # directories to create, and then abort because `.' already + # exists. + for d in ./-p ./--version; + do + test -d $d && rmdir $d + done + # $(mkinstalldirs) is defined by Automake if mkinstalldirs exists. + if test -f "$ac_aux_dir/mkinstalldirs"; then + mkdir_p='$(mkinstalldirs)' + else + mkdir_p='$(install_sh) -d' + fi +fi + +for ac_prog in gawk mawk nawk awk +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_AWK+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$AWK"; then + ac_cv_prog_AWK="$AWK" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_AWK="$ac_prog" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +AWK=$ac_cv_prog_AWK +if test -n "$AWK"; then + echo "$as_me:$LINENO: result: $AWK" >&5 +echo "${ECHO_T}$AWK" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + test -n "$AWK" && break +done + +echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5 +echo $ECHO_N "checking whether ${MAKE-make} sets \$(MAKE)... $ECHO_C" >&6 +set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,:./+-,___p_,'` +if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.make <<\_ACEOF +all: + @echo 'ac_maketemp="$(MAKE)"' +_ACEOF +# GNU make sometimes prints "make[1]: Entering...", which would confuse us. +eval `${MAKE-make} -f conftest.make 2>/dev/null | grep temp=` +if test -n "$ac_maketemp"; then + eval ac_cv_prog_make_${ac_make}_set=yes +else + eval ac_cv_prog_make_${ac_make}_set=no +fi +rm -f conftest.make +fi +if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 + SET_MAKE= +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 + SET_MAKE="MAKE=${MAKE-make}" +fi + +rm -rf .tst 2>/dev/null +mkdir .tst 2>/dev/null +if test -d .tst; then + am__leading_dot=. +else + am__leading_dot=_ +fi +rmdir .tst 2>/dev/null + +# test to see if srcdir already configured +if test "`cd $srcdir && pwd`" != "`pwd`" && + test -f $srcdir/config.status; then + { { echo "$as_me:$LINENO: error: source directory already configured; run \"make distclean\" there first" >&5 +echo "$as_me: error: source directory already configured; run \"make distclean\" there first" >&2;} + { (exit 1); exit 1; }; } +fi + +# test whether we have cygpath +if test -z "$CYGPATH_W"; then + if (cygpath --version) >/dev/null 2>/dev/null; then + CYGPATH_W='cygpath -w' + else + CYGPATH_W=echo + fi +fi + + +# Define the identity of the package. + PACKAGE='xf86dga' + VERSION='1.0.2' + + +cat >>confdefs.h <<_ACEOF +#define PACKAGE "$PACKAGE" +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define VERSION "$VERSION" +_ACEOF + +# Some tools Automake needs. + +ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"} + + +AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"} + + +AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"} + + +AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"} + + +MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} + +install_sh=${install_sh-"$am_aux_dir/install-sh"} + +# Installed binaries are usually stripped using `strip' when the user +# run `make install-strip'. However `strip' might not be the right +# tool to use in cross-compilation environments, therefore Automake +# will honor the `STRIP' environment variable to overrule this program. +if test "$cross_compiling" != no; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. +set dummy ${ac_tool_prefix}strip; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_STRIP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$STRIP"; then + ac_cv_prog_STRIP="$STRIP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_STRIP="${ac_tool_prefix}strip" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +STRIP=$ac_cv_prog_STRIP +if test -n "$STRIP"; then + echo "$as_me:$LINENO: result: $STRIP" >&5 +echo "${ECHO_T}$STRIP" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + +fi +if test -z "$ac_cv_prog_STRIP"; then + ac_ct_STRIP=$STRIP + # Extract the first word of "strip", so it can be a program name with args. +set dummy strip; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_STRIP"; then + ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_STRIP="strip" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + + test -z "$ac_cv_prog_ac_ct_STRIP" && ac_cv_prog_ac_ct_STRIP=":" +fi +fi +ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP +if test -n "$ac_ct_STRIP"; then + echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5 +echo "${ECHO_T}$ac_ct_STRIP" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + STRIP=$ac_ct_STRIP +else + STRIP="$ac_cv_prog_STRIP" +fi + +fi +INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s" + +# We need awk for the "check" target. The system "awk" is bad on +# some platforms. +# Always define AMTAR for backward compatibility. + +AMTAR=${AMTAR-"${am_missing_run}tar"} + +am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -' + + + + + +echo "$as_me:$LINENO: checking whether to enable maintainer-specific portions of Makefiles" >&5 +echo $ECHO_N "checking whether to enable maintainer-specific portions of Makefiles... $ECHO_C" >&6 + # Check whether --enable-maintainer-mode or --disable-maintainer-mode was given. +if test "${enable_maintainer_mode+set}" = set; then + enableval="$enable_maintainer_mode" + USE_MAINTAINER_MODE=$enableval +else + USE_MAINTAINER_MODE=no +fi; + echo "$as_me:$LINENO: result: $USE_MAINTAINER_MODE" >&5 +echo "${ECHO_T}$USE_MAINTAINER_MODE" >&6 + + +if test $USE_MAINTAINER_MODE = yes; then + MAINTAINER_MODE_TRUE= + MAINTAINER_MODE_FALSE='#' +else + MAINTAINER_MODE_TRUE='#' + MAINTAINER_MODE_FALSE= +fi + + MAINT=$MAINTAINER_MODE_TRUE + + + + ac_config_headers="$ac_config_headers config.h" + + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. +set dummy ${ac_tool_prefix}gcc; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="${ac_tool_prefix}gcc" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + +fi +if test -z "$ac_cv_prog_CC"; then + ac_ct_CC=$CC + # Extract the first word of "gcc", so it can be a program name with args. +set dummy gcc; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_ac_ct_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CC="gcc" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 +echo "${ECHO_T}$ac_ct_CC" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + CC=$ac_ct_CC +else + CC="$ac_cv_prog_CC" +fi + +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. +set dummy ${ac_tool_prefix}cc; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="${ac_tool_prefix}cc" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + +fi +if test -z "$ac_cv_prog_CC"; then + ac_ct_CC=$CC + # Extract the first word of "cc", so it can be a program name with args. +set dummy cc; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_ac_ct_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CC="cc" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 +echo "${ECHO_T}$ac_ct_CC" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + CC=$ac_ct_CC +else + CC="$ac_cv_prog_CC" +fi + +fi +if test -z "$CC"; then + # Extract the first word of "cc", so it can be a program name with args. +set dummy cc; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + ac_prog_rejected=no +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then + ac_prog_rejected=yes + continue + fi + ac_cv_prog_CC="cc" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +if test $ac_prog_rejected = yes; then + # We found a bogon in the path, so make sure we never use it. + set dummy $ac_cv_prog_CC + shift + if test $# != 0; then + # We chose a different compiler from the bogus one. + # However, it has the same basename, so the bogon will be chosen + # first if we set CC to just the basename; use the full file name. + shift + ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" + fi +fi +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + +fi +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + for ac_prog in cl + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="$ac_tool_prefix$ac_prog" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + test -n "$CC" && break + done +fi +if test -z "$CC"; then + ac_ct_CC=$CC + for ac_prog in cl +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_ac_ct_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CC="$ac_prog" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 +echo "${ECHO_T}$ac_ct_CC" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + test -n "$ac_ct_CC" && break +done + + CC=$ac_ct_CC +fi + +fi + + +test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH +See \`config.log' for more details." >&5 +echo "$as_me: error: no acceptable C compiler found in \$PATH +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } + +# Provide some information about the compiler. +echo "$as_me:$LINENO:" \ + "checking for C compiler version" >&5 +ac_compiler=`set X $ac_compile; echo $2` +{ (eval echo "$as_me:$LINENO: \"$ac_compiler --version &5\"") >&5 + (eval $ac_compiler --version &5) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } +{ (eval echo "$as_me:$LINENO: \"$ac_compiler -v &5\"") >&5 + (eval $ac_compiler -v &5) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } +{ (eval echo "$as_me:$LINENO: \"$ac_compiler -V &5\"") >&5 + (eval $ac_compiler -V &5) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } + +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +ac_clean_files_save=$ac_clean_files +ac_clean_files="$ac_clean_files a.out a.exe b.out" +# Try to create an executable without -o first, disregard a.out. +# It will help us diagnose broken compilers, and finding out an intuition +# of exeext. +echo "$as_me:$LINENO: checking for C compiler default output file name" >&5 +echo $ECHO_N "checking for C compiler default output file name... $ECHO_C" >&6 +ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` +if { (eval echo "$as_me:$LINENO: \"$ac_link_default\"") >&5 + (eval $ac_link_default) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + # Find the output, starting from the most likely. This scheme is +# not robust to junk in `.', hence go to wildcards (a.*) only as a last +# resort. + +# Be careful to initialize this variable, since it used to be cached. +# Otherwise an old cache value of `no' led to `EXEEXT = no' in a Makefile. +ac_cv_exeext= +# b.out is created by i960 compilers. +for ac_file in a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out +do + test -f "$ac_file" || continue + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) + ;; + conftest.$ac_ext ) + # This is the source file. + ;; + [ab].out ) + # We found the default executable, but exeext='' is most + # certainly right. + break;; + *.* ) + ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + # FIXME: I believe we export ac_cv_exeext for Libtool, + # but it would be cool to find out if it's true. Does anybody + # maintain Libtool? --akim. + export ac_cv_exeext + break;; + * ) + break;; + esac +done +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +{ { echo "$as_me:$LINENO: error: C compiler cannot create executables +See \`config.log' for more details." >&5 +echo "$as_me: error: C compiler cannot create executables +See \`config.log' for more details." >&2;} + { (exit 77); exit 77; }; } +fi + +ac_exeext=$ac_cv_exeext +echo "$as_me:$LINENO: result: $ac_file" >&5 +echo "${ECHO_T}$ac_file" >&6 + +# Check the compiler produces executables we can run. If not, either +# the compiler is broken, or we cross compile. +echo "$as_me:$LINENO: checking whether the C compiler works" >&5 +echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6 +# FIXME: These cross compiler hacks should be removed for Autoconf 3.0 +# If not cross compiling, check that we can run a simple program. +if test "$cross_compiling" != yes; then + if { ac_try='./$ac_file' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + cross_compiling=no + else + if test "$cross_compiling" = maybe; then + cross_compiling=yes + else + { { echo "$as_me:$LINENO: error: cannot run C compiled programs. +If you meant to cross compile, use \`--host'. +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot run C compiled programs. +If you meant to cross compile, use \`--host'. +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } + fi + fi +fi +echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 + +rm -f a.out a.exe conftest$ac_cv_exeext b.out +ac_clean_files=$ac_clean_files_save +# Check the compiler produces executables we can run. If not, either +# the compiler is broken, or we cross compile. +echo "$as_me:$LINENO: checking whether we are cross compiling" >&5 +echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6 +echo "$as_me:$LINENO: result: $cross_compiling" >&5 +echo "${ECHO_T}$cross_compiling" >&6 + +echo "$as_me:$LINENO: checking for suffix of executables" >&5 +echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6 +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + # If both `conftest.exe' and `conftest' are `present' (well, observable) +# catch `conftest.exe'. For instance with Cygwin, `ls conftest' will +# work properly (i.e., refer to `conftest.exe'), while it won't with +# `rm'. +for ac_file in conftest.exe conftest conftest.*; do + test -f "$ac_file" || continue + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) ;; + *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + export ac_cv_exeext + break;; + * ) break;; + esac +done +else + { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot compute suffix of executables: cannot compile and link +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } +fi + +rm -f conftest$ac_cv_exeext +echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5 +echo "${ECHO_T}$ac_cv_exeext" >&6 + +rm -f conftest.$ac_ext +EXEEXT=$ac_cv_exeext +ac_exeext=$EXEEXT +echo "$as_me:$LINENO: checking for suffix of object files" >&5 +echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6 +if test "${ac_cv_objext+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.o conftest.obj +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg ) ;; + *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` + break;; + esac +done +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +{ { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot compute suffix of object files: cannot compile +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } +fi + +rm -f conftest.$ac_cv_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_objext" >&5 +echo "${ECHO_T}$ac_cv_objext" >&6 +OBJEXT=$ac_cv_objext +ac_objext=$OBJEXT +echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 +echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6 +if test "${ac_cv_c_compiler_gnu+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ +#ifndef __GNUC__ + choke me +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_compiler_gnu=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_compiler_gnu=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +ac_cv_c_compiler_gnu=$ac_compiler_gnu + +fi +echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 +echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6 +GCC=`test $ac_compiler_gnu = yes && echo yes` +ac_test_CFLAGS=${CFLAGS+set} +ac_save_CFLAGS=$CFLAGS +CFLAGS="-g" +echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 +echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6 +if test "${ac_cv_prog_cc_g+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_prog_cc_g=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_prog_cc_g=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 +echo "${ECHO_T}$ac_cv_prog_cc_g" >&6 +if test "$ac_test_CFLAGS" = set; then + CFLAGS=$ac_save_CFLAGS +elif test $ac_cv_prog_cc_g = yes; then + if test "$GCC" = yes; then + CFLAGS="-g -O2" + else + CFLAGS="-g" + fi +else + if test "$GCC" = yes; then + CFLAGS="-O2" + else + CFLAGS= + fi +fi +echo "$as_me:$LINENO: checking for $CC option to accept ANSI C" >&5 +echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6 +if test "${ac_cv_prog_cc_stdc+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_prog_cc_stdc=no +ac_save_CC=$CC +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +#include +#include +#include +/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ +struct buf { int x; }; +FILE * (*rcsopen) (struct buf *, struct stat *, int); +static char *e (p, i) + char **p; + int i; +{ + return p[i]; +} +static char *f (char * (*g) (char **, int), char **p, ...) +{ + char *s; + va_list v; + va_start (v,p); + s = g (p, va_arg (v,int)); + va_end (v); + return s; +} + +/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has + function prototypes and stuff, but not '\xHH' hex character constants. + These don't provoke an error unfortunately, instead are silently treated + as 'x'. The following induces an error, until -std1 is added to get + proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an + array size at least. It's necessary to write '\x00'==0 to get something + that's true only with -std1. */ +int osf4_cc_array ['\x00' == 0 ? 1 : -1]; + +int test (int i, double x); +struct s1 {int (*f) (int a);}; +struct s2 {int (*f) (double a);}; +int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); +int argc; +char **argv; +int +main () +{ +return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; + ; + return 0; +} +_ACEOF +# Don't try gcc -ansi; that turns off useful extensions and +# breaks some systems' header files. +# AIX -qlanglvl=ansi +# Ultrix and OSF/1 -std1 +# HP-UX 10.20 and later -Ae +# HP-UX older versions -Aa -D_HPUX_SOURCE +# SVR4 -Xc -D__EXTENSIONS__ +for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" +do + CC="$ac_save_CC $ac_arg" + rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_prog_cc_stdc=$ac_arg +break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.err conftest.$ac_objext +done +rm -f conftest.$ac_ext conftest.$ac_objext +CC=$ac_save_CC + +fi + +case "x$ac_cv_prog_cc_stdc" in + x|xno) + echo "$as_me:$LINENO: result: none needed" >&5 +echo "${ECHO_T}none needed" >&6 ;; + *) + echo "$as_me:$LINENO: result: $ac_cv_prog_cc_stdc" >&5 +echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6 + CC="$CC $ac_cv_prog_cc_stdc" ;; +esac + +# Some people use a C++ compiler to compile C. Since we use `exit', +# in C++ we need to declare it. In case someone uses the same compiler +# for both compiling C and C++ we need to have the C++ compiler decide +# the declaration of exit, since it's the most demanding environment. +cat >conftest.$ac_ext <<_ACEOF +#ifndef __cplusplus + choke me +#endif +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + for ac_declaration in \ + '' \ + 'extern "C" void std::exit (int) throw (); using std::exit;' \ + 'extern "C" void std::exit (int); using std::exit;' \ + 'extern "C" void exit (int) throw ();' \ + 'extern "C" void exit (int);' \ + 'void exit (int);' +do + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_declaration +#include +int +main () +{ +exit (42); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + : +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +continue +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_declaration +int +main () +{ +exit (42); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +done +rm -f conftest* +if test -n "$ac_declaration"; then + echo '#ifdef __cplusplus' >>confdefs.h + echo $ac_declaration >>confdefs.h + echo '#endif' >>confdefs.h +fi + +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +DEPDIR="${am__leading_dot}deps" + + ac_config_commands="$ac_config_commands depfiles" + + +am_make=${MAKE-make} +cat > confinc << 'END' +am__doit: + @echo done +.PHONY: am__doit +END +# If we don't find an include directive, just comment out the code. +echo "$as_me:$LINENO: checking for style of include used by $am_make" >&5 +echo $ECHO_N "checking for style of include used by $am_make... $ECHO_C" >&6 +am__include="#" +am__quote= +_am_result=none +# First try GNU make style include. +echo "include confinc" > confmf +# We grep out `Entering directory' and `Leaving directory' +# messages which can occur if `w' ends up in MAKEFLAGS. +# In particular we don't look at `^make:' because GNU make might +# be invoked under some other name (usually "gmake"), in which +# case it prints its new name instead of `make'. +if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then + am__include=include + am__quote= + _am_result=GNU +fi +# Now try BSD make style include. +if test "$am__include" = "#"; then + echo '.include "confinc"' > confmf + if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then + am__include=.include + am__quote="\"" + _am_result=BSD + fi +fi + + +echo "$as_me:$LINENO: result: $_am_result" >&5 +echo "${ECHO_T}$_am_result" >&6 +rm -f confinc confmf + +# Check whether --enable-dependency-tracking or --disable-dependency-tracking was given. +if test "${enable_dependency_tracking+set}" = set; then + enableval="$enable_dependency_tracking" + +fi; +if test "x$enable_dependency_tracking" != xno; then + am_depcomp="$ac_aux_dir/depcomp" + AMDEPBACKSLASH='\' +fi + + +if test "x$enable_dependency_tracking" != xno; then + AMDEP_TRUE= + AMDEP_FALSE='#' +else + AMDEP_TRUE='#' + AMDEP_FALSE= +fi + + + + +depcc="$CC" am_compiler_list= + +echo "$as_me:$LINENO: checking dependency style of $depcc" >&5 +echo $ECHO_N "checking dependency style of $depcc... $ECHO_C" >&6 +if test "${am_cv_CC_dependencies_compiler_type+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then + # We make a subdir and do the tests there. Otherwise we can end up + # making bogus files that we don't know about and never remove. For + # instance it was reported that on HP-UX the gcc test will end up + # making a dummy file named `D' -- because `-MD' means `put the output + # in D'. + mkdir conftest.dir + # Copy depcomp to subdir because otherwise we won't find it if we're + # using a relative directory. + cp "$am_depcomp" conftest.dir + cd conftest.dir + # We will build objects and dependencies in a subdirectory because + # it helps to detect inapplicable dependency modes. For instance + # both Tru64's cc and ICC support -MD to output dependencies as a + # side effect of compilation, but ICC will put the dependencies in + # the current directory while Tru64 will put them in the object + # directory. + mkdir sub + + am_cv_CC_dependencies_compiler_type=none + if test "$am_compiler_list" = ""; then + am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` + fi + for depmode in $am_compiler_list; do + # Setup a source with many dependencies, because some compilers + # like to wrap large dependency lists on column 80 (with \), and + # we should not choose a depcomp mode which is confused by this. + # + # We need to recreate these files for each test, as the compiler may + # overwrite some of them when testing with obscure command lines. + # This happens at least with the AIX C compiler. + : > sub/conftest.c + for i in 1 2 3 4 5 6; do + echo '#include "conftst'$i'.h"' >> sub/conftest.c + # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with + # Solaris 8's {/usr,}/bin/sh. + touch sub/conftst$i.h + done + echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf + + case $depmode in + nosideeffect) + # after this tag, mechanisms are not by side-effect, so they'll + # only be used when explicitly requested + if test "x$enable_dependency_tracking" = xyes; then + continue + else + break + fi + ;; + none) break ;; + esac + # We check with `-c' and `-o' for the sake of the "dashmstdout" + # mode. It turns out that the SunPro C++ compiler does not properly + # handle `-M -o', and we need to detect this. + if depmode=$depmode \ + source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \ + depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ + $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \ + >/dev/null 2>conftest.err && + grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && + grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 && + ${MAKE-make} -s -f confmf > /dev/null 2>&1; then + # icc doesn't choke on unknown options, it will just issue warnings + # or remarks (even with -Werror). So we grep stderr for any message + # that says an option was ignored or not supported. + # When given -MP, icc 7.0 and 7.1 complain thusly: + # icc: Command line warning: ignoring option '-M'; no argument required + # The diagnosis changed in icc 8.0: + # icc: Command line remark: option '-MP' not supported + if (grep 'ignoring option' conftest.err || + grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else + am_cv_CC_dependencies_compiler_type=$depmode + break + fi + fi + done + + cd .. + rm -rf conftest.dir +else + am_cv_CC_dependencies_compiler_type=none +fi + +fi +echo "$as_me:$LINENO: result: $am_cv_CC_dependencies_compiler_type" >&5 +echo "${ECHO_T}$am_cv_CC_dependencies_compiler_type" >&6 +CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type + + + +if + test "x$enable_dependency_tracking" != xno \ + && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then + am__fastdepCC_TRUE= + am__fastdepCC_FALSE='#' +else + am__fastdepCC_TRUE='#' + am__fastdepCC_FALSE= +fi + + +# Find a good install program. We prefer a C program (faster), +# so one script is as good as another. But avoid the broken or +# incompatible versions: +# SysV /etc/install, /usr/sbin/install +# SunOS /usr/etc/install +# IRIX /sbin/install +# AIX /bin/install +# AmigaOS /C/install, which installs bootblocks on floppy discs +# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag +# AFS /usr/afsws/bin/install, which mishandles nonexistent args +# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" +# OS/2's system install, which has a completely different semantic +# ./install, which can be erroneously created by make from ./install.sh. +echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5 +echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6 +if test -z "$INSTALL"; then +if test "${ac_cv_path_install+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + # Account for people who put trailing slashes in PATH elements. +case $as_dir/ in + ./ | .// | /cC/* | \ + /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ + ?:\\/os2\\/install\\/* | ?:\\/OS2\\/INSTALL\\/* | \ + /usr/ucb/* ) ;; + *) + # OSF1 and SCO ODT 3.0 have their own names for install. + # Don't use installbsd from OSF since it installs stuff as root + # by default. + for ac_prog in ginstall scoinst install; do + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then + if test $ac_prog = install && + grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + # AIX install. It has an incompatible calling convention. + : + elif test $ac_prog = install && + grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + # program-specific install script used by HP pwplus--don't use. + : + else + ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" + break 3 + fi + fi + done + done + ;; +esac +done + + +fi + if test "${ac_cv_path_install+set}" = set; then + INSTALL=$ac_cv_path_install + else + # As a last resort, use the slow shell script. We don't cache a + # path for INSTALL within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the path is relative. + INSTALL=$ac_install_sh + fi +fi +echo "$as_me:$LINENO: result: $INSTALL" >&5 +echo "${ECHO_T}$INSTALL" >&6 + +# Use test -z because SunOS4 sh mishandles braces in ${var-val}. +# It thinks the first close brace ends the variable substitution. +test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' + +test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' + +test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' + + +# Checks for pkg-config packages + + +if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args. +set dummy ${ac_tool_prefix}pkg-config; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_path_PKG_CONFIG+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + case $PKG_CONFIG in + [\\/]* | ?:[\\/]*) + ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + + ;; +esac +fi +PKG_CONFIG=$ac_cv_path_PKG_CONFIG + +if test -n "$PKG_CONFIG"; then + echo "$as_me:$LINENO: result: $PKG_CONFIG" >&5 +echo "${ECHO_T}$PKG_CONFIG" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + +fi +if test -z "$ac_cv_path_PKG_CONFIG"; then + ac_pt_PKG_CONFIG=$PKG_CONFIG + # Extract the first word of "pkg-config", so it can be a program name with args. +set dummy pkg-config; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_path_ac_pt_PKG_CONFIG+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + case $ac_pt_PKG_CONFIG in + [\\/]* | ?:[\\/]*) + ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_ac_pt_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + + ;; +esac +fi +ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG + +if test -n "$ac_pt_PKG_CONFIG"; then + echo "$as_me:$LINENO: result: $ac_pt_PKG_CONFIG" >&5 +echo "${ECHO_T}$ac_pt_PKG_CONFIG" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + PKG_CONFIG=$ac_pt_PKG_CONFIG +else + PKG_CONFIG="$ac_cv_path_PKG_CONFIG" +fi + +fi +if test -n "$PKG_CONFIG"; then + _pkg_min_version=0.9.0 + echo "$as_me:$LINENO: checking pkg-config is at least version $_pkg_min_version" >&5 +echo $ECHO_N "checking pkg-config is at least version $_pkg_min_version... $ECHO_C" >&6 + if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 + else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 + PKG_CONFIG="" + fi + +fi + +pkg_failed=no +echo "$as_me:$LINENO: checking for XF86DGA" >&5 +echo $ECHO_N "checking for XF86DGA... $ECHO_C" >&6 + +if test -n "$PKG_CONFIG"; then + if test -n "$XF86DGA_CFLAGS"; then + pkg_cv_XF86DGA_CFLAGS="$XF86DGA_CFLAGS" + else + if test -n "$PKG_CONFIG" && \ + { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"x11 xxf86dga xt xaw7 xmu\"") >&5 + ($PKG_CONFIG --exists --print-errors "x11 xxf86dga xt xaw7 xmu") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + pkg_cv_XF86DGA_CFLAGS=`$PKG_CONFIG --cflags "x11 xxf86dga xt xaw7 xmu" 2>/dev/null` +else + pkg_failed=yes +fi + fi +else + pkg_failed=untried +fi +if test -n "$PKG_CONFIG"; then + if test -n "$XF86DGA_LIBS"; then + pkg_cv_XF86DGA_LIBS="$XF86DGA_LIBS" + else + if test -n "$PKG_CONFIG" && \ + { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"x11 xxf86dga xt xaw7 xmu\"") >&5 + ($PKG_CONFIG --exists --print-errors "x11 xxf86dga xt xaw7 xmu") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + pkg_cv_XF86DGA_LIBS=`$PKG_CONFIG --libs "x11 xxf86dga xt xaw7 xmu" 2>/dev/null` +else + pkg_failed=yes +fi + fi +else + pkg_failed=untried +fi + + + +if test $pkg_failed = yes; then + +if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then + _pkg_short_errors_supported=yes +else + _pkg_short_errors_supported=no +fi + if test $_pkg_short_errors_supported = yes; then + XF86DGA_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "x11 xxf86dga xt xaw7 xmu"` + else + XF86DGA_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "x11 xxf86dga xt xaw7 xmu"` + fi + # Put the nasty error message in config.log where it belongs + echo "$XF86DGA_PKG_ERRORS" >&5 + + { { echo "$as_me:$LINENO: error: Package requirements (x11 xxf86dga xt xaw7 xmu) were not met: + +$XF86DGA_PKG_ERRORS + +Consider adjusting the PKG_CONFIG_PATH environment variable if you +installed software in a non-standard prefix. + +Alternatively, you may set the environment variables XF86DGA_CFLAGS +and XF86DGA_LIBS to avoid the need to call pkg-config. +See the pkg-config man page for more details. +" >&5 +echo "$as_me: error: Package requirements (x11 xxf86dga xt xaw7 xmu) were not met: + +$XF86DGA_PKG_ERRORS + +Consider adjusting the PKG_CONFIG_PATH environment variable if you +installed software in a non-standard prefix. + +Alternatively, you may set the environment variables XF86DGA_CFLAGS +and XF86DGA_LIBS to avoid the need to call pkg-config. +See the pkg-config man page for more details. +" >&2;} + { (exit 1); exit 1; }; } +elif test $pkg_failed = untried; then + { { echo "$as_me:$LINENO: error: The pkg-config script could not be found or is too old. Make sure it +is in your PATH or set the PKG_CONFIG environment variable to the full +path to pkg-config. + +Alternatively, you may set the environment variables XF86DGA_CFLAGS +and XF86DGA_LIBS to avoid the need to call pkg-config. +See the pkg-config man page for more details. + +To get pkg-config, see . +See \`config.log' for more details." >&5 +echo "$as_me: error: The pkg-config script could not be found or is too old. Make sure it +is in your PATH or set the PKG_CONFIG environment variable to the full +path to pkg-config. + +Alternatively, you may set the environment variables XF86DGA_CFLAGS +and XF86DGA_LIBS to avoid the need to call pkg-config. +See the pkg-config man page for more details. + +To get pkg-config, see . +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } +else + XF86DGA_CFLAGS=$pkg_cv_XF86DGA_CFLAGS + XF86DGA_LIBS=$pkg_cv_XF86DGA_LIBS + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 + : +fi + + + +# Make sure we can run config.sub. +$ac_config_sub sun4 >/dev/null 2>&1 || + { { echo "$as_me:$LINENO: error: cannot run $ac_config_sub" >&5 +echo "$as_me: error: cannot run $ac_config_sub" >&2;} + { (exit 1); exit 1; }; } + +echo "$as_me:$LINENO: checking build system type" >&5 +echo $ECHO_N "checking build system type... $ECHO_C" >&6 +if test "${ac_cv_build+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_build_alias=$build_alias +test -z "$ac_cv_build_alias" && + ac_cv_build_alias=`$ac_config_guess` +test -z "$ac_cv_build_alias" && + { { echo "$as_me:$LINENO: error: cannot guess build type; you must specify one" >&5 +echo "$as_me: error: cannot guess build type; you must specify one" >&2;} + { (exit 1); exit 1; }; } +ac_cv_build=`$ac_config_sub $ac_cv_build_alias` || + { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_build_alias failed" >&5 +echo "$as_me: error: $ac_config_sub $ac_cv_build_alias failed" >&2;} + { (exit 1); exit 1; }; } + +fi +echo "$as_me:$LINENO: result: $ac_cv_build" >&5 +echo "${ECHO_T}$ac_cv_build" >&6 +build=$ac_cv_build +build_cpu=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` +build_vendor=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` +build_os=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` + + +echo "$as_me:$LINENO: checking host system type" >&5 +echo $ECHO_N "checking host system type... $ECHO_C" >&6 +if test "${ac_cv_host+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_host_alias=$host_alias +test -z "$ac_cv_host_alias" && + ac_cv_host_alias=$ac_cv_build_alias +ac_cv_host=`$ac_config_sub $ac_cv_host_alias` || + { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_host_alias failed" >&5 +echo "$as_me: error: $ac_config_sub $ac_cv_host_alias failed" >&2;} + { (exit 1); exit 1; }; } + +fi +echo "$as_me:$LINENO: result: $ac_cv_host" >&5 +echo "${ECHO_T}$ac_cv_host" >&6 +host=$ac_cv_host +host_cpu=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` +host_vendor=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` +host_os=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` + + + + + +if test x$APP_MAN_SUFFIX = x ; then + APP_MAN_SUFFIX=1 +fi +if test x$APP_MAN_DIR = x ; then + APP_MAN_DIR='$(mandir)/man$(APP_MAN_SUFFIX)' +fi + +if test x$LIB_MAN_SUFFIX = x ; then + LIB_MAN_SUFFIX=3 +fi +if test x$LIB_MAN_DIR = x ; then + LIB_MAN_DIR='$(mandir)/man$(LIB_MAN_SUFFIX)' +fi + +if test x$FILE_MAN_SUFFIX = x ; then + case $host_os in + solaris*) FILE_MAN_SUFFIX=4 ;; + *) FILE_MAN_SUFFIX=5 ;; + esac +fi +if test x$FILE_MAN_DIR = x ; then + FILE_MAN_DIR='$(mandir)/man$(FILE_MAN_SUFFIX)' +fi + +if test x$MISC_MAN_SUFFIX = x ; then + case $host_os in + solaris*) MISC_MAN_SUFFIX=5 ;; + *) MISC_MAN_SUFFIX=7 ;; + esac +fi +if test x$MISC_MAN_DIR = x ; then + MISC_MAN_DIR='$(mandir)/man$(MISC_MAN_SUFFIX)' +fi + +if test x$DRIVER_MAN_SUFFIX = x ; then + case $host_os in + solaris*) DRIVER_MAN_SUFFIX=7 ;; + *) DRIVER_MAN_SUFFIX=4 ;; + esac +fi +if test x$DRIVER_MAN_DIR = x ; then + DRIVER_MAN_DIR='$(mandir)/man$(DRIVER_MAN_SUFFIX)' +fi + +if test x$ADMIN_MAN_SUFFIX = x ; then + case $host_os in + solaris*) ADMIN_MAN_SUFFIX=1m ;; + *) ADMIN_MAN_SUFFIX=8 ;; + esac +fi +if test x$ADMIN_MAN_DIR = x ; then + ADMIN_MAN_DIR='$(mandir)/man$(ADMIN_MAN_SUFFIX)' +fi + + + + + + + + + + + + + + + + + +# Check whether --with-release-version or --without-release-version was given. +if test "${with_release_version+set}" = set; then + withval="$with_release_version" + RELEASE_VERSION="$withval" +else + RELEASE_VERSION="" +fi; + if test "x$RELEASE_VERSION" != "x"; then + PACKAGE="$PACKAGE-$RELEASE_VERSION" + PACKAGE_TARNAME="$PACKAGE_TARNAME-$RELEASE_VERSION" + { echo "$as_me:$LINENO: Building with package name set to $PACKAGE" >&5 +echo "$as_me: Building with package name set to $PACKAGE" >&6;} + fi + + + ac_config_files="$ac_config_files Makefile" +cat >confcache <<\_ACEOF +# This file is a shell script that caches the results of configure +# tests run on this system so they can be shared between configure +# scripts and configure runs, see configure's option --config-cache. +# It is not useful on other systems. If it contains results you don't +# want to keep, you may remove or edit it. +# +# config.status only pays attention to the cache file if you give it +# the --recheck option to rerun configure. +# +# `ac_cv_env_foo' variables (set or unset) will be overridden when +# loading this file, other *unset* `ac_cv_foo' will be assigned the +# following values. + +_ACEOF + +# The following way of writing the cache mishandles newlines in values, +# but we know of no workaround that is simple, portable, and efficient. +# So, don't put newlines in cache variables' values. +# Ultrix sh set writes to stderr and can't be redirected directly, +# and sets the high bit in the cache file unless we assign to the vars. +{ + (set) 2>&1 | + case `(ac_space=' '; set | grep ac_space) 2>&1` in + *ac_space=\ *) + # `set' does not quote correctly, so add quotes (double-quote + # substitution turns \\\\ into \\, and sed turns \\ into \). + sed -n \ + "s/'/'\\\\''/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" + ;; + *) + # `set' quotes correctly as required by POSIX, so do not add quotes. + sed -n \ + "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" + ;; + esac; +} | + sed ' + t clear + : clear + s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ + t end + /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ + : end' >>confcache +if diff $cache_file confcache >/dev/null 2>&1; then :; else + if test -w $cache_file; then + test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file" + cat confcache >$cache_file + else + echo "not updating unwritable cache $cache_file" + fi +fi +rm -f confcache + +test "x$prefix" = xNONE && prefix=$ac_default_prefix +# Let make expand exec_prefix. +test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' + +# VPATH may cause trouble with some makes, so we remove $(srcdir), +# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and +# trailing colons and then remove the whole line if VPATH becomes empty +# (actually we leave an empty line to preserve line numbers). +if test "x$srcdir" = x.; then + ac_vpsub='/^[ ]*VPATH[ ]*=/{ +s/:*\$(srcdir):*/:/; +s/:*\${srcdir}:*/:/; +s/:*@srcdir@:*/:/; +s/^\([^=]*=[ ]*\):*/\1/; +s/:*$//; +s/^[^=]*=[ ]*$//; +}' +fi + +DEFS=-DHAVE_CONFIG_H + +ac_libobjs= +ac_ltlibobjs= +for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue + # 1. Remove the extension, and $U if already installed. + ac_i=`echo "$ac_i" | + sed 's/\$U\././;s/\.o$//;s/\.obj$//'` + # 2. Add them. + ac_libobjs="$ac_libobjs $ac_i\$U.$ac_objext" + ac_ltlibobjs="$ac_ltlibobjs $ac_i"'$U.lo' +done +LIBOBJS=$ac_libobjs + +LTLIBOBJS=$ac_ltlibobjs + + +if test -z "${MAINTAINER_MODE_TRUE}" && test -z "${MAINTAINER_MODE_FALSE}"; then + { { echo "$as_me:$LINENO: error: conditional \"MAINTAINER_MODE\" was never defined. +Usually this means the macro was only invoked conditionally." >&5 +echo "$as_me: error: conditional \"MAINTAINER_MODE\" was never defined. +Usually this means the macro was only invoked conditionally." >&2;} + { (exit 1); exit 1; }; } +fi +if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then + { { echo "$as_me:$LINENO: error: conditional \"AMDEP\" was never defined. +Usually this means the macro was only invoked conditionally." >&5 +echo "$as_me: error: conditional \"AMDEP\" was never defined. +Usually this means the macro was only invoked conditionally." >&2;} + { (exit 1); exit 1; }; } +fi +if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then + { { echo "$as_me:$LINENO: error: conditional \"am__fastdepCC\" was never defined. +Usually this means the macro was only invoked conditionally." >&5 +echo "$as_me: error: conditional \"am__fastdepCC\" was never defined. +Usually this means the macro was only invoked conditionally." >&2;} + { (exit 1); exit 1; }; } +fi + +: ${CONFIG_STATUS=./config.status} +ac_clean_files_save=$ac_clean_files +ac_clean_files="$ac_clean_files $CONFIG_STATUS" +{ echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5 +echo "$as_me: creating $CONFIG_STATUS" >&6;} +cat >$CONFIG_STATUS <<_ACEOF +#! $SHELL +# Generated by $as_me. +# Run this file to recreate the current configuration. +# Compiler output produced by configure, useful for debugging +# configure, is in config.log if it exists. + +debug=false +ac_cs_recheck=false +ac_cs_silent=false +SHELL=\${CONFIG_SHELL-$SHELL} +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF +## --------------------- ## +## M4sh Initialization. ## +## --------------------- ## + +# Be Bourne compatible +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then + emulate sh + NULLCMD=: + # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' +elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then + set -o posix +fi +DUALCASE=1; export DUALCASE # for MKS sh + +# Support unset when possible. +if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then + as_unset=unset +else + as_unset=false +fi + + +# Work around bugs in pre-3.0 UWIN ksh. +$as_unset ENV MAIL MAILPATH +PS1='$ ' +PS2='> ' +PS4='+ ' + +# NLS nuisances. +for as_var in \ + LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ + LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ + LC_TELEPHONE LC_TIME +do + if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then + eval $as_var=C; export $as_var + else + $as_unset $as_var + fi +done + +# Required to use basename. +if expr a : '\(a\)' >/dev/null 2>&1; then + as_expr=expr +else + as_expr=false +fi + +if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then + as_basename=basename +else + as_basename=false +fi + + +# Name of the executable. +as_me=`$as_basename "$0" || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)$' \| \ + . : '\(.\)' 2>/dev/null || +echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; } + /^X\/\(\/\/\)$/{ s//\1/; q; } + /^X\/\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + + +# PATH needs CR, and LINENO needs CR and PATH. +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + echo "#! /bin/sh" >conf$$.sh + echo "exit 0" >>conf$$.sh + chmod +x conf$$.sh + if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then + PATH_SEPARATOR=';' + else + PATH_SEPARATOR=: + fi + rm -f conf$$.sh +fi + + + as_lineno_1=$LINENO + as_lineno_2=$LINENO + as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` + test "x$as_lineno_1" != "x$as_lineno_2" && + test "x$as_lineno_3" = "x$as_lineno_2" || { + # Find who we are. Look in the path if we contain no path at all + # relative or not. + case $0 in + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break +done + + ;; + esac + # We did not find ourselves, most probably we were run as `sh COMMAND' + # in which case we are not to be found in the path. + if test "x$as_myself" = x; then + as_myself=$0 + fi + if test ! -f "$as_myself"; then + { { echo "$as_me:$LINENO: error: cannot find myself; rerun with an absolute path" >&5 +echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2;} + { (exit 1); exit 1; }; } + fi + case $CONFIG_SHELL in + '') + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for as_base in sh bash ksh sh5; do + case $as_dir in + /*) + if ("$as_dir/$as_base" -c ' + as_lineno_1=$LINENO + as_lineno_2=$LINENO + as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` + test "x$as_lineno_1" != "x$as_lineno_2" && + test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then + $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; } + $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; } + CONFIG_SHELL=$as_dir/$as_base + export CONFIG_SHELL + exec "$CONFIG_SHELL" "$0" ${1+"$@"} + fi;; + esac + done +done +;; + esac + + # Create $as_me.lineno as a copy of $as_myself, but with $LINENO + # uniformly replaced by the line number. The first 'sed' inserts a + # line-number line before each line; the second 'sed' does the real + # work. The second script uses 'N' to pair each line-number line + # with the numbered line, and appends trailing '-' during + # substitution so that $LINENO is not a special case at line end. + # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the + # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-) + sed '=' <$as_myself | + sed ' + N + s,$,-, + : loop + s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3, + t loop + s,-$,, + s,^['$as_cr_digits']*\n,, + ' >$as_me.lineno && + chmod +x $as_me.lineno || + { { echo "$as_me:$LINENO: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&5 +echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2;} + { (exit 1); exit 1; }; } + + # Don't try to exec as it changes $[0], causing all sort of problems + # (the dirname of $[0] is not the place where we might find the + # original and so on. Autoconf is especially sensible to this). + . ./$as_me.lineno + # Exit status is that of the last command. + exit +} + + +case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in + *c*,-n*) ECHO_N= ECHO_C=' +' ECHO_T=' ' ;; + *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; + *) ECHO_N= ECHO_C='\c' ECHO_T= ;; +esac + +if expr a : '\(a\)' >/dev/null 2>&1; then + as_expr=expr +else + as_expr=false +fi + +rm -f conf$$ conf$$.exe conf$$.file +echo >conf$$.file +if ln -s conf$$.file conf$$ 2>/dev/null; then + # We could just check for DJGPP; but this test a) works b) is more generic + # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). + if test -f conf$$.exe; then + # Don't use ln at all; we don't have any links + as_ln_s='cp -p' + else + as_ln_s='ln -s' + fi +elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln +else + as_ln_s='cp -p' +fi +rm -f conf$$ conf$$.exe conf$$.file + +if mkdir -p . 2>/dev/null; then + as_mkdir_p=: +else + test -d ./-p && rmdir ./-p + as_mkdir_p=false +fi + +as_executable_p="test -f" + +# Sed expression to map a string onto a valid CPP name. +as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" + +# Sed expression to map a string onto a valid variable name. +as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" + + +# IFS +# We need space, tab and new line, in precisely that order. +as_nl=' +' +IFS=" $as_nl" + +# CDPATH. +$as_unset CDPATH + +exec 6>&1 + +# Open the log real soon, to keep \$[0] and so on meaningful, and to +# report actual input values of CONFIG_FILES etc. instead of their +# values after options handling. Logging --version etc. is OK. +exec 5>>config.log +{ + echo + sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX +## Running $as_me. ## +_ASBOX +} >&5 +cat >&5 <<_CSEOF + +This file was extended by xf86dga $as_me 1.0.2, which was +generated by GNU Autoconf 2.59. Invocation command line was + + CONFIG_FILES = $CONFIG_FILES + CONFIG_HEADERS = $CONFIG_HEADERS + CONFIG_LINKS = $CONFIG_LINKS + CONFIG_COMMANDS = $CONFIG_COMMANDS + $ $0 $@ + +_CSEOF +echo "on `(hostname || uname -n) 2>/dev/null | sed 1q`" >&5 +echo >&5 +_ACEOF + +# Files that config.status was made for. +if test -n "$ac_config_files"; then + echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS +fi + +if test -n "$ac_config_headers"; then + echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS +fi + +if test -n "$ac_config_links"; then + echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS +fi + +if test -n "$ac_config_commands"; then + echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS +fi + +cat >>$CONFIG_STATUS <<\_ACEOF + +ac_cs_usage="\ +\`$as_me' instantiates files from templates according to the +current configuration. + +Usage: $0 [OPTIONS] [FILE]... + + -h, --help print this help, then exit + -V, --version print version number, then exit + -q, --quiet do not print progress messages + -d, --debug don't remove temporary files + --recheck update $as_me by reconfiguring in the same conditions + --file=FILE[:TEMPLATE] + instantiate the configuration file FILE + --header=FILE[:TEMPLATE] + instantiate the configuration header FILE + +Configuration files: +$config_files + +Configuration headers: +$config_headers + +Configuration commands: +$config_commands + +Report bugs to ." +_ACEOF + +cat >>$CONFIG_STATUS <<_ACEOF +ac_cs_version="\\ +xf86dga config.status 1.0.2 +configured by $0, generated by GNU Autoconf 2.59, + with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\" + +Copyright (C) 2003 Free Software Foundation, Inc. +This config.status script is free software; the Free Software Foundation +gives unlimited permission to copy, distribute and modify it." +srcdir=$srcdir +INSTALL="$INSTALL" +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF +# If no file are specified by the user, then we need to provide default +# value. By we need to know if files were specified by the user. +ac_need_defaults=: +while test $# != 0 +do + case $1 in + --*=*) + ac_option=`expr "x$1" : 'x\([^=]*\)='` + ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'` + ac_shift=: + ;; + -*) + ac_option=$1 + ac_optarg=$2 + ac_shift=shift + ;; + *) # This is not an option, so the user has probably given explicit + # arguments. + ac_option=$1 + ac_need_defaults=false;; + esac + + case $ac_option in + # Handling of the options. +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF + -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) + ac_cs_recheck=: ;; + --version | --vers* | -V ) + echo "$ac_cs_version"; exit 0 ;; + --he | --h) + # Conflict between --help and --header + { { echo "$as_me:$LINENO: error: ambiguous option: $1 +Try \`$0 --help' for more information." >&5 +echo "$as_me: error: ambiguous option: $1 +Try \`$0 --help' for more information." >&2;} + { (exit 1); exit 1; }; };; + --help | --hel | -h ) + echo "$ac_cs_usage"; exit 0 ;; + --debug | --d* | -d ) + debug=: ;; + --file | --fil | --fi | --f ) + $ac_shift + CONFIG_FILES="$CONFIG_FILES $ac_optarg" + ac_need_defaults=false;; + --header | --heade | --head | --hea ) + $ac_shift + CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg" + ac_need_defaults=false;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil | --si | --s) + ac_cs_silent=: ;; + + # This is an error. + -*) { { echo "$as_me:$LINENO: error: unrecognized option: $1 +Try \`$0 --help' for more information." >&5 +echo "$as_me: error: unrecognized option: $1 +Try \`$0 --help' for more information." >&2;} + { (exit 1); exit 1; }; } ;; + + *) ac_config_targets="$ac_config_targets $1" ;; + + esac + shift +done + +ac_configure_extra_args= + +if $ac_cs_silent; then + exec 6>/dev/null + ac_configure_extra_args="$ac_configure_extra_args --silent" +fi + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF +if \$ac_cs_recheck; then + echo "running $SHELL $0 " $ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6 + exec $SHELL $0 $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion +fi + +_ACEOF + +cat >>$CONFIG_STATUS <<_ACEOF +# +# INIT-COMMANDS section. +# + +AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir" + +_ACEOF + + + +cat >>$CONFIG_STATUS <<\_ACEOF +for ac_config_target in $ac_config_targets +do + case "$ac_config_target" in + # Handling of arguments. + "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;; + "depfiles" ) CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; + "config.h" ) CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;; + *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 +echo "$as_me: error: invalid argument: $ac_config_target" >&2;} + { (exit 1); exit 1; }; };; + esac +done + +# If the user did not use the arguments to specify the items to instantiate, +# then the envvar interface is used. Set only those that are not. +# We use the long form for the default assignment because of an extremely +# bizarre bug on SunOS 4.1.3. +if $ac_need_defaults; then + test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files + test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers + test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands +fi + +# Have a temporary directory for convenience. Make it in the build tree +# simply because there is no reason to put it here, and in addition, +# creating and moving files from /tmp can sometimes cause problems. +# Create a temporary directory, and hook for its removal unless debugging. +$debug || +{ + trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0 + trap '{ (exit 1); exit 1; }' 1 2 13 15 +} + +# Create a (secure) tmp directory for tmp files. + +{ + tmp=`(umask 077 && mktemp -d -q "./confstatXXXXXX") 2>/dev/null` && + test -n "$tmp" && test -d "$tmp" +} || +{ + tmp=./confstat$$-$RANDOM + (umask 077 && mkdir $tmp) +} || +{ + echo "$me: cannot create a temporary directory in ." >&2 + { (exit 1); exit 1; } +} + +_ACEOF + +cat >>$CONFIG_STATUS <<_ACEOF + +# +# CONFIG_FILES section. +# + +# No need to generate the scripts if there are no CONFIG_FILES. +# This happens for instance when ./config.status config.h +if test -n "\$CONFIG_FILES"; then + # Protect against being on the right side of a sed subst in config.status. + sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g; + s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF +s,@SHELL@,$SHELL,;t t +s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t +s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t +s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t +s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t +s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t +s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t +s,@exec_prefix@,$exec_prefix,;t t +s,@prefix@,$prefix,;t t +s,@program_transform_name@,$program_transform_name,;t t +s,@bindir@,$bindir,;t t +s,@sbindir@,$sbindir,;t t +s,@libexecdir@,$libexecdir,;t t +s,@datadir@,$datadir,;t t +s,@sysconfdir@,$sysconfdir,;t t +s,@sharedstatedir@,$sharedstatedir,;t t +s,@localstatedir@,$localstatedir,;t t +s,@libdir@,$libdir,;t t +s,@includedir@,$includedir,;t t +s,@oldincludedir@,$oldincludedir,;t t +s,@infodir@,$infodir,;t t +s,@mandir@,$mandir,;t t +s,@build_alias@,$build_alias,;t t +s,@host_alias@,$host_alias,;t t +s,@target_alias@,$target_alias,;t t +s,@DEFS@,$DEFS,;t t +s,@ECHO_C@,$ECHO_C,;t t +s,@ECHO_N@,$ECHO_N,;t t +s,@ECHO_T@,$ECHO_T,;t t +s,@LIBS@,$LIBS,;t t +s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t +s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t +s,@INSTALL_DATA@,$INSTALL_DATA,;t t +s,@CYGPATH_W@,$CYGPATH_W,;t t +s,@PACKAGE@,$PACKAGE,;t t +s,@VERSION@,$VERSION,;t t +s,@ACLOCAL@,$ACLOCAL,;t t +s,@AUTOCONF@,$AUTOCONF,;t t +s,@AUTOMAKE@,$AUTOMAKE,;t t +s,@AUTOHEADER@,$AUTOHEADER,;t t +s,@MAKEINFO@,$MAKEINFO,;t t +s,@install_sh@,$install_sh,;t t +s,@STRIP@,$STRIP,;t t +s,@ac_ct_STRIP@,$ac_ct_STRIP,;t t +s,@INSTALL_STRIP_PROGRAM@,$INSTALL_STRIP_PROGRAM,;t t +s,@mkdir_p@,$mkdir_p,;t t +s,@AWK@,$AWK,;t t +s,@SET_MAKE@,$SET_MAKE,;t t +s,@am__leading_dot@,$am__leading_dot,;t t +s,@AMTAR@,$AMTAR,;t t +s,@am__tar@,$am__tar,;t t +s,@am__untar@,$am__untar,;t t +s,@MAINTAINER_MODE_TRUE@,$MAINTAINER_MODE_TRUE,;t t +s,@MAINTAINER_MODE_FALSE@,$MAINTAINER_MODE_FALSE,;t t +s,@MAINT@,$MAINT,;t t +s,@CC@,$CC,;t t +s,@CFLAGS@,$CFLAGS,;t t +s,@LDFLAGS@,$LDFLAGS,;t t +s,@CPPFLAGS@,$CPPFLAGS,;t t +s,@ac_ct_CC@,$ac_ct_CC,;t t +s,@EXEEXT@,$EXEEXT,;t t +s,@OBJEXT@,$OBJEXT,;t t +s,@DEPDIR@,$DEPDIR,;t t +s,@am__include@,$am__include,;t t +s,@am__quote@,$am__quote,;t t +s,@AMDEP_TRUE@,$AMDEP_TRUE,;t t +s,@AMDEP_FALSE@,$AMDEP_FALSE,;t t +s,@AMDEPBACKSLASH@,$AMDEPBACKSLASH,;t t +s,@CCDEPMODE@,$CCDEPMODE,;t t +s,@am__fastdepCC_TRUE@,$am__fastdepCC_TRUE,;t t +s,@am__fastdepCC_FALSE@,$am__fastdepCC_FALSE,;t t +s,@PKG_CONFIG@,$PKG_CONFIG,;t t +s,@ac_pt_PKG_CONFIG@,$ac_pt_PKG_CONFIG,;t t +s,@XF86DGA_CFLAGS@,$XF86DGA_CFLAGS,;t t +s,@XF86DGA_LIBS@,$XF86DGA_LIBS,;t t +s,@build@,$build,;t t +s,@build_cpu@,$build_cpu,;t t +s,@build_vendor@,$build_vendor,;t t +s,@build_os@,$build_os,;t t +s,@host@,$host,;t t +s,@host_cpu@,$host_cpu,;t t +s,@host_vendor@,$host_vendor,;t t +s,@host_os@,$host_os,;t t +s,@APP_MAN_SUFFIX@,$APP_MAN_SUFFIX,;t t +s,@LIB_MAN_SUFFIX@,$LIB_MAN_SUFFIX,;t t +s,@FILE_MAN_SUFFIX@,$FILE_MAN_SUFFIX,;t t +s,@MISC_MAN_SUFFIX@,$MISC_MAN_SUFFIX,;t t +s,@DRIVER_MAN_SUFFIX@,$DRIVER_MAN_SUFFIX,;t t +s,@ADMIN_MAN_SUFFIX@,$ADMIN_MAN_SUFFIX,;t t +s,@APP_MAN_DIR@,$APP_MAN_DIR,;t t +s,@LIB_MAN_DIR@,$LIB_MAN_DIR,;t t +s,@FILE_MAN_DIR@,$FILE_MAN_DIR,;t t +s,@MISC_MAN_DIR@,$MISC_MAN_DIR,;t t +s,@DRIVER_MAN_DIR@,$DRIVER_MAN_DIR,;t t +s,@ADMIN_MAN_DIR@,$ADMIN_MAN_DIR,;t t +s,@LIBOBJS@,$LIBOBJS,;t t +s,@LTLIBOBJS@,$LTLIBOBJS,;t t +CEOF + +_ACEOF + + cat >>$CONFIG_STATUS <<\_ACEOF + # Split the substitutions into bite-sized pieces for seds with + # small command number limits, like on Digital OSF/1 and HP-UX. + ac_max_sed_lines=48 + ac_sed_frag=1 # Number of current file. + ac_beg=1 # First line for current file. + ac_end=$ac_max_sed_lines # Line after last line for current file. + ac_more_lines=: + ac_sed_cmds= + while $ac_more_lines; do + if test $ac_beg -gt 1; then + sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag + else + sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag + fi + if test ! -s $tmp/subs.frag; then + ac_more_lines=false + else + # The purpose of the label and of the branching condition is to + # speed up the sed processing (if there are no `@' at all, there + # is no need to browse any of the substitutions). + # These are the two extra sed commands mentioned above. + (echo ':t + /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed + if test -z "$ac_sed_cmds"; then + ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed" + else + ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed" + fi + ac_sed_frag=`expr $ac_sed_frag + 1` + ac_beg=$ac_end + ac_end=`expr $ac_end + $ac_max_sed_lines` + fi + done + if test -z "$ac_sed_cmds"; then + ac_sed_cmds=cat + fi +fi # test -n "$CONFIG_FILES" + +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF +for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue + # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". + case $ac_file in + - | *:- | *:-:* ) # input from stdin + cat >$tmp/stdin + ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` + ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; + *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` + ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; + * ) ac_file_in=$ac_file.in ;; + esac + + # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories. + ac_dir=`(dirname "$ac_file") 2>/dev/null || +$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$ac_file" : 'X\(//\)[^/]' \| \ + X"$ac_file" : 'X\(//\)$' \| \ + X"$ac_file" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$ac_file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + { if $as_mkdir_p; then + mkdir -p "$ac_dir" + else + as_dir="$ac_dir" + as_dirs= + while test ! -d "$as_dir"; do + as_dirs="$as_dir $as_dirs" + as_dir=`(dirname "$as_dir") 2>/dev/null || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + done + test ! -n "$as_dirs" || mkdir $as_dirs + fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5 +echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;} + { (exit 1); exit 1; }; }; } + + ac_builddir=. + +if test "$ac_dir" != .; then + ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` + # A "../" for each directory in $ac_dir_suffix. + ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` +else + ac_dir_suffix= ac_top_builddir= +fi + +case $srcdir in + .) # No --srcdir option. We are building in place. + ac_srcdir=. + if test -z "$ac_top_builddir"; then + ac_top_srcdir=. + else + ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` + fi ;; + [\\/]* | ?:[\\/]* ) # Absolute path. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir ;; + *) # Relative path. + ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_builddir$srcdir ;; +esac + +# Do not use `cd foo && pwd` to compute absolute paths, because +# the directories may not exist. +case `pwd` in +.) ac_abs_builddir="$ac_dir";; +*) + case "$ac_dir" in + .) ac_abs_builddir=`pwd`;; + [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";; + *) ac_abs_builddir=`pwd`/"$ac_dir";; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_top_builddir=${ac_top_builddir}.;; +*) + case ${ac_top_builddir}. in + .) ac_abs_top_builddir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;; + *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_srcdir=$ac_srcdir;; +*) + case $ac_srcdir in + .) ac_abs_srcdir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;; + *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_top_srcdir=$ac_top_srcdir;; +*) + case $ac_top_srcdir in + .) ac_abs_top_srcdir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;; + *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;; + esac;; +esac + + + case $INSTALL in + [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; + *) ac_INSTALL=$ac_top_builddir$INSTALL ;; + esac + + if test x"$ac_file" != x-; then + { echo "$as_me:$LINENO: creating $ac_file" >&5 +echo "$as_me: creating $ac_file" >&6;} + rm -f "$ac_file" + fi + # Let's still pretend it is `configure' which instantiates (i.e., don't + # use $as_me), people would be surprised to read: + # /* config.h. Generated by config.status. */ + if test x"$ac_file" = x-; then + configure_input= + else + configure_input="$ac_file. " + fi + configure_input=$configure_input"Generated from `echo $ac_file_in | + sed 's,.*/,,'` by configure." + + # First look for the input files in the build tree, otherwise in the + # src tree. + ac_file_inputs=`IFS=: + for f in $ac_file_in; do + case $f in + -) echo $tmp/stdin ;; + [\\/$]*) + # Absolute (can't be DOS-style, as IFS=:) + test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 +echo "$as_me: error: cannot find input file: $f" >&2;} + { (exit 1); exit 1; }; } + echo "$f";; + *) # Relative + if test -f "$f"; then + # Build tree + echo "$f" + elif test -f "$srcdir/$f"; then + # Source tree + echo "$srcdir/$f" + else + # /dev/null tree + { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 +echo "$as_me: error: cannot find input file: $f" >&2;} + { (exit 1); exit 1; }; } + fi;; + esac + done` || { (exit 1); exit 1; } +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF + sed "$ac_vpsub +$extrasub +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF +:t +/@[a-zA-Z_][a-zA-Z_0-9]*@/!b +s,@configure_input@,$configure_input,;t t +s,@srcdir@,$ac_srcdir,;t t +s,@abs_srcdir@,$ac_abs_srcdir,;t t +s,@top_srcdir@,$ac_top_srcdir,;t t +s,@abs_top_srcdir@,$ac_abs_top_srcdir,;t t +s,@builddir@,$ac_builddir,;t t +s,@abs_builddir@,$ac_abs_builddir,;t t +s,@top_builddir@,$ac_top_builddir,;t t +s,@abs_top_builddir@,$ac_abs_top_builddir,;t t +s,@INSTALL@,$ac_INSTALL,;t t +" $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out + rm -f $tmp/stdin + if test x"$ac_file" != x-; then + mv $tmp/out $ac_file + else + cat $tmp/out + rm -f $tmp/out + fi + +done +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF + +# +# CONFIG_HEADER section. +# + +# These sed commands are passed to sed as "A NAME B NAME C VALUE D", where +# NAME is the cpp macro being defined and VALUE is the value it is being given. +# +# ac_d sets the value in "#define NAME VALUE" lines. +ac_dA='s,^\([ ]*\)#\([ ]*define[ ][ ]*\)' +ac_dB='[ ].*$,\1#\2' +ac_dC=' ' +ac_dD=',;t' +# ac_u turns "#undef NAME" without trailing blanks into "#define NAME VALUE". +ac_uA='s,^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)' +ac_uB='$,\1#\2define\3' +ac_uC=' ' +ac_uD=',;t' + +for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue + # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". + case $ac_file in + - | *:- | *:-:* ) # input from stdin + cat >$tmp/stdin + ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` + ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; + *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` + ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; + * ) ac_file_in=$ac_file.in ;; + esac + + test x"$ac_file" != x- && { echo "$as_me:$LINENO: creating $ac_file" >&5 +echo "$as_me: creating $ac_file" >&6;} + + # First look for the input files in the build tree, otherwise in the + # src tree. + ac_file_inputs=`IFS=: + for f in $ac_file_in; do + case $f in + -) echo $tmp/stdin ;; + [\\/$]*) + # Absolute (can't be DOS-style, as IFS=:) + test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 +echo "$as_me: error: cannot find input file: $f" >&2;} + { (exit 1); exit 1; }; } + # Do quote $f, to prevent DOS paths from being IFS'd. + echo "$f";; + *) # Relative + if test -f "$f"; then + # Build tree + echo "$f" + elif test -f "$srcdir/$f"; then + # Source tree + echo "$srcdir/$f" + else + # /dev/null tree + { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 +echo "$as_me: error: cannot find input file: $f" >&2;} + { (exit 1); exit 1; }; } + fi;; + esac + done` || { (exit 1); exit 1; } + # Remove the trailing spaces. + sed 's/[ ]*$//' $ac_file_inputs >$tmp/in + +_ACEOF + +# Transform confdefs.h into two sed scripts, `conftest.defines' and +# `conftest.undefs', that substitutes the proper values into +# config.h.in to produce config.h. The first handles `#define' +# templates, and the second `#undef' templates. +# And first: Protect against being on the right side of a sed subst in +# config.status. Protect against being in an unquoted here document +# in config.status. +rm -f conftest.defines conftest.undefs +# Using a here document instead of a string reduces the quoting nightmare. +# Putting comments in sed scripts is not portable. +# +# `end' is used to avoid that the second main sed command (meant for +# 0-ary CPP macros) applies to n-ary macro definitions. +# See the Autoconf documentation for `clear'. +cat >confdef2sed.sed <<\_ACEOF +s/[\\&,]/\\&/g +s,[\\$`],\\&,g +t clear +: clear +s,^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*\)\(([^)]*)\)[ ]*\(.*\)$,${ac_dA}\1${ac_dB}\1\2${ac_dC}\3${ac_dD},gp +t end +s,^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)$,${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD},gp +: end +_ACEOF +# If some macros were called several times there might be several times +# the same #defines, which is useless. Nevertheless, we may not want to +# sort them, since we want the *last* AC-DEFINE to be honored. +uniq confdefs.h | sed -n -f confdef2sed.sed >conftest.defines +sed 's/ac_d/ac_u/g' conftest.defines >conftest.undefs +rm -f confdef2sed.sed + +# This sed command replaces #undef with comments. This is necessary, for +# example, in the case of _POSIX_SOURCE, which is predefined and required +# on some systems where configure will not decide to define it. +cat >>conftest.undefs <<\_ACEOF +s,^[ ]*#[ ]*undef[ ][ ]*[a-zA-Z_][a-zA-Z_0-9]*,/* & */, +_ACEOF + +# Break up conftest.defines because some shells have a limit on the size +# of here documents, and old seds have small limits too (100 cmds). +echo ' # Handle all the #define templates only if necessary.' >>$CONFIG_STATUS +echo ' if grep "^[ ]*#[ ]*define" $tmp/in >/dev/null; then' >>$CONFIG_STATUS +echo ' # If there are no defines, we may have an empty if/fi' >>$CONFIG_STATUS +echo ' :' >>$CONFIG_STATUS +rm -f conftest.tail +while grep . conftest.defines >/dev/null +do + # Write a limited-size here document to $tmp/defines.sed. + echo ' cat >$tmp/defines.sed <>$CONFIG_STATUS + # Speed up: don't consider the non `#define' lines. + echo '/^[ ]*#[ ]*define/!b' >>$CONFIG_STATUS + # Work around the forget-to-reset-the-flag bug. + echo 't clr' >>$CONFIG_STATUS + echo ': clr' >>$CONFIG_STATUS + sed ${ac_max_here_lines}q conftest.defines >>$CONFIG_STATUS + echo 'CEOF + sed -f $tmp/defines.sed $tmp/in >$tmp/out + rm -f $tmp/in + mv $tmp/out $tmp/in +' >>$CONFIG_STATUS + sed 1,${ac_max_here_lines}d conftest.defines >conftest.tail + rm -f conftest.defines + mv conftest.tail conftest.defines +done +rm -f conftest.defines +echo ' fi # grep' >>$CONFIG_STATUS +echo >>$CONFIG_STATUS + +# Break up conftest.undefs because some shells have a limit on the size +# of here documents, and old seds have small limits too (100 cmds). +echo ' # Handle all the #undef templates' >>$CONFIG_STATUS +rm -f conftest.tail +while grep . conftest.undefs >/dev/null +do + # Write a limited-size here document to $tmp/undefs.sed. + echo ' cat >$tmp/undefs.sed <>$CONFIG_STATUS + # Speed up: don't consider the non `#undef' + echo '/^[ ]*#[ ]*undef/!b' >>$CONFIG_STATUS + # Work around the forget-to-reset-the-flag bug. + echo 't clr' >>$CONFIG_STATUS + echo ': clr' >>$CONFIG_STATUS + sed ${ac_max_here_lines}q conftest.undefs >>$CONFIG_STATUS + echo 'CEOF + sed -f $tmp/undefs.sed $tmp/in >$tmp/out + rm -f $tmp/in + mv $tmp/out $tmp/in +' >>$CONFIG_STATUS + sed 1,${ac_max_here_lines}d conftest.undefs >conftest.tail + rm -f conftest.undefs + mv conftest.tail conftest.undefs +done +rm -f conftest.undefs + +cat >>$CONFIG_STATUS <<\_ACEOF + # Let's still pretend it is `configure' which instantiates (i.e., don't + # use $as_me), people would be surprised to read: + # /* config.h. Generated by config.status. */ + if test x"$ac_file" = x-; then + echo "/* Generated by configure. */" >$tmp/config.h + else + echo "/* $ac_file. Generated by configure. */" >$tmp/config.h + fi + cat $tmp/in >>$tmp/config.h + rm -f $tmp/in + if test x"$ac_file" != x-; then + if diff $ac_file $tmp/config.h >/dev/null 2>&1; then + { echo "$as_me:$LINENO: $ac_file is unchanged" >&5 +echo "$as_me: $ac_file is unchanged" >&6;} + else + ac_dir=`(dirname "$ac_file") 2>/dev/null || +$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$ac_file" : 'X\(//\)[^/]' \| \ + X"$ac_file" : 'X\(//\)$' \| \ + X"$ac_file" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$ac_file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + { if $as_mkdir_p; then + mkdir -p "$ac_dir" + else + as_dir="$ac_dir" + as_dirs= + while test ! -d "$as_dir"; do + as_dirs="$as_dir $as_dirs" + as_dir=`(dirname "$as_dir") 2>/dev/null || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + done + test ! -n "$as_dirs" || mkdir $as_dirs + fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5 +echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;} + { (exit 1); exit 1; }; }; } + + rm -f $ac_file + mv $tmp/config.h $ac_file + fi + else + cat $tmp/config.h + rm -f $tmp/config.h + fi +# Compute $ac_file's index in $config_headers. +_am_stamp_count=1 +for _am_header in $config_headers :; do + case $_am_header in + $ac_file | $ac_file:* ) + break ;; + * ) + _am_stamp_count=`expr $_am_stamp_count + 1` ;; + esac +done +echo "timestamp for $ac_file" >`(dirname $ac_file) 2>/dev/null || +$as_expr X$ac_file : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X$ac_file : 'X\(//\)[^/]' \| \ + X$ac_file : 'X\(//\)$' \| \ + X$ac_file : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X$ac_file | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'`/stamp-h$_am_stamp_count +done +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF + +# +# CONFIG_COMMANDS section. +# +for ac_file in : $CONFIG_COMMANDS; do test "x$ac_file" = x: && continue + ac_dest=`echo "$ac_file" | sed 's,:.*,,'` + ac_source=`echo "$ac_file" | sed 's,[^:]*:,,'` + ac_dir=`(dirname "$ac_dest") 2>/dev/null || +$as_expr X"$ac_dest" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$ac_dest" : 'X\(//\)[^/]' \| \ + X"$ac_dest" : 'X\(//\)$' \| \ + X"$ac_dest" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$ac_dest" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + { if $as_mkdir_p; then + mkdir -p "$ac_dir" + else + as_dir="$ac_dir" + as_dirs= + while test ! -d "$as_dir"; do + as_dirs="$as_dir $as_dirs" + as_dir=`(dirname "$as_dir") 2>/dev/null || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + done + test ! -n "$as_dirs" || mkdir $as_dirs + fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5 +echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;} + { (exit 1); exit 1; }; }; } + + ac_builddir=. + +if test "$ac_dir" != .; then + ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` + # A "../" for each directory in $ac_dir_suffix. + ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` +else + ac_dir_suffix= ac_top_builddir= +fi + +case $srcdir in + .) # No --srcdir option. We are building in place. + ac_srcdir=. + if test -z "$ac_top_builddir"; then + ac_top_srcdir=. + else + ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` + fi ;; + [\\/]* | ?:[\\/]* ) # Absolute path. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir ;; + *) # Relative path. + ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_builddir$srcdir ;; +esac + +# Do not use `cd foo && pwd` to compute absolute paths, because +# the directories may not exist. +case `pwd` in +.) ac_abs_builddir="$ac_dir";; +*) + case "$ac_dir" in + .) ac_abs_builddir=`pwd`;; + [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";; + *) ac_abs_builddir=`pwd`/"$ac_dir";; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_top_builddir=${ac_top_builddir}.;; +*) + case ${ac_top_builddir}. in + .) ac_abs_top_builddir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;; + *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_srcdir=$ac_srcdir;; +*) + case $ac_srcdir in + .) ac_abs_srcdir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;; + *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_top_srcdir=$ac_top_srcdir;; +*) + case $ac_top_srcdir in + .) ac_abs_top_srcdir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;; + *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;; + esac;; +esac + + + { echo "$as_me:$LINENO: executing $ac_dest commands" >&5 +echo "$as_me: executing $ac_dest commands" >&6;} + case $ac_dest in + depfiles ) test x"$AMDEP_TRUE" != x"" || for mf in $CONFIG_FILES; do + # Strip MF so we end up with the name of the file. + mf=`echo "$mf" | sed -e 's/:.*$//'` + # Check whether this is an Automake generated Makefile or not. + # We used to match only the files named `Makefile.in', but + # some people rename them; so instead we look at the file content. + # Grep'ing the first line is not enough: some people post-process + # each Makefile.in and add a new line on top of each file to say so. + # So let's grep whole file. + if grep '^#.*generated by automake' $mf > /dev/null 2>&1; then + dirpart=`(dirname "$mf") 2>/dev/null || +$as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$mf" : 'X\(//\)[^/]' \| \ + X"$mf" : 'X\(//\)$' \| \ + X"$mf" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$mf" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + else + continue + fi + # Extract the definition of DEPDIR, am__include, and am__quote + # from the Makefile without running `make'. + DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` + test -z "$DEPDIR" && continue + am__include=`sed -n 's/^am__include = //p' < "$mf"` + test -z "am__include" && continue + am__quote=`sed -n 's/^am__quote = //p' < "$mf"` + # When using ansi2knr, U may be empty or an underscore; expand it + U=`sed -n 's/^U = //p' < "$mf"` + # Find all dependency output files, they are included files with + # $(DEPDIR) in their names. We invoke sed twice because it is the + # simplest approach to changing $(DEPDIR) to its actual value in the + # expansion. + for file in `sed -n " + s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ + sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do + # Make sure the directory exists. + test -f "$dirpart/$file" && continue + fdir=`(dirname "$file") 2>/dev/null || +$as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$file" : 'X\(//\)[^/]' \| \ + X"$file" : 'X\(//\)$' \| \ + X"$file" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + { if $as_mkdir_p; then + mkdir -p $dirpart/$fdir + else + as_dir=$dirpart/$fdir + as_dirs= + while test ! -d "$as_dir"; do + as_dirs="$as_dir $as_dirs" + as_dir=`(dirname "$as_dir") 2>/dev/null || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + done + test ! -n "$as_dirs" || mkdir $as_dirs + fi || { { echo "$as_me:$LINENO: error: cannot create directory $dirpart/$fdir" >&5 +echo "$as_me: error: cannot create directory $dirpart/$fdir" >&2;} + { (exit 1); exit 1; }; }; } + + # echo "creating $dirpart/$file" + echo '# dummy' > "$dirpart/$file" + done +done + ;; + esac +done +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF + +{ (exit 0); exit 0; } +_ACEOF +chmod +x $CONFIG_STATUS +ac_clean_files=$ac_clean_files_save + + +# configure is writing to config.log, and then calls config.status. +# config.status does its own redirection, appending to config.log. +# Unfortunately, on DOS this fails, as config.log is still kept open +# by configure, so config.status won't be able to write to it; its +# output is simply discarded. So we exec the FD to /dev/null, +# effectively closing config.log, so it can be properly (re)opened and +# appended to by config.status. When coming back to configure, we +# need to make the FD available again. +if test "$no_create" != yes; then + ac_cs_success=: + ac_config_status_args= + test "$silent" = yes && + ac_config_status_args="$ac_config_status_args --quiet" + exec 5>/dev/null + $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false + exec 5>>config.log + # Use ||, not &&, to avoid exiting from the if with $? = 1, which + # would make configure fail if this is the last instruction. + $ac_cs_success || { (exit 1); exit 1; } +fi + diff --git a/app/xf86dga/configure.ac b/app/xf86dga/configure.ac new file mode 100644 index 000000000..c9113c466 --- /dev/null +++ b/app/xf86dga/configure.ac @@ -0,0 +1,42 @@ + +dnl Copyright 2005 Red Hat, Inc. +dnl +dnl Permission to use, copy, modify, distribute, and sell this software and its +dnl documentation for any purpose is hereby granted without fee, provided that +dnl the above copyright notice appear in all copies and that both that +dnl copyright notice and this permission notice appear in supporting +dnl documentation, and that the name of Red Hat not be used in +dnl advertising or publicity pertaining to distribution of the software without +dnl specific, written prior permission. Red Hat makes no +dnl representations about the suitability of this software for any purpose. It +dnl is provided "as is" without express or implied warranty. +dnl +dnl RED HAT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, +dnl INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO +dnl EVENT SHALL RED HAT BE LIABLE FOR ANY SPECIAL, INDIRECT OR +dnl CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, +dnl DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER +dnl TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +dnl PERFORMANCE OF THIS SOFTWARE. +dnl +dnl Process this file with autoconf to create configure. + +AC_PREREQ([2.57]) +AC_INIT(xf86dga,[1.0.2], [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg],xf86dga) +AM_INIT_AUTOMAKE([dist-bzip2]) +AM_MAINTAINER_MODE + +AM_CONFIG_HEADER(config.h) + +AC_PROG_CC +AC_PROG_INSTALL + +# Checks for pkg-config packages +PKG_CHECK_MODULES(XF86DGA, x11 xxf86dga xt xaw7 xmu) +AC_SUBST(XF86DGA_CFLAGS) +AC_SUBST(XF86DGA_LIBS) + +XORG_MANPAGE_SECTIONS +XORG_RELEASE_VERSION + +AC_OUTPUT([Makefile]) diff --git a/app/xf86dga/depcomp b/app/xf86dga/depcomp new file mode 100644 index 000000000..04701da53 --- /dev/null +++ b/app/xf86dga/depcomp @@ -0,0 +1,530 @@ +#! /bin/sh +# depcomp - compile a program generating dependencies as side-effects + +scriptversion=2005-07-09.11 + +# Copyright (C) 1999, 2000, 2003, 2004, 2005 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +# 02110-1301, USA. + +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +# Originally written by Alexandre Oliva . + +case $1 in + '') + echo "$0: No command. Try \`$0 --help' for more information." 1>&2 + exit 1; + ;; + -h | --h*) + cat <<\EOF +Usage: depcomp [--help] [--version] PROGRAM [ARGS] + +Run PROGRAMS ARGS to compile a file, generating dependencies +as side-effects. + +Environment variables: + depmode Dependency tracking mode. + source Source file read by `PROGRAMS ARGS'. + object Object file output by `PROGRAMS ARGS'. + DEPDIR directory where to store dependencies. + depfile Dependency file to output. + tmpdepfile Temporary file to use when outputing dependencies. + libtool Whether libtool is used (yes/no). + +Report bugs to . +EOF + exit $? + ;; + -v | --v*) + echo "depcomp $scriptversion" + exit $? + ;; +esac + +if test -z "$depmode" || test -z "$source" || test -z "$object"; then + echo "depcomp: Variables source, object and depmode must be set" 1>&2 + exit 1 +fi + +# Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po. +depfile=${depfile-`echo "$object" | + sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`} +tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`} + +rm -f "$tmpdepfile" + +# Some modes work just like other modes, but use different flags. We +# parameterize here, but still list the modes in the big case below, +# to make depend.m4 easier to write. Note that we *cannot* use a case +# here, because this file can only contain one case statement. +if test "$depmode" = hp; then + # HP compiler uses -M and no extra arg. + gccflag=-M + depmode=gcc +fi + +if test "$depmode" = dashXmstdout; then + # This is just like dashmstdout with a different argument. + dashmflag=-xM + depmode=dashmstdout +fi + +case "$depmode" in +gcc3) +## gcc 3 implements dependency tracking that does exactly what +## we want. Yay! Note: for some reason libtool 1.4 doesn't like +## it if -MD -MP comes after the -MF stuff. Hmm. + "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" + stat=$? + if test $stat -eq 0; then : + else + rm -f "$tmpdepfile" + exit $stat + fi + mv "$tmpdepfile" "$depfile" + ;; + +gcc) +## There are various ways to get dependency output from gcc. Here's +## why we pick this rather obscure method: +## - Don't want to use -MD because we'd like the dependencies to end +## up in a subdir. Having to rename by hand is ugly. +## (We might end up doing this anyway to support other compilers.) +## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like +## -MM, not -M (despite what the docs say). +## - Using -M directly means running the compiler twice (even worse +## than renaming). + if test -z "$gccflag"; then + gccflag=-MD, + fi + "$@" -Wp,"$gccflag$tmpdepfile" + stat=$? + if test $stat -eq 0; then : + else + rm -f "$tmpdepfile" + exit $stat + fi + rm -f "$depfile" + echo "$object : \\" > "$depfile" + alpha=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz +## The second -e expression handles DOS-style file names with drive letters. + sed -e 's/^[^:]*: / /' \ + -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile" +## This next piece of magic avoids the `deleted header file' problem. +## The problem is that when a header file which appears in a .P file +## is deleted, the dependency causes make to die (because there is +## typically no way to rebuild the header). We avoid this by adding +## dummy dependencies for each header file. Too bad gcc doesn't do +## this for us directly. + tr ' ' ' +' < "$tmpdepfile" | +## Some versions of gcc put a space before the `:'. On the theory +## that the space means something, we add a space to the output as +## well. +## Some versions of the HPUX 10.20 sed can't process this invocation +## correctly. Breaking it into two sed invocations is a workaround. + sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +hp) + # This case exists only to let depend.m4 do its work. It works by + # looking at the text of this script. This case will never be run, + # since it is checked for above. + exit 1 + ;; + +sgi) + if test "$libtool" = yes; then + "$@" "-Wp,-MDupdate,$tmpdepfile" + else + "$@" -MDupdate "$tmpdepfile" + fi + stat=$? + if test $stat -eq 0; then : + else + rm -f "$tmpdepfile" + exit $stat + fi + rm -f "$depfile" + + if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files + echo "$object : \\" > "$depfile" + + # Clip off the initial element (the dependent). Don't try to be + # clever and replace this with sed code, as IRIX sed won't handle + # lines with more than a fixed number of characters (4096 in + # IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines; + # the IRIX cc adds comments like `#:fec' to the end of the + # dependency line. + tr ' ' ' +' < "$tmpdepfile" \ + | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \ + tr ' +' ' ' >> $depfile + echo >> $depfile + + # The second pass generates a dummy entry for each header file. + tr ' ' ' +' < "$tmpdepfile" \ + | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \ + >> $depfile + else + # The sourcefile does not contain any dependencies, so just + # store a dummy comment line, to avoid errors with the Makefile + # "include basename.Plo" scheme. + echo "#dummy" > "$depfile" + fi + rm -f "$tmpdepfile" + ;; + +aix) + # The C for AIX Compiler uses -M and outputs the dependencies + # in a .u file. In older versions, this file always lives in the + # current directory. Also, the AIX compiler puts `$object:' at the + # start of each line; $object doesn't have directory information. + # Version 6 uses the directory in both cases. + stripped=`echo "$object" | sed 's/\(.*\)\..*$/\1/'` + tmpdepfile="$stripped.u" + if test "$libtool" = yes; then + "$@" -Wc,-M + else + "$@" -M + fi + stat=$? + + if test -f "$tmpdepfile"; then : + else + stripped=`echo "$stripped" | sed 's,^.*/,,'` + tmpdepfile="$stripped.u" + fi + + if test $stat -eq 0; then : + else + rm -f "$tmpdepfile" + exit $stat + fi + + if test -f "$tmpdepfile"; then + outname="$stripped.o" + # Each line is of the form `foo.o: dependent.h'. + # Do two passes, one to just change these to + # `$object: dependent.h' and one to simply `dependent.h:'. + sed -e "s,^$outname:,$object :," < "$tmpdepfile" > "$depfile" + sed -e "s,^$outname: \(.*\)$,\1:," < "$tmpdepfile" >> "$depfile" + else + # The sourcefile does not contain any dependencies, so just + # store a dummy comment line, to avoid errors with the Makefile + # "include basename.Plo" scheme. + echo "#dummy" > "$depfile" + fi + rm -f "$tmpdepfile" + ;; + +icc) + # Intel's C compiler understands `-MD -MF file'. However on + # icc -MD -MF foo.d -c -o sub/foo.o sub/foo.c + # ICC 7.0 will fill foo.d with something like + # foo.o: sub/foo.c + # foo.o: sub/foo.h + # which is wrong. We want: + # sub/foo.o: sub/foo.c + # sub/foo.o: sub/foo.h + # sub/foo.c: + # sub/foo.h: + # ICC 7.1 will output + # foo.o: sub/foo.c sub/foo.h + # and will wrap long lines using \ : + # foo.o: sub/foo.c ... \ + # sub/foo.h ... \ + # ... + + "$@" -MD -MF "$tmpdepfile" + stat=$? + if test $stat -eq 0; then : + else + rm -f "$tmpdepfile" + exit $stat + fi + rm -f "$depfile" + # Each line is of the form `foo.o: dependent.h', + # or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'. + # Do two passes, one to just change these to + # `$object: dependent.h' and one to simply `dependent.h:'. + sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile" + # Some versions of the HPUX 10.20 sed can't process this invocation + # correctly. Breaking it into two sed invocations is a workaround. + sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" | + sed -e 's/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +tru64) + # The Tru64 compiler uses -MD to generate dependencies as a side + # effect. `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'. + # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put + # dependencies in `foo.d' instead, so we check for that too. + # Subdirectories are respected. + dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` + test "x$dir" = "x$object" && dir= + base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` + + if test "$libtool" = yes; then + # With Tru64 cc, shared objects can also be used to make a + # static library. This mecanism is used in libtool 1.4 series to + # handle both shared and static libraries in a single compilation. + # With libtool 1.4, dependencies were output in $dir.libs/$base.lo.d. + # + # With libtool 1.5 this exception was removed, and libtool now + # generates 2 separate objects for the 2 libraries. These two + # compilations output dependencies in in $dir.libs/$base.o.d and + # in $dir$base.o.d. We have to check for both files, because + # one of the two compilations can be disabled. We should prefer + # $dir$base.o.d over $dir.libs/$base.o.d because the latter is + # automatically cleaned when .libs/ is deleted, while ignoring + # the former would cause a distcleancheck panic. + tmpdepfile1=$dir.libs/$base.lo.d # libtool 1.4 + tmpdepfile2=$dir$base.o.d # libtool 1.5 + tmpdepfile3=$dir.libs/$base.o.d # libtool 1.5 + tmpdepfile4=$dir.libs/$base.d # Compaq CCC V6.2-504 + "$@" -Wc,-MD + else + tmpdepfile1=$dir$base.o.d + tmpdepfile2=$dir$base.d + tmpdepfile3=$dir$base.d + tmpdepfile4=$dir$base.d + "$@" -MD + fi + + stat=$? + if test $stat -eq 0; then : + else + rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4" + exit $stat + fi + + for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4" + do + test -f "$tmpdepfile" && break + done + if test -f "$tmpdepfile"; then + sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile" + # That's a tab and a space in the []. + sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile" + else + echo "#dummy" > "$depfile" + fi + rm -f "$tmpdepfile" + ;; + +#nosideeffect) + # This comment above is used by automake to tell side-effect + # dependency tracking mechanisms from slower ones. + +dashmstdout) + # Important note: in order to support this mode, a compiler *must* + # always write the preprocessed file to stdout, regardless of -o. + "$@" || exit $? + + # Remove the call to Libtool. + if test "$libtool" = yes; then + while test $1 != '--mode=compile'; do + shift + done + shift + fi + + # Remove `-o $object'. + IFS=" " + for arg + do + case $arg in + -o) + shift + ;; + $object) + shift + ;; + *) + set fnord "$@" "$arg" + shift # fnord + shift # $arg + ;; + esac + done + + test -z "$dashmflag" && dashmflag=-M + # Require at least two characters before searching for `:' + # in the target name. This is to cope with DOS-style filenames: + # a dependency such as `c:/foo/bar' could be seen as target `c' otherwise. + "$@" $dashmflag | + sed 's:^[ ]*[^: ][^:][^:]*\:[ ]*:'"$object"'\: :' > "$tmpdepfile" + rm -f "$depfile" + cat < "$tmpdepfile" > "$depfile" + tr ' ' ' +' < "$tmpdepfile" | \ +## Some versions of the HPUX 10.20 sed can't process this invocation +## correctly. Breaking it into two sed invocations is a workaround. + sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +dashXmstdout) + # This case only exists to satisfy depend.m4. It is never actually + # run, as this mode is specially recognized in the preamble. + exit 1 + ;; + +makedepend) + "$@" || exit $? + # Remove any Libtool call + if test "$libtool" = yes; then + while test $1 != '--mode=compile'; do + shift + done + shift + fi + # X makedepend + shift + cleared=no + for arg in "$@"; do + case $cleared in + no) + set ""; shift + cleared=yes ;; + esac + case "$arg" in + -D*|-I*) + set fnord "$@" "$arg"; shift ;; + # Strip any option that makedepend may not understand. Remove + # the object too, otherwise makedepend will parse it as a source file. + -*|$object) + ;; + *) + set fnord "$@" "$arg"; shift ;; + esac + done + obj_suffix="`echo $object | sed 's/^.*\././'`" + touch "$tmpdepfile" + ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@" + rm -f "$depfile" + cat < "$tmpdepfile" > "$depfile" + sed '1,2d' "$tmpdepfile" | tr ' ' ' +' | \ +## Some versions of the HPUX 10.20 sed can't process this invocation +## correctly. Breaking it into two sed invocations is a workaround. + sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" "$tmpdepfile".bak + ;; + +cpp) + # Important note: in order to support this mode, a compiler *must* + # always write the preprocessed file to stdout. + "$@" || exit $? + + # Remove the call to Libtool. + if test "$libtool" = yes; then + while test $1 != '--mode=compile'; do + shift + done + shift + fi + + # Remove `-o $object'. + IFS=" " + for arg + do + case $arg in + -o) + shift + ;; + $object) + shift + ;; + *) + set fnord "$@" "$arg" + shift # fnord + shift # $arg + ;; + esac + done + + "$@" -E | + sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ + -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' | + sed '$ s: \\$::' > "$tmpdepfile" + rm -f "$depfile" + echo "$object : \\" > "$depfile" + cat < "$tmpdepfile" >> "$depfile" + sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +msvisualcpp) + # Important note: in order to support this mode, a compiler *must* + # always write the preprocessed file to stdout, regardless of -o, + # because we must use -o when running libtool. + "$@" || exit $? + IFS=" " + for arg + do + case "$arg" in + "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI") + set fnord "$@" + shift + shift + ;; + *) + set fnord "$@" "$arg" + shift + shift + ;; + esac + done + "$@" -E | + sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::echo "`cygpath -u \\"\1\\"`":p' | sort | uniq > "$tmpdepfile" + rm -f "$depfile" + echo "$object : \\" > "$depfile" + . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s:: \1 \\:p' >> "$depfile" + echo " " >> "$depfile" + . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s::\1\::p' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +none) + exec "$@" + ;; + +*) + echo "Unknown depmode $depmode" 1>&2 + exit 1 + ;; +esac + +exit 0 + +# Local Variables: +# mode: shell-script +# sh-indentation: 2 +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-end: "$" +# End: diff --git a/app/xf86dga/dga.c b/app/xf86dga/dga.c new file mode 100644 index 000000000..7305ecd29 --- /dev/null +++ b/app/xf86dga/dga.c @@ -0,0 +1,275 @@ +/* $XFree86: xc/programs/xf86dga/dga.c,v 3.19 2001/10/28 03:34:32 tsi Exp $ */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + + + +#define MINMAJOR 0 +#define MINMINOR 0 + +/* copied from xf86Io.c */ +static int +GetTimeInMillis(void) +{ + struct timeval tp; + + gettimeofday(&tp, 0); + return(tp.tv_sec * 1000) + (tp.tv_usec / 1000); +} + +int +main(int argc, char *argv[]) +{ + int MajorVersion, MinorVersion; + int EventBase, ErrorBase; + Display *dis; + int i, bpp; + char *addr; + int width, bank, banks, ram; + XEvent event; + Colormap cmap = 0; + Visual *vis; + int flags; + + if (geteuid()) { + fprintf(stderr, "Must be suid root\n"); + exit(1); + } + + if ( (dis = XOpenDisplay(NULL)) == NULL ) + { + (void) fprintf( stderr, " cannot connect to X server %s\n", + XDisplayName(NULL)); + exit( -1 ); + } + + + if (!XF86DGAQueryVersion(dis, &MajorVersion, &MinorVersion)) + { + fprintf(stderr, "Unable to query video extension version\n"); + exit(2); + } + + if (!XF86DGAQueryExtension(dis, &EventBase, &ErrorBase)) { + fprintf(stderr, "Unable to query video extension information\n"); + exit(2); + } + + /* Fail if the extension version in the server is too old */ + if (MajorVersion < MINMAJOR || + (MajorVersion == MINMAJOR && MinorVersion < MINMINOR)) { + fprintf(stderr, + "Xserver is running an old XFree86-DGA version" + " (%d.%d)\n", MajorVersion, MinorVersion); + fprintf(stderr, "Minimum required version is %d.%d\n", + MINMAJOR, MINMINOR); + exit(2); + } + + XF86DGAQueryDirectVideo(dis, DefaultScreen(dis), &flags); + if (!(flags & XF86DGADirectPresent)) { + fprintf(stderr, "Xserver driver doesn't support DirectVideo on screen %d\n", DefaultScreen(dis) ); + exit(2); + } + + XGrabKeyboard(dis, DefaultRootWindow(dis), True, GrabModeAsync, + GrabModeAsync, CurrentTime); + + /* and all the mouse moves */ + XGrabPointer(dis, DefaultRootWindow(dis), True, + PointerMotionMask | ButtonPressMask | ButtonReleaseMask, + GrabModeAsync, GrabModeAsync, None, None, CurrentTime); + /* we want _our_ cmap */ + vis = DefaultVisual(dis, DefaultScreen(dis)); + + bpp = DisplayPlanes (dis, DefaultScreen(dis)); + + + if (bpp <= 8) + { + cmap = XCreateColormap(dis, DefaultRootWindow(dis), vis, AllocAll); + + for (i = 0; i < 256; i++) { + XColor xcol; + + xcol.pixel = i; + xcol.red = (256 - i) * 255; + xcol.green = i * 255; + xcol.blue = ((128 - i)%256) * 255; + xcol.flags = DoBlue | DoGreen | DoRed; + XStoreColor(dis, cmap, &xcol); + } + } + + /* + * Lets go live + */ + + XF86DGAGetVideo(dis, DefaultScreen(dis), &addr, &width, &bank, &ram); + fprintf(stderr, "%x addr:%p, width %d, bank size %d, depth %d planes\n", True, + addr, width, bank, bpp); + + XF86DGADirectVideo(dis, DefaultScreen(dis), + XF86DGADirectGraphics| + XF86DGADirectMouse| + XF86DGADirectKeyb); + + if (bpp <= 8) + { + /* must be called _after_ entering DGA DirectGraphics mode */ + XF86DGAInstallColormap(dis, DefaultScreen(dis), cmap); + } + + +#ifndef __UNIXOS2__ + /* Give up root privs */ + if (setuid(getuid()) == -1) { + fprintf(stderr, "Unable to change uid: %s\n", strerror(errno)); + exit(2); + } +#endif + + XF86DGASetViewPort(dis, DefaultScreen(dis), 0, 0); + + banks = (ram * 1024)/bank; +#ifdef DEBUG + fprintf(stderr, "%x ram:%x, addr %x, banks %d\n", True, + ram, addr, banks); +#endif + while (1) { + XMotionEvent *mevent = (XMotionEvent *) &event; + XButtonEvent *bevent = (XButtonEvent *) &event; + int n_chars = 0; + char buf[21]; + KeySym ks = 0; + + i = 0; + XNextEvent(dis, &event); + switch (event.type) { + case KeyPress: + n_chars = XLookupString(&event.xkey, buf, 20, &ks, NULL); + buf[n_chars] = '\0'; + fprintf(stderr,"KeyPress [%d]: %s\n", event.xkey.keycode, buf); + + if (buf[0] == 'b') { + /* + * Benchmark mode: run write/read speed test for 1 second each + */ + int start_clock,finish_clock,diff_clock; + int cycles; + int size = 64; + void *membuf; + + if (bank < 65536) + size = bank / 1024; + + /* get write timings */ + XF86DGASetVidPage(dis, DefaultScreen(dis), i); + + start_clock = GetTimeInMillis(); finish_clock = start_clock; + + cycles=0; + while ((finish_clock - start_clock) < 1000) + { + cycles++; + memset(addr, (char) (cycles % 255), size * 1024); + finish_clock = GetTimeInMillis(); + } + + diff_clock = finish_clock - start_clock; + + fprintf(stderr, "Framebuffer write speed: %6dK/s\n", + (size * 1000 * cycles) / diff_clock); + + /* get read timings */ + if ((membuf=malloc(size*1024))) + { + XF86DGASetVidPage(dis, DefaultScreen(dis), i); + + start_clock = GetTimeInMillis(); finish_clock = start_clock; + + cycles=0; + while ((finish_clock - start_clock) < 1000) + { + cycles++; + memcpy(membuf, addr, size * 1024); + finish_clock = GetTimeInMillis(); + } + + diff_clock = finish_clock - start_clock; + + fprintf(stderr, "Framebuffer read speed: %6dK/s\n", + (size * 1000 * cycles) / diff_clock); + } + else + fprintf(stderr, "could not allocate scratch buffer -- read timing measurement skipped\n"); + } + + for (i = 0; i < banks; i++) { + XF86DGASetVidPage(dis, DefaultScreen(dis), i); + memset(addr, buf[0], bank); +#ifdef DEBUG + fprintf(stderr, "XF86DGASetVidPage(dis, DefaultScreen(dis), %d);\n",i); + fprintf(stderr, "memset(addr:%x, buf[0]:%d, bank:%d);\n",addr,buf[0],bank); +#endif + } + break; + case KeyRelease: + n_chars = XLookupString(&event.xkey, buf, 20, &ks, NULL); + buf[n_chars] = '\0'; + fprintf(stderr,"KeyRelease[%d]: %s\n", event.xkey.keycode, buf); + break; + case MotionNotify: + fprintf(stderr,"Relative Motion: %d %d\n", mevent->x_root, mevent->y_root); + break; + case ButtonPress: + fprintf(stderr,"Button %d pressed\n", bevent->button); + break; + case ButtonRelease: + fprintf(stderr,"Button %d released\n", bevent->button); + break; + case Expose: + /* maybe we should RaiseWindow? */ + break; + default: + fprintf(stderr,"%X\n", event.type); + break; + } + if (n_chars && (buf[0] == 'q' || buf[0] == 'Q')) { + fprintf(stderr,"EXITTING\n"); + break; + } + } + /* + * back to the X server + */ + XF86DGADirectVideo(dis, DefaultScreen(dis), 0); + fprintf(stderr, "back now in X\n"); + + /* and give back control */ + XUngrabPointer(dis, CurrentTime); + XUngrabKeyboard(dis, CurrentTime); + fprintf(stderr, "Thats all folks\n"); + exit(0); +} + + diff --git a/app/xf86dga/dga.man b/app/xf86dga/dga.man new file mode 100644 index 000000000..c7d9fc1a1 --- /dev/null +++ b/app/xf86dga/dga.man @@ -0,0 +1,16 @@ +.\" $XFree86: xc/programs/xf86dga/dga.man,v 3.4 1997/11/08 16:24:37 hohndel Exp $ +.\" +.TH dga 1 __vendorversion__ +.SH NAME +dga \- test program for the XFree86-DGA extension +.SH SYNOPSIS +.B dga +.SH DESCRIPTION +Dga is a simple test client for the XFree86-DGA extension. It fills +the screen with a different colour for each key pressed. +It prints some basic framebuffer parameters, and also +keyboard and pointer events to stdout. To exit, hit the `q' key. +Hitting the `b' key runs a simple benchmark, measuring raw framebuffer +write and read speed (this takes one second each). +.SH AUTHOR +Jon Tombs diff --git a/app/xf86dga/install-sh b/app/xf86dga/install-sh new file mode 100644 index 000000000..4d4a9519e --- /dev/null +++ b/app/xf86dga/install-sh @@ -0,0 +1,323 @@ +#!/bin/sh +# install - install a program, script, or datafile + +scriptversion=2005-05-14.22 + +# This originates from X11R5 (mit/util/scripts/install.sh), which was +# later released in X11R6 (xc/config/util/install.sh) with the +# following copyright and license. +# +# Copyright (C) 1994 X Consortium +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC- +# TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +# +# Except as contained in this notice, the name of the X Consortium shall not +# be used in advertising or otherwise to promote the sale, use or other deal- +# ings in this Software without prior written authorization from the X Consor- +# tium. +# +# +# FSF changes to this file are in the public domain. +# +# Calling this script install-sh is preferred over install.sh, to prevent +# `make' implicit rules from creating a file called install from it +# when there is no Makefile. +# +# This script is compatible with the BSD install script, but was written +# from scratch. It can only install one file at a time, a restriction +# shared with many OS's install programs. + +# set DOITPROG to echo to test this script + +# Don't use :- since 4.3BSD and earlier shells don't like it. +doit="${DOITPROG-}" + +# put in absolute paths if you don't have them in your path; or use env. vars. + +mvprog="${MVPROG-mv}" +cpprog="${CPPROG-cp}" +chmodprog="${CHMODPROG-chmod}" +chownprog="${CHOWNPROG-chown}" +chgrpprog="${CHGRPPROG-chgrp}" +stripprog="${STRIPPROG-strip}" +rmprog="${RMPROG-rm}" +mkdirprog="${MKDIRPROG-mkdir}" + +chmodcmd="$chmodprog 0755" +chowncmd= +chgrpcmd= +stripcmd= +rmcmd="$rmprog -f" +mvcmd="$mvprog" +src= +dst= +dir_arg= +dstarg= +no_target_directory= + +usage="Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE + or: $0 [OPTION]... SRCFILES... DIRECTORY + or: $0 [OPTION]... -t DIRECTORY SRCFILES... + or: $0 [OPTION]... -d DIRECTORIES... + +In the 1st form, copy SRCFILE to DSTFILE. +In the 2nd and 3rd, copy all SRCFILES to DIRECTORY. +In the 4th, create DIRECTORIES. + +Options: +-c (ignored) +-d create directories instead of installing files. +-g GROUP $chgrpprog installed files to GROUP. +-m MODE $chmodprog installed files to MODE. +-o USER $chownprog installed files to USER. +-s $stripprog installed files. +-t DIRECTORY install into DIRECTORY. +-T report an error if DSTFILE is a directory. +--help display this help and exit. +--version display version info and exit. + +Environment variables override the default commands: + CHGRPPROG CHMODPROG CHOWNPROG CPPROG MKDIRPROG MVPROG RMPROG STRIPPROG +" + +while test -n "$1"; do + case $1 in + -c) shift + continue;; + + -d) dir_arg=true + shift + continue;; + + -g) chgrpcmd="$chgrpprog $2" + shift + shift + continue;; + + --help) echo "$usage"; exit $?;; + + -m) chmodcmd="$chmodprog $2" + shift + shift + continue;; + + -o) chowncmd="$chownprog $2" + shift + shift + continue;; + + -s) stripcmd=$stripprog + shift + continue;; + + -t) dstarg=$2 + shift + shift + continue;; + + -T) no_target_directory=true + shift + continue;; + + --version) echo "$0 $scriptversion"; exit $?;; + + *) # When -d is used, all remaining arguments are directories to create. + # When -t is used, the destination is already specified. + test -n "$dir_arg$dstarg" && break + # Otherwise, the last argument is the destination. Remove it from $@. + for arg + do + if test -n "$dstarg"; then + # $@ is not empty: it contains at least $arg. + set fnord "$@" "$dstarg" + shift # fnord + fi + shift # arg + dstarg=$arg + done + break;; + esac +done + +if test -z "$1"; then + if test -z "$dir_arg"; then + echo "$0: no input file specified." >&2 + exit 1 + fi + # It's OK to call `install-sh -d' without argument. + # This can happen when creating conditional directories. + exit 0 +fi + +for src +do + # Protect names starting with `-'. + case $src in + -*) src=./$src ;; + esac + + if test -n "$dir_arg"; then + dst=$src + src= + + if test -d "$dst"; then + mkdircmd=: + chmodcmd= + else + mkdircmd=$mkdirprog + fi + else + # Waiting for this to be detected by the "$cpprog $src $dsttmp" command + # might cause directories to be created, which would be especially bad + # if $src (and thus $dsttmp) contains '*'. + if test ! -f "$src" && test ! -d "$src"; then + echo "$0: $src does not exist." >&2 + exit 1 + fi + + if test -z "$dstarg"; then + echo "$0: no destination specified." >&2 + exit 1 + fi + + dst=$dstarg + # Protect names starting with `-'. + case $dst in + -*) dst=./$dst ;; + esac + + # If destination is a directory, append the input filename; won't work + # if double slashes aren't ignored. + if test -d "$dst"; then + if test -n "$no_target_directory"; then + echo "$0: $dstarg: Is a directory" >&2 + exit 1 + fi + dst=$dst/`basename "$src"` + fi + fi + + # This sed command emulates the dirname command. + dstdir=`echo "$dst" | sed -e 's,/*$,,;s,[^/]*$,,;s,/*$,,;s,^$,.,'` + + # Make sure that the destination directory exists. + + # Skip lots of stat calls in the usual case. + if test ! -d "$dstdir"; then + defaultIFS=' + ' + IFS="${IFS-$defaultIFS}" + + oIFS=$IFS + # Some sh's can't handle IFS=/ for some reason. + IFS='%' + set x `echo "$dstdir" | sed -e 's@/@%@g' -e 's@^%@/@'` + shift + IFS=$oIFS + + pathcomp= + + while test $# -ne 0 ; do + pathcomp=$pathcomp$1 + shift + if test ! -d "$pathcomp"; then + $mkdirprog "$pathcomp" + # mkdir can fail with a `File exist' error in case several + # install-sh are creating the directory concurrently. This + # is OK. + test -d "$pathcomp" || exit + fi + pathcomp=$pathcomp/ + done + fi + + if test -n "$dir_arg"; then + $doit $mkdircmd "$dst" \ + && { test -z "$chowncmd" || $doit $chowncmd "$dst"; } \ + && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } \ + && { test -z "$stripcmd" || $doit $stripcmd "$dst"; } \ + && { test -z "$chmodcmd" || $doit $chmodcmd "$dst"; } + + else + dstfile=`basename "$dst"` + + # Make a couple of temp file names in the proper directory. + dsttmp=$dstdir/_inst.$$_ + rmtmp=$dstdir/_rm.$$_ + + # Trap to clean up those temp files at exit. + trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0 + trap '(exit $?); exit' 1 2 13 15 + + # Copy the file name to the temp name. + $doit $cpprog "$src" "$dsttmp" && + + # and set any options; do chmod last to preserve setuid bits. + # + # If any of these fail, we abort the whole thing. If we want to + # ignore errors from any of these, just make sure not to ignore + # errors from the above "$doit $cpprog $src $dsttmp" command. + # + { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } \ + && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } \ + && { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } \ + && { test -z "$chmodcmd" || $doit $chmodcmd "$dsttmp"; } && + + # Now rename the file to the real destination. + { $doit $mvcmd -f "$dsttmp" "$dstdir/$dstfile" 2>/dev/null \ + || { + # The rename failed, perhaps because mv can't rename something else + # to itself, or perhaps because mv is so ancient that it does not + # support -f. + + # Now remove or move aside any old file at destination location. + # We try this two ways since rm can't unlink itself on some + # systems and the destination file might be busy for other + # reasons. In this case, the final cleanup might fail but the new + # file should still install successfully. + { + if test -f "$dstdir/$dstfile"; then + $doit $rmcmd -f "$dstdir/$dstfile" 2>/dev/null \ + || $doit $mvcmd -f "$dstdir/$dstfile" "$rmtmp" 2>/dev/null \ + || { + echo "$0: cannot unlink or rename $dstdir/$dstfile" >&2 + (exit 1); exit 1 + } + else + : + fi + } && + + # Now rename the file to the real destination. + $doit $mvcmd "$dsttmp" "$dstdir/$dstfile" + } + } + fi || { (exit 1); exit 1; } +done + +# The final little trick to "correctly" pass the exit status to the exit trap. +{ + (exit 0); exit 0 +} + +# Local variables: +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-end: "$" +# End: diff --git a/app/xf86dga/missing b/app/xf86dga/missing new file mode 100644 index 000000000..894e786e1 --- /dev/null +++ b/app/xf86dga/missing @@ -0,0 +1,360 @@ +#! /bin/sh +# Common stub for a few missing GNU programs while installing. + +scriptversion=2005-06-08.21 + +# Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005 +# Free Software Foundation, Inc. +# Originally by Fran,cois Pinard , 1996. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +# 02110-1301, USA. + +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +if test $# -eq 0; then + echo 1>&2 "Try \`$0 --help' for more information" + exit 1 +fi + +run=: + +# In the cases where this matters, `missing' is being run in the +# srcdir already. +if test -f configure.ac; then + configure_ac=configure.ac +else + configure_ac=configure.in +fi + +msg="missing on your system" + +case "$1" in +--run) + # Try to run requested program, and just exit if it succeeds. + run= + shift + "$@" && exit 0 + # Exit code 63 means version mismatch. This often happens + # when the user try to use an ancient version of a tool on + # a file that requires a minimum version. In this case we + # we should proceed has if the program had been absent, or + # if --run hadn't been passed. + if test $? = 63; then + run=: + msg="probably too old" + fi + ;; + + -h|--h|--he|--hel|--help) + echo "\ +$0 [OPTION]... PROGRAM [ARGUMENT]... + +Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an +error status if there is no known handling for PROGRAM. + +Options: + -h, --help display this help and exit + -v, --version output version information and exit + --run try to run the given command, and emulate it if it fails + +Supported PROGRAM values: + aclocal touch file \`aclocal.m4' + autoconf touch file \`configure' + autoheader touch file \`config.h.in' + automake touch all \`Makefile.in' files + bison create \`y.tab.[ch]', if possible, from existing .[ch] + flex create \`lex.yy.c', if possible, from existing .c + help2man touch the output file + lex create \`lex.yy.c', if possible, from existing .c + makeinfo touch the output file + tar try tar, gnutar, gtar, then tar without non-portable flags + yacc create \`y.tab.[ch]', if possible, from existing .[ch] + +Send bug reports to ." + exit $? + ;; + + -v|--v|--ve|--ver|--vers|--versi|--versio|--version) + echo "missing $scriptversion (GNU Automake)" + exit $? + ;; + + -*) + echo 1>&2 "$0: Unknown \`$1' option" + echo 1>&2 "Try \`$0 --help' for more information" + exit 1 + ;; + +esac + +# Now exit if we have it, but it failed. Also exit now if we +# don't have it and --version was passed (most likely to detect +# the program). +case "$1" in + lex|yacc) + # Not GNU programs, they don't have --version. + ;; + + tar) + if test -n "$run"; then + echo 1>&2 "ERROR: \`tar' requires --run" + exit 1 + elif test "x$2" = "x--version" || test "x$2" = "x--help"; then + exit 1 + fi + ;; + + *) + if test -z "$run" && ($1 --version) > /dev/null 2>&1; then + # We have it, but it failed. + exit 1 + elif test "x$2" = "x--version" || test "x$2" = "x--help"; then + # Could not run --version or --help. This is probably someone + # running `$TOOL --version' or `$TOOL --help' to check whether + # $TOOL exists and not knowing $TOOL uses missing. + exit 1 + fi + ;; +esac + +# If it does not exist, or fails to run (possibly an outdated version), +# try to emulate it. +case "$1" in + aclocal*) + echo 1>&2 "\ +WARNING: \`$1' is $msg. You should only need it if + you modified \`acinclude.m4' or \`${configure_ac}'. You might want + to install the \`Automake' and \`Perl' packages. Grab them from + any GNU archive site." + touch aclocal.m4 + ;; + + autoconf) + echo 1>&2 "\ +WARNING: \`$1' is $msg. You should only need it if + you modified \`${configure_ac}'. You might want to install the + \`Autoconf' and \`GNU m4' packages. Grab them from any GNU + archive site." + touch configure + ;; + + autoheader) + echo 1>&2 "\ +WARNING: \`$1' is $msg. You should only need it if + you modified \`acconfig.h' or \`${configure_ac}'. You might want + to install the \`Autoconf' and \`GNU m4' packages. Grab them + from any GNU archive site." + files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}` + test -z "$files" && files="config.h" + touch_files= + for f in $files; do + case "$f" in + *:*) touch_files="$touch_files "`echo "$f" | + sed -e 's/^[^:]*://' -e 's/:.*//'`;; + *) touch_files="$touch_files $f.in";; + esac + done + touch $touch_files + ;; + + automake*) + echo 1>&2 "\ +WARNING: \`$1' is $msg. You should only need it if + you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'. + You might want to install the \`Automake' and \`Perl' packages. + Grab them from any GNU archive site." + find . -type f -name Makefile.am -print | + sed 's/\.am$/.in/' | + while read f; do touch "$f"; done + ;; + + autom4te) + echo 1>&2 "\ +WARNING: \`$1' is needed, but is $msg. + You might have modified some files without having the + proper tools for further handling them. + You can get \`$1' as part of \`Autoconf' from any GNU + archive site." + + file=`echo "$*" | sed -n 's/.*--output[ =]*\([^ ]*\).*/\1/p'` + test -z "$file" && file=`echo "$*" | sed -n 's/.*-o[ ]*\([^ ]*\).*/\1/p'` + if test -f "$file"; then + touch $file + else + test -z "$file" || exec >$file + echo "#! /bin/sh" + echo "# Created by GNU Automake missing as a replacement of" + echo "# $ $@" + echo "exit 0" + chmod +x $file + exit 1 + fi + ;; + + bison|yacc) + echo 1>&2 "\ +WARNING: \`$1' $msg. You should only need it if + you modified a \`.y' file. You may need the \`Bison' package + in order for those modifications to take effect. You can get + \`Bison' from any GNU archive site." + rm -f y.tab.c y.tab.h + if [ $# -ne 1 ]; then + eval LASTARG="\${$#}" + case "$LASTARG" in + *.y) + SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'` + if [ -f "$SRCFILE" ]; then + cp "$SRCFILE" y.tab.c + fi + SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'` + if [ -f "$SRCFILE" ]; then + cp "$SRCFILE" y.tab.h + fi + ;; + esac + fi + if [ ! -f y.tab.h ]; then + echo >y.tab.h + fi + if [ ! -f y.tab.c ]; then + echo 'main() { return 0; }' >y.tab.c + fi + ;; + + lex|flex) + echo 1>&2 "\ +WARNING: \`$1' is $msg. You should only need it if + you modified a \`.l' file. You may need the \`Flex' package + in order for those modifications to take effect. You can get + \`Flex' from any GNU archive site." + rm -f lex.yy.c + if [ $# -ne 1 ]; then + eval LASTARG="\${$#}" + case "$LASTARG" in + *.l) + SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'` + if [ -f "$SRCFILE" ]; then + cp "$SRCFILE" lex.yy.c + fi + ;; + esac + fi + if [ ! -f lex.yy.c ]; then + echo 'main() { return 0; }' >lex.yy.c + fi + ;; + + help2man) + echo 1>&2 "\ +WARNING: \`$1' is $msg. You should only need it if + you modified a dependency of a manual page. You may need the + \`Help2man' package in order for those modifications to take + effect. You can get \`Help2man' from any GNU archive site." + + file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'` + if test -z "$file"; then + file=`echo "$*" | sed -n 's/.*--output=\([^ ]*\).*/\1/p'` + fi + if [ -f "$file" ]; then + touch $file + else + test -z "$file" || exec >$file + echo ".ab help2man is required to generate this page" + exit 1 + fi + ;; + + makeinfo) + echo 1>&2 "\ +WARNING: \`$1' is $msg. You should only need it if + you modified a \`.texi' or \`.texinfo' file, or any other file + indirectly affecting the aspect of the manual. The spurious + call might also be the consequence of using a buggy \`make' (AIX, + DU, IRIX). You might want to install the \`Texinfo' package or + the \`GNU make' package. Grab either from any GNU archive site." + # The file to touch is that specified with -o ... + file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'` + if test -z "$file"; then + # ... or it is the one specified with @setfilename ... + infile=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'` + file=`sed -n '/^@setfilename/ { s/.* \([^ ]*\) *$/\1/; p; q; }' $infile` + # ... or it is derived from the source name (dir/f.texi becomes f.info) + test -z "$file" && file=`echo "$infile" | sed 's,.*/,,;s,.[^.]*$,,'`.info + fi + # If the file does not exist, the user really needs makeinfo; + # let's fail without touching anything. + test -f $file || exit 1 + touch $file + ;; + + tar) + shift + + # We have already tried tar in the generic part. + # Look for gnutar/gtar before invocation to avoid ugly error + # messages. + if (gnutar --version > /dev/null 2>&1); then + gnutar "$@" && exit 0 + fi + if (gtar --version > /dev/null 2>&1); then + gtar "$@" && exit 0 + fi + firstarg="$1" + if shift; then + case "$firstarg" in + *o*) + firstarg=`echo "$firstarg" | sed s/o//` + tar "$firstarg" "$@" && exit 0 + ;; + esac + case "$firstarg" in + *h*) + firstarg=`echo "$firstarg" | sed s/h//` + tar "$firstarg" "$@" && exit 0 + ;; + esac + fi + + echo 1>&2 "\ +WARNING: I can't seem to be able to run \`tar' with the given arguments. + You may want to install GNU tar or Free paxutils, or check the + command line arguments." + exit 1 + ;; + + *) + echo 1>&2 "\ +WARNING: \`$1' is needed, and is $msg. + You might have modified some files without having the + proper tools for further handling them. Check the \`README' file, + it often tells you about the needed prerequisites for installing + this package. You may also peek at any GNU archive site, in case + some other package would contain this missing \`$1' program." + exit 1 + ;; +esac + +exit 0 + +# Local variables: +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-end: "$" +# End: